diff --git a/applications/view/users.py b/applications/view/users.py index 561bfdb..67a14ee 100644 --- a/applications/view/users.py +++ b/applications/view/users.py @@ -23,13 +23,6 @@ def users_center(): return render_template('users/profile.html', user_info=current_user, user_logs=user_logs) -@index_bp.get('/users/add') -@authorize("admin:user:add", log=True) -def users_get_user(): - roles = Role.query.all() - return render_template('users/add.html', roles=roles) - - @index_bp.get('/users/') @authorize("admin:user:edit", log=True) def users_user_id_view(user_id): diff --git a/static/api/http.js b/static/api/http.js index 619183d..ff514d0 100644 --- a/static/api/http.js +++ b/static/api/http.js @@ -40,6 +40,16 @@ class Role { 'ROLE_POWER': (role_id) => `${this.ROLE_PATH}/role_power/${role_id}` } } + + async get_roles () { + return fetch(this.ROLE_API.ROLES()) + .then(function (response) { + return response.json() + }) + .then(function (myJson) { + return myJson + }) + } } class Users { diff --git a/templates/users/add.html b/templates/users/add.html deleted file mode 100644 index 5110bba..0000000 --- a/templates/users/add.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - 用户管理 - {% include 'common/header.html' %} - - -
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- -
- -
- - {% for role in roles %} - - {% endfor %} - -
-
-
-
-
-
- - -
-
-
-{% include 'common/footer.html' %} - - - - \ No newline at end of file diff --git a/templates/users/main.html b/templates/users/main.html index 99b1cd4..ed8d2c7 100644 --- a/templates/users/main.html +++ b/templates/users/main.html @@ -95,8 +95,55 @@ {% include 'common/footer.html' %} + +