diff --git a/src/main/java/com/ruoyi/project/system/user/service/UserServiceImpl.java b/src/main/java/com/ruoyi/project/system/user/service/UserServiceImpl.java index d9a73810..d8fdd4d6 100644 --- a/src/main/java/com/ruoyi/project/system/user/service/UserServiceImpl.java +++ b/src/main/java/com/ruoyi/project/system/user/service/UserServiceImpl.java @@ -5,7 +5,6 @@ import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.framework.shiro.service.PasswordService; diff --git a/src/main/resources/static/ruoyi/js/common.js b/src/main/resources/static/ruoyi/js/common.js index ee27e835..0ae96093 100644 --- a/src/main/resources/static/ruoyi/js/common.js +++ b/src/main/resources/static/ruoyi/js/common.js @@ -167,3 +167,16 @@ function createMenuItem(dataUrl, menuName) { } return false; } + +//设置全局ajax超时处理 +$.ajaxSetup({ + complete: function(XMLHttpRequest, textStatus) { + if (textStatus == "parsererror") { + $.modalConfirm("登陆超时!请重新登陆!", function() { + window.location.href = ctx + "login"; + }) + } else if (textStatus == "error") { + $.modalAlert("请求超时!请稍后再试!", 'warning'); + } + } +});