no message
This commit is contained in:
parent
be03b67e40
commit
0a01529f61
20
js/common.js
20
js/common.js
@ -19,22 +19,22 @@ function $ajax(url) {
|
||||
})
|
||||
.then(function (res) {
|
||||
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)
|
||||
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) showWindow("login", "https://passport.gter.net/login/ajax", "get", -1, { cover: true })
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function $ajaxget(url, data) {
|
||||
if (!data) data = {}
|
||||
|
||||
if (!data) data = {}
|
||||
|
||||
data["authorization"] = "813blr43ue2hhf2kjnlfibyy9swlxm2x"
|
||||
|
||||
url = url.indexOf("https://") > -1 ? url : projectBaseURL + url
|
||||
@ -51,11 +51,15 @@ function $ajaxget(url, data) {
|
||||
)
|
||||
.then(function (res) {
|
||||
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)
|
||||
resolve(data)
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.response.status == 401) showWindow("login", "https://passport.gter.net/login/ajax", "get", -1, { cover: true })
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user