no message

This commit is contained in:
A1300399510 2024-11-12 16:07:32 +08:00
parent be03b67e40
commit 0a01529f61

View File

@ -19,15 +19,15 @@ function $ajax(url) {
}) })
.then(function (res) { .then(function (res) {
var data = typeof res.data == "string" ? JSON.parse(res.data) : res.data var data = typeof res.data == "string" ? JSON.parse(res.data) : res.data
if (data.code == 401) reject() if (data.code == 401) {
showWindow("login", "https://passport.gter.net/login/ajax", "get", -1, { cover: true })
reject()
}
if (data.code == 201) creationAlertBox("error", res.message || res.msg) if (data.code == 201) creationAlertBox("error", res.message || res.msg)
resolve(data) resolve(data)
}) })
.catch(err => { .catch(err => {
if (err.response.status == 401) if (err.response.status == 401) showWindow("login", "https://passport.gter.net/login/ajax", "get", -1, { cover: true })
showWindow("login", "https://passport.gter.net/login/ajax", "get", -1, {
cover: true,
})
}) })
}) })
} }
@ -51,11 +51,15 @@ function $ajaxget(url, data) {
) )
.then(function (res) { .then(function (res) {
var data = typeof res.data == "string" ? JSON.parse(res.data) : res.data var data = typeof res.data == "string" ? JSON.parse(res.data) : res.data
if (data.code == 401) reject() if (data.code == 401) {
showWindow("login", "https://passport.gter.net/login/ajax", "get", -1, { cover: true })
reject()
}
if (data.code == 201) creationAlertBox("error", res.message) if (data.code == 201) creationAlertBox("error", res.message)
resolve(data) resolve(data)
}) })
.catch(error => { .catch(error => {
if (error.response.status == 401) showWindow("login", "https://passport.gter.net/login/ajax", "get", -1, { cover: true })
reject(error) reject(error)
}) })
}) })