Authored by zhaoyue

Fix little unbind bug

@@ -2,7 +2,7 @@ git pull @@ -2,7 +2,7 @@ git pull
2 git add --all src/main/java/* 2 git add --all src/main/java/*
3 git add push.sh 3 git add push.sh
4 git add pom.xml 4 git add pom.xml
5 -git commit -m "Add openid login return token;unbind pwd is necessary" 5 +git commit -m "Fix little unbind bug"
6 #git push origin master 6 #git push origin master
7 git push origin zhaoyue-dev4 7 git push origin zhaoyue-dev4
8 git status 8 git status
@@ -88,8 +88,13 @@ public class OpenIdController { @@ -88,8 +88,13 @@ public class OpenIdController {
88 @ApiImplicitParams({ 88 @ApiImplicitParams({
89 @ApiImplicitParam(name = "authorization", value = "请输入登录返回信息:userId_tokens", required = true, dataType = "string", paramType = "header"), 89 @ApiImplicitParam(name = "authorization", value = "请输入登录返回信息:userId_tokens", required = true, dataType = "string", paramType = "header"),
90 }) 90 })
91 - public ResponseEntity<ResultModel> openIdUnBind(HttpServletRequest request, @CurrentUser User user, @RequestParam String openId, @RequestParam int openIdType, 91 + public ResponseEntity<ResultModel> openIdUnBind(HttpServletRequest request, @CurrentUser User user, @RequestParam String password, @RequestParam String openId, @RequestParam int openIdType,
92 @RequestParam String sign, @RequestParam long t, @RequestParam int type) { 92 @RequestParam String sign, @RequestParam long t, @RequestParam int type) {
  93 + user = loginService.check(user.getLoginAccount(), password);
  94 + if (user == null) {//用户,密码错误
  95 + return new ResponseEntity<>(ResultModel.error(ResultStatus.USERNAME_OR_PASSWORD_ERROR), HttpStatus.OK);
  96 + }
  97 +
93 if (!(boolean) request.getAttribute("signAspect")) 98 if (!(boolean) request.getAttribute("signAspect"))
94 return new ResponseEntity<>(ResultModel.error(ResultStatus.SIGN_ERROR), HttpStatus.OK); 99 return new ResponseEntity<>(ResultModel.error(ResultStatus.SIGN_ERROR), HttpStatus.OK);
95 100