mirror of https://gitee.com/y_project/RuoYi.git
设置全局ajax超时处理
parent
95fc2f2d83
commit
4de464dc2d
|
@ -5,7 +5,6 @@ import java.util.List;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.security.ShiroUtils;
|
import com.ruoyi.common.utils.security.ShiroUtils;
|
||||||
import com.ruoyi.framework.shiro.service.PasswordService;
|
import com.ruoyi.framework.shiro.service.PasswordService;
|
||||||
|
|
|
@ -167,3 +167,16 @@ function createMenuItem(dataUrl, menuName) {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//设置全局ajax超时处理
|
||||||
|
$.ajaxSetup({
|
||||||
|
complete: function(XMLHttpRequest, textStatus) {
|
||||||
|
if (textStatus == "parsererror") {
|
||||||
|
$.modalConfirm("登陆超时!请重新登陆!", function() {
|
||||||
|
window.location.href = ctx + "login";
|
||||||
|
})
|
||||||
|
} else if (textStatus == "error") {
|
||||||
|
$.modalAlert("请求超时!请稍后再试!", 'warning');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in New Issue