|
@@ -2,12 +2,14 @@ package com.dgtly.member.controller;
|
|
|
|
|
|
import com.auth0.jwt.JWT;
|
|
import com.auth0.jwt.JWT;
|
|
import com.auth0.jwt.algorithms.Algorithm;
|
|
import com.auth0.jwt.algorithms.Algorithm;
|
|
|
|
+import com.dgtly.apiframework.util.TokenUtil;
|
|
import com.dgtly.common.annotation.ApiNoCheckSign;
|
|
import com.dgtly.common.annotation.ApiNoCheckSign;
|
|
import com.dgtly.common.annotation.ApiPassToken;
|
|
import com.dgtly.common.annotation.ApiPassToken;
|
|
import com.dgtly.common.core.controller.ApiBaseController;
|
|
import com.dgtly.common.core.controller.ApiBaseController;
|
|
import com.dgtly.common.core.domain.AjaxResult;
|
|
import com.dgtly.common.core.domain.AjaxResult;
|
|
import com.dgtly.common.core.domain.ParameterObject;
|
|
import com.dgtly.common.core.domain.ParameterObject;
|
|
import com.dgtly.common.utils.DateUtils;
|
|
import com.dgtly.common.utils.DateUtils;
|
|
|
|
+import com.dgtly.common.utils.StringUtils;
|
|
import com.dgtly.member.domain.MemberInfo;
|
|
import com.dgtly.member.domain.MemberInfo;
|
|
import com.dgtly.member.service.IMemberInfoService;
|
|
import com.dgtly.member.service.IMemberInfoService;
|
|
import com.google.code.kaptcha.Constants;
|
|
import com.google.code.kaptcha.Constants;
|
|
@@ -105,4 +107,24 @@ public class MemberInfoController extends ApiBaseController {
|
|
return AjaxResult.error(303,"验证码错误");
|
|
return AjaxResult.error(303,"验证码错误");
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @descption: 根据token获取会员信息
|
|
|
|
+ * @param: token
|
|
|
|
+ * @return:
|
|
|
|
+ * @auther: LiuLingChao
|
|
|
|
+ * @date: 2020-2-26 22:16
|
|
|
|
+ */
|
|
|
|
+ @PostMapping("/getMemberInfo")
|
|
|
|
+ public Object getMemberInfo(){
|
|
|
|
+ String userId = TokenUtil.getTokenUserId();
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isNotEmpty(userId)){
|
|
|
|
+ MemberInfo memberInfo = iMemberInfoService.selectMemberInfoById(Long.parseLong(userId));
|
|
|
|
+ return AjaxResult.success().putKV("memberInfo",memberInfo);
|
|
|
|
+ }else{
|
|
|
|
+ return AjaxResult.error(305,"根据token获取用户id出错");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|