|
@@ -1,11 +1,13 @@
|
|
|
package com.fjhx.xmhjc.controller.open;
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.fjhx.xmhjc.anno.LoginValid;
|
|
|
import com.fjhx.xmhjc.constants.LoginConstant;
|
|
|
import com.fjhx.xmhjc.entity.website.dto.WebsiteUsersDto;
|
|
|
import com.fjhx.xmhjc.entity.website.po.WebsiteUsers;
|
|
|
+import com.fjhx.xmhjc.entity.website.vo.UserInfoVo;
|
|
|
import com.fjhx.xmhjc.service.website.WebsiteUsersService;
|
|
|
import com.fjhx.xmhjc.utils.WebsiteUserUtil;
|
|
|
import com.ruoyi.common.core.redis.RedisCache;
|
|
@@ -68,6 +70,11 @@ public class OpenWesiteUserController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 登出
|
|
|
+ * @author hj
|
|
|
+ * @date 2023/11/17 10:45
|
|
|
+ */
|
|
|
@LoginValid
|
|
|
@PostMapping("/logout")
|
|
|
public void logout(){
|
|
@@ -75,5 +82,17 @@ public class OpenWesiteUserController {
|
|
|
redisCache.deleteObject(websiteUserToken);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 个人信息
|
|
|
+ * @author hj
|
|
|
+ * @date 2023/11/17 10:46
|
|
|
+ */
|
|
|
+ @LoginValid
|
|
|
+ @PostMapping("/info")
|
|
|
+ public UserInfoVo info(){
|
|
|
+ String websiteUserToken = WebsiteUserUtil.getWebsiteUserToken();
|
|
|
+ WebsiteUsers websiteUsers = redisCache.getCacheObject(LoginConstant.TOKEN_PREFIX+websiteUserToken);
|
|
|
+ return BeanUtil.copyProperties(websiteUsers, UserInfoVo.class);
|
|
|
+ }
|
|
|
|
|
|
}
|