Commit 31bd0064 authored by Quxl's avatar Quxl

增加失败提示

parent 06c87acc
...@@ -9,6 +9,8 @@ import org.springframework.web.bind.annotation.ResponseBody; ...@@ -9,6 +9,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.bean.Rjx; import com.egolm.common.bean.Rjx;
import com.egolm.film.api.member.service.MemberService; import com.egolm.film.api.member.service.MemberService;
import com.egolm.film.bean.Fc_member; import com.egolm.film.bean.Fc_member;
import com.egolm.film.common.Messages;
import com.egolm.film.config.XException;
import com.egolm.film.login.service.MemberTokenService; import com.egolm.film.login.service.MemberTokenService;
import com.egolm.film.model.LoginToken; import com.egolm.film.model.LoginToken;
...@@ -28,6 +30,9 @@ public class MemberInfoController { ...@@ -28,6 +30,9 @@ public class MemberInfoController {
@Autowired @Autowired
private MemberService memberService; private MemberService memberService;
@Autowired
private Messages messages;
@ResponseBody @ResponseBody
@PostMapping("query") @PostMapping("query")
@ApiOperation("查询会员基本信息") @ApiOperation("查询会员基本信息")
...@@ -63,9 +68,14 @@ public class MemberInfoController { ...@@ -63,9 +68,14 @@ public class MemberInfoController {
@ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "newPassword", value="新密码"), @ApiImplicitParam(paramType = "query", dataType = "string", required = true, name = "newPassword", value="新密码"),
}) })
public Object changePassword(String password, String newPassword) { public Object changePassword(String password, String newPassword) {
XException.assertNotBlank(messages.get("err.pwd_null"), password, newPassword);
LoginToken loginToken = tokenService.getToken(); LoginToken loginToken = tokenService.getToken();
Integer id = (Integer)loginToken.getId(); Integer id = (Integer)loginToken.getId();
boolean boo = memberService.changePasswordByMemberId(id, password, newPassword); boolean boo = memberService.changePasswordByMemberId(id, password, newPassword);
return Rjx.json().setCode(boo ? 200 : 500); if(boo) {
return Rjx.jsonOk();
} else {
return Rjx.jsonErr().setMessage(messages.get("err.pwd_error"));
}
} }
} }
...@@ -10,5 +10,6 @@ err.user_exists=User already exists ...@@ -10,5 +10,6 @@ err.user_exists=User already exists
err.email_null=The mailbox can not be empty err.email_null=The mailbox can not be empty
err.name_null=The username can not be empty err.name_null=The username can not be empty
err.pwd_null=The password can not be empty err.pwd_null=The password can not be empty
err.pwd_error=Password error
err.args_nums=Incorrect number of parameters err.args_nums=Incorrect number of parameters
...@@ -10,5 +10,6 @@ err.user_exists=\u7528\u6237\u5DF2\u5B58\u5728 ...@@ -10,5 +10,6 @@ err.user_exists=\u7528\u6237\u5DF2\u5B58\u5728
err.email_null=\u90AE\u7BB1\u4E0D\u80FD\u4E3A\u7A7A err.email_null=\u90AE\u7BB1\u4E0D\u80FD\u4E3A\u7A7A
err.name_null=\u59D3\u540D\u4E0D\u80FD\u4E3A\u7A7A err.name_null=\u59D3\u540D\u4E0D\u80FD\u4E3A\u7A7A
err.pwd_null=\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A err.pwd_null=\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A
err.pwd_error=\u5BC6\u7801\u9519\u8BEF
err.args_nums=\u653E\u6620\u53C2\u6570\u6570\u91CF\u9519\u8BEF err.args_nums=\u653E\u6620\u53C2\u6570\u6570\u91CF\u9519\u8BEF
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