Esempio n. 1
0
def delete_manager():
    """
    删除管理员
    :return:
    """
    user_name = request.json['user_name']

    if user_name:
        UserModelDao.set_group_id(user_name, 1)
        #  删除成功
        response_data = response[200]
    else:
        # 缺乏参数
        response_data = response[20101]

    return json.dumps(response_data, ensure_ascii=False)
Esempio n. 2
0
import csv
import pathlib
import time
import requests
from lxml import etree

create_all_table()

# 用户
GroupModelDao.add_group('普通用户')
GroupModelDao.add_group('管理员')
GroupModelDao.add_group('超级管理员')

# 添加一个超级用户
UserModelDao.add_user('SuperVisitor', 'veg_root#2019', '*****@*****.**')
UserModelDao.set_group_id('SuperVisitor', 3)

# 模型信息
PredictModelModelDao.add_model('bp', 'bp神经网络')
PredictModelModelDao.add_model('lstm', 'lstm神经网络')
PredictModelModelDao.add_model('arima', 'arima时间序列')

# 用户权限表
GroupPowerModelDao.add_one_power(1, '/user/register')
GroupPowerModelDao.add_one_power(1, '/user/login')
GroupPowerModelDao.add_one_power(1, '/user/alter_pwd')
GroupPowerModelDao.add_one_power(1, '/user/register/send_email')
GroupPowerModelDao.add_one_power(1, '/user/vegetable/k_line')
GroupPowerModelDao.add_one_power(1, '/user/alter_pwd/send_email')
GroupPowerModelDao.add_one_power(1, '/user/vegetable/information')
GroupPowerModelDao.add_one_power(1, '/user/vegetable/get_all_vegetables')