no message

This commit is contained in:
A1300399510 2024-11-19 14:25:46 +08:00
parent 107d8ad0b5
commit 0d4b6bc26e
2 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,4 @@
{
"liveServer.settings.port": 5501
"liveServer.settings.port": 5501,
"marscode.chatLanguage": "cn"
}

View File

@ -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 })
}