| | |
| | | |
| | | import cn.dev33.satoken.context.SaHolder; |
| | | import cn.dev33.satoken.context.model.SaStorage; |
| | | import cn.dev33.satoken.session.SaSession; |
| | | import cn.dev33.satoken.stp.SaLoginModel; |
| | | import cn.dev33.satoken.stp.StpUtil; |
| | | import cn.hutool.core.convert.Convert; |
| | |
| | | if (loginUser != null) { |
| | | return loginUser; |
| | | } |
| | | loginUser = (LoginUser) StpUtil.getTokenSession().get(LOGIN_USER_KEY); |
| | | SaHolder.getStorage().set(LOGIN_USER_KEY, loginUser); |
| | | SaSession tokenSession = StpUtil.getTokenSession(); |
| | | if (tokenSession != null) { |
| | | loginUser = (LoginUser) tokenSession.get(LOGIN_USER_KEY); |
| | | SaHolder.getStorage().set(LOGIN_USER_KEY, loginUser); |
| | | }; |
| | | return loginUser; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询版权信息 |
| | | * |
| | | */ |
| | | @GetMapping(value = "/configKey/copyright") |
| | | public R<String> getConfigKeyCopyright() { |
| | | return R.ok(configService.getConfigValue("sys","copyright")); |
| | | } |
| | | |
| | | /** |
| | | * 查询logoImage |
| | | * |
| | | */ |
| | | @GetMapping(value = "/configKey/logoImage") |
| | | public R<String> getConfigKeyLogoImage() { |
| | | return R.ok(configService.getConfigValue("sys","logoImage")); |
| | | } |
| | | |
| | | /** |
| | | * 查询系统参数 |
| | | * |
| | | */ |
| | |
| | | /** |
| | | * 获取公告列表 |
| | | */ |
| | | @SaCheckPermission("system:notice:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<SysNoticeVo> list(SysNoticeBo notice, PageQuery pageQuery) { |
| | | //公告类型(1通知 2公告) |
| | |
| | | TenantHelper.clearDynamic(); |
| | | } |
| | | StpUtil.logout(); |
| | | recordLogininfor(loginUser.getTenantId(), loginUser.getUsername(), Constants.LOGOUT, MessageUtils.message("user.logout.success")); |
| | | if (loginUser !=null) { |
| | | recordLogininfor(loginUser.getTenantId(), loginUser.getUsername(), Constants.LOGOUT, MessageUtils.message("user.logout.success")); |
| | | } |
| | | } catch (NotLoginException ignored) { |
| | | } |
| | | } |