| | |
| | | import java.util.concurrent.TimeUnit; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.ruoyi.common.core.exception.auth.NotPermissionException; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | public LoginUser getLoginUserApplet() { |
| | | LoginUser loginUserAppletToken = getLoginUserAppletToken(ServletUtils.getRequest()); |
| | | if (loginUserAppletToken == null) { |
| | | throw new RuntimeException("令牌已过期,请重新登录!"); |
| | | throw new NotPermissionException("令牌已过期,请重新登录!"); |
| | | } |
| | | return loginUserAppletToken; |
| | | } |
| | |
| | | public LoginUser getLoginUser() { |
| | | LoginUser loginUser = getLoginUser(ServletUtils.getRequest()); |
| | | if (loginUser == null) { |
| | | throw new RuntimeException("令牌已过期,请重新登录!"); |
| | | throw new NotPermissionException("令牌已过期,请重新登录!"); |
| | | } |
| | | if(null == loginUser.getUserid()){ |
| | | loginUser.setUserid(loginUser.getSysUser().getUserId()); |