From 0d4b6bc26eadb2d0031697fd5872dec9db0961f4 Mon Sep 17 00:00:00 2001 From: A1300399510 Date: Tue, 19 Nov 2024 14:25:46 +0800 Subject: [PATCH] no message --- .vscode/settings.json | 3 ++- js/common.js | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 6f3a291..8663fd5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "liveServer.settings.port": 5501 + "liveServer.settings.port": 5501, + "marscode.chatLanguage": "cn" } \ No newline at end of file diff --git a/js/common.js b/js/common.js index 37ec257..37036c4 100644 --- a/js/common.js +++ b/js/common.js @@ -21,14 +21,14 @@ function $ajax(url) { .then(function (res) { var data = typeof res.data == "string" ? JSON.parse(res.data) : res.data if (data.code == 401) { - showWindow("login", "https://passport.gter.net/login/ajax", "get", -1, { cover: true }) + openShowWindow() reject() } if (data.code == 201) creationAlertBox("error", data.message || data.msg) resolve(data) }) .catch(err => { - if (err.response?.status == 401) showWindow("login", "https://passport.gter.net/login/ajax", "get", -1, { cover: true }) + if (err.response?.status == 401) openShowWindow() }) }) } @@ -54,7 +54,7 @@ function $ajaxget(url, data) { .then(function (res) { var data = typeof res.data == "string" ? JSON.parse(res.data) : res.data if (data.code == 401) { - showWindow("login", "https://passport.gter.net/login/ajax", "get", -1, { cover: true }) + openShowWindow() reject() } if (data.code == 201) creationAlertBox("error", data.message || data.msg) @@ -62,7 +62,7 @@ function $ajaxget(url, data) { resolve(data) }) .catch(error => { - if (error.response?.status == 401) showWindow("login", "https://passport.gter.net/login/ajax", "get", -1, { cover: true }) + if (error.response?.status == 401) openShowWindow() reject(error) }) }) @@ -155,3 +155,7 @@ function getBaseData() { }) }) } + +function openShowWindow() { + showWindow("login", "https://passport.gter.net/login/ajax", "get", -1, { cover: true }) +}