Пример #1
0
 def append(username, pwd, permission, identity_type='guest') -> int:
     try:
         if 'root' == username.lower():
             return -1
         session_obj = Session()
         if user.is_exist(username) >= 0:
             return -1
         user_obj = user_info(username=username,
                              pwd=pwd,
                              identity_type=identity_type,
                              user_path='/',
                              permission=permission)
         session_obj.add(user_obj)
         session_obj.commit()
         Session.remove()
     except Exception as e:
         Logger().get_logger().error(str(e))
         session_obj.rollback()
         return -2
     return 0
Пример #2
0
def user_center():
    user = db.user_info(session.get('username'))
    return render_template('user_center.html', user=user)
Пример #3
0
def userinfo():
    user = db.user_info(request.args.get('name'))
    return render_template('index.html', user=user)
Пример #4
0
def user_center():
    user = db.user_info(session.get('username'))
    return render_template('users/user_center.html', user=user, display = dis)