Commit 2b85ed6b authored by Quxl's avatar Quxl

xx

parent beda9746
package com.egolm.film.api.member; package com.egolm.film.api.member;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -33,6 +34,9 @@ public class MemberInfoController { ...@@ -33,6 +34,9 @@ public class MemberInfoController {
@Autowired @Autowired
private Messages messages; private Messages messages;
@Value("${opt.member_id}")
private Integer opt_member_id;
@ResponseBody @ResponseBody
@PostMapping("query") @PostMapping("query")
@ApiOperation("查询会员基本信息") @ApiOperation("查询会员基本信息")
...@@ -43,7 +47,7 @@ public class MemberInfoController { ...@@ -43,7 +47,7 @@ public class MemberInfoController {
LoginToken loginToken = tokenService.getToken(); LoginToken loginToken = tokenService.getToken();
Integer id = (Integer)loginToken.getId(); Integer id = (Integer)loginToken.getId();
Fc_member member = memberService.getMemberById(id); 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 @ResponseBody
......
package com.egolm.film.api.member; package com.egolm.film.api.member;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -29,9 +28,6 @@ public class MemberLoginController { ...@@ -29,9 +28,6 @@ public class MemberLoginController {
@Autowired @Autowired
private MemberTokenService tokenService; private MemberTokenService tokenService;
@Value("${opt.member_id}")
private Integer opt_member_id;
@ResponseBody @ResponseBody
@PostMapping("login") @PostMapping("login")
@ApiOperation("登陆") @ApiOperation("登陆")
...@@ -46,7 +42,7 @@ public class MemberLoginController { ...@@ -46,7 +42,7 @@ public class MemberLoginController {
LoginToken token = tokenService.doLogin(username, password); LoginToken token = tokenService.doLogin(username, password);
if(token != null) { if(token != null) {
return Rjx.jsonOk().set("show", opt_member_id.intValue() == ((Integer)token.getId()).intValue()); return Rjx.jsonOk();
} else { } else {
throw new XException(messages.get("err.user_or_pwd")); 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