mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
fix: 修复设置自定义form回调时未执行终止逻辑的问题,导致的登录密码错误时再次请求失败
This commit is contained in:
@@ -144,15 +144,32 @@
|
||||
};
|
||||
complete = complete || function () {
|
||||
};
|
||||
no = no || function (res) {
|
||||
var msg = res.msg == undefined ? '返回数据格式有误' : res.msg;
|
||||
admin.msg.error(msg);
|
||||
complete();
|
||||
return false;
|
||||
};
|
||||
ex = ex || function (res) {
|
||||
complete();
|
||||
};
|
||||
if(no){
|
||||
var originalNo = no;
|
||||
no = function (res) {
|
||||
originalNo(res);
|
||||
complete();
|
||||
}
|
||||
}else{
|
||||
no = function (res) {
|
||||
var msg = res.msg == undefined ? '返回数据格式有误' : res.msg;
|
||||
admin.msg.error(msg);
|
||||
complete();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(ex){
|
||||
var originalEx = ex;
|
||||
ex = function (res) {
|
||||
originalEx(res);
|
||||
complete();
|
||||
}
|
||||
}else{
|
||||
ex = function (res) {
|
||||
complete();
|
||||
};
|
||||
}
|
||||
if (option.url == '') {
|
||||
admin.msg.error('请求地址不能为空');
|
||||
return false;
|
||||
@@ -2250,21 +2267,28 @@
|
||||
refreshTable = true;
|
||||
}
|
||||
|
||||
ok = ok || function (res) {
|
||||
res.msg = res.msg || '';
|
||||
admin.msg.success(res.msg, function () {
|
||||
|
||||
if (close) {
|
||||
admin.api.closeCurrentOpen({
|
||||
refreshTable: refreshTable,
|
||||
onClose: function () {
|
||||
complete();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
};
|
||||
if(ok){
|
||||
var originalOk = ok;
|
||||
ok = function (res) {
|
||||
originalOk(res);
|
||||
complete()
|
||||
}
|
||||
}else{
|
||||
ok = function (res) {
|
||||
res.msg = res.msg || '';
|
||||
admin.msg.success(res.msg, function () {
|
||||
if (close) {
|
||||
admin.api.closeCurrentOpen({
|
||||
refreshTable: refreshTable,
|
||||
onClose: function () {
|
||||
complete();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
};
|
||||
}
|
||||
admin.request.post({
|
||||
url: url,
|
||||
data: data,
|
||||
|
||||
Reference in New Issue
Block a user