Pu Zhibing
2025-01-17 c80c0184b6e560d41d5aa5691874e07b681fa18f
ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/service/TokenService.java
@@ -5,6 +5,7 @@
import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletRequest;
import com.ruoyi.common.core.exception.auth.NotLoginException;
import com.ruoyi.common.core.exception.user.UserAppletException;
import com.ruoyi.system.api.model.LoginUserApplet;
import org.springframework.beans.factory.annotation.Autowired;
@@ -94,7 +95,7 @@
   public LoginUserApplet getLoginUserApplet() {
      LoginUserApplet loginUserAppletToken = getLoginUserAppletToken(ServletUtils.getRequest());
      if (loginUserAppletToken == null) {
         throw new RuntimeException("令牌已过期,请重新登录!");
         throw new NotLoginException("令牌已过期,请重新登录!");
      }
      return loginUserAppletToken;
   }
@@ -132,7 +133,7 @@
   public LoginUser getLoginUser() {
      LoginUser loginUser = getLoginUser(ServletUtils.getRequest());
      if (loginUser == null) {
         throw new RuntimeException("令牌已过期,请重新登录!");
         throw new NotLoginException("令牌已过期,请重新登录!");
      }
      return loginUser;
   }