diff --git a/sau_backend.py b/sau_backend.py index 1b41512..0b8a2ac 100644 --- a/sau_backend.py +++ b/sau_backend.py @@ -186,6 +186,37 @@ def get_all_files(): }), 500 +@app.route("/getAccounts", methods=['GET']) +def getAccounts(): + """快速获取所有账号信息,不进行cookie验证""" + try: + with sqlite3.connect(Path(BASE_DIR / "db" / "database.db")) as conn: + conn.row_factory = sqlite3.Row + cursor = conn.cursor() + cursor.execute(''' + SELECT * FROM user_info''') + rows = cursor.fetchall() + rows_list = [list(row) for row in rows] + + print("\n📋 当前数据表内容(快速获取):") + for row in rows: + print(row) + + return jsonify( + { + "code": 200, + "msg": None, + "data": rows_list + }), 200 + except Exception as e: + print(f"获取账号列表时出错: {str(e)}") + return jsonify({ + "code": 500, + "msg": f"获取账号列表失败: {str(e)}", + "data": None + }), 500 + + @app.route("/getValidAccounts",methods=['GET']) async def getValidAccounts(): with sqlite3.connect(Path(BASE_DIR / "db" / "database.db")) as conn: diff --git a/sau_frontend/src/api/account.js b/sau_frontend/src/api/account.js index 1001d60..309d3af 100644 --- a/sau_frontend/src/api/account.js +++ b/sau_frontend/src/api/account.js @@ -2,21 +2,26 @@ import { http } from '@/utils/request' // 账号管理相关API export const accountApi = { - // 获取有效账号列表 + // 获取有效账号列表(带验证) getValidAccounts() { return http.get('/getValidAccounts') }, - + + // 获取账号列表(不带验证,快速加载) + getAccounts() { + return http.get('/getAccounts') + }, + // 添加账号 addAccount(data) { return http.post('/account', data) }, - + // 更新账号 updateAccount(data) { return http.post('/updateUserinfo', data) }, - + // 删除账号 deleteAccount(id) { return http.get(`/deleteAccount?id=${id}`) diff --git a/sau_frontend/src/views/AccountManagement.vue b/sau_frontend/src/views/AccountManagement.vue index f833cb6..48e76f9 100644 --- a/sau_frontend/src/views/AccountManagement.vue +++ b/sau_frontend/src/views/AccountManagement.vue @@ -47,9 +47,12 @@ @@ -112,9 +115,12 @@ @@ -177,9 +183,12 @@ @@ -242,9 +251,12 @@ @@ -307,9 +319,12 @@ @@ -403,7 +418,7 @@