Commit 683a0e06 authored by libin's avatar libin

Merge branch 'base-modify' of http://113.105.137.151:22280/youjj/cloud-platform into base-modify

parents f7b8b9cd 2cec9369
...@@ -154,11 +154,13 @@ public class AuthController { ...@@ -154,11 +154,13 @@ public class AuthController {
log.info(username+"----require reset..."); log.info(username+"----require reset...");
JSONObject data=appAuthService.reset(username,mobilecode,password); JSONObject data=appAuthService.reset(username,mobilecode,password);
if(data!=null&&data.getInteger("status")== ResultCode.SUCCESS_CODE){ if(data!=null&&data.getInteger("status")== ResultCode.SUCCESS_CODE){
JwtAuthenticationRequest authenticationRequest=new JwtAuthenticationRequest(); JSONObject result=data.getJSONObject("data");
authenticationRequest.setUsername(username); if(result==null){
authenticationRequest.setPassword(password); data.put("status",1001);
String token=appAuthService.login(authenticationRequest); }else {
data.put("token",token); String token=appAuthService.getToken(username,result.getInteger("userId"));
data.put("token",token);
}
} }
return data; return data;
} }
......
...@@ -153,7 +153,7 @@ public class AppUserRest { ...@@ -153,7 +153,7 @@ public class AppUserRest {
@RequestMapping(value = "/user/reset", method = RequestMethod.POST) @RequestMapping(value = "/user/reset", method = RequestMethod.POST)
public @ResponseBody public @ResponseBody
JSONObject login( JSONObject reset(
@RequestParam(value="username",defaultValue="")String username, @RequestParam(value="username",defaultValue="")String username,
@RequestParam(value="mobilecode",defaultValue="")String mobilecode, @RequestParam(value="mobilecode",defaultValue="")String mobilecode,
@RequestParam(value="password",defaultValue="")String password @RequestParam(value="password",defaultValue="")String password
......
...@@ -532,6 +532,14 @@ public class AppPermissionService { ...@@ -532,6 +532,14 @@ public class AppPermissionService {
Integer userid = user.getId(); Integer userid = user.getId();
String nickname = SystemConfig.USER_NIKENAME_DEFAULT + (int) ((Math.random() * 9 + 1) * 100000); String nickname = SystemConfig.USER_NIKENAME_DEFAULT + (int) ((Math.random() * 9 + 1) * 100000);
JSONObject data = autoLogin(userid, user.getUsername(), SystemConfig.USER_HEADER_URL_DEFAULT, nickname); JSONObject data = autoLogin(userid, user.getUsername(), SystemConfig.USER_HEADER_URL_DEFAULT, nickname);
// 到im注册,获取返回结果
Integer imUserId=user.getImUserid();
String imPassword=user.getImPassword();
if(StringUtils.isNotBlank(imPassword)&&imUserId!=null&&imUserId>0){
String access_token=loginIm(username,imPassword,imUserId);
data.put("imToken",access_token);
data.put("imUserId",imUserId);
}
if (data != null) { if (data != null) {
return JsonResultUtil.createSuccessResultWithObj(data); return JsonResultUtil.createSuccessResultWithObj(data);
} }
......
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