Commit 2b85ed6b authored by Quxl's avatar Quxl

xx

parent beda9746
package com.egolm.film.api.member;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -33,6 +34,9 @@ public class MemberInfoController {
@Autowired
private Messages messages;
@Value("${opt.member_id}")
private Integer opt_member_id;
@ResponseBody
@PostMapping("query")
@ApiOperation("查询会员基本信息")
......@@ -43,7 +47,7 @@ public class MemberInfoController {
LoginToken loginToken = tokenService.getToken();
Integer id = (Integer)loginToken.getId();
Fc_member member = memberService.getMemberById(id);
return Rjx.jsonOk().setData(member);
return Rjx.jsonOk().setData(member).set("show", id.compareTo(opt_member_id) == 0);
}
@ResponseBody
......
package com.egolm.film.api.member;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -29,9 +28,6 @@ public class MemberLoginController {
@Autowired
private MemberTokenService tokenService;
@Value("${opt.member_id}")
private Integer opt_member_id;
@ResponseBody
@PostMapping("login")
@ApiOperation("登陆")
......@@ -46,7 +42,7 @@ public class MemberLoginController {
LoginToken token = tokenService.doLogin(username, password);
if(token != null) {
return Rjx.jsonOk().set("show", opt_member_id.intValue() == ((Integer)token.getId()).intValue());
return Rjx.jsonOk();
} else {
throw new XException(messages.get("err.user_or_pwd"));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment