Commit beda9746 authored by Quxl's avatar Quxl

xx

parent 2e45b404
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;
...@@ -27,6 +28,9 @@ public class MemberLoginController { ...@@ -27,6 +28,9 @@ 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")
...@@ -41,7 +45,8 @@ public class MemberLoginController { ...@@ -41,7 +45,8 @@ public class MemberLoginController {
} else { } else {
LoginToken token = tokenService.doLogin(username, password); LoginToken token = tokenService.doLogin(username, password);
if(token != null) { if(token != null) {
return Rjx.jsonOk();
return Rjx.jsonOk().set("show", opt_member_id.intValue() == ((Integer)token.getId()).intValue());
} 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