mirror of
https://github.com/chatopera/cosin.git
synced 2025-08-01 16:38:02 +08:00
#70 AUTH 错误处理
This commit is contained in:
parent
4e6cd93cbd
commit
89f0fc2105
@ -99,6 +99,19 @@
|
|||||||
$.ajax(payload)
|
$.ajax(payload)
|
||||||
.done(function (data) {
|
.done(function (data) {
|
||||||
console.log('Rest api 返回的值:', data);
|
console.log('Rest api 返回的值:', data);
|
||||||
|
if (data.status && data.status === "AUTH_ERROR") {
|
||||||
|
layer.confirm('会话过期,请重新登录!', {
|
||||||
|
btn: ['是', '否'],
|
||||||
|
icon: 2,
|
||||||
|
title: '提示'
|
||||||
|
}, function (index, layero) {
|
||||||
|
layer.close(index)
|
||||||
|
top.location.href = '/logout.html'
|
||||||
|
}, function (index) {
|
||||||
|
// 取消方法
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (data.rc == 0) {
|
if (data.rc == 0) {
|
||||||
cb(null, data.data);
|
cb(null, data.data);
|
||||||
} else {
|
} else {
|
||||||
|
@ -51,6 +51,20 @@
|
|||||||
$.ajax(payload)
|
$.ajax(payload)
|
||||||
.done(function (data) {
|
.done(function (data) {
|
||||||
console.log('Rest api 返回的值:', data);
|
console.log('Rest api 返回的值:', data);
|
||||||
|
if (data.status && data.status === "AUTH_ERROR") {
|
||||||
|
layer.confirm('会话过期,请重新登录!', {
|
||||||
|
btn: ['是', '否'],
|
||||||
|
icon: 2,
|
||||||
|
title: '提示'
|
||||||
|
}, function (index, layero) {
|
||||||
|
layer.close(index)
|
||||||
|
top.location.href = '/logout.html'
|
||||||
|
}, function (index) {
|
||||||
|
// 取消方法
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (data.rc == 0) {
|
if (data.rc == 0) {
|
||||||
resolve(data.data);
|
resolve(data.data);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user