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,12 +154,14 @@ public class AuthController {
log.info(username+"----require reset...");
JSONObject data=appAuthService.reset(username,mobilecode,password);
if(data!=null&&data.getInteger("status")== ResultCode.SUCCESS_CODE){
JwtAuthenticationRequest authenticationRequest=new JwtAuthenticationRequest();
authenticationRequest.setUsername(username);
authenticationRequest.setPassword(password);
String token=appAuthService.login(authenticationRequest);
JSONObject result=data.getJSONObject("data");
if(result==null){
data.put("status",1001);
}else {
String token=appAuthService.getToken(username,result.getInteger("userId"));
data.put("token",token);
}
}
return data;
}
......
......@@ -153,7 +153,7 @@ public class AppUserRest {
@RequestMapping(value = "/user/reset", method = RequestMethod.POST)
public @ResponseBody
JSONObject login(
JSONObject reset(
@RequestParam(value="username",defaultValue="")String username,
@RequestParam(value="mobilecode",defaultValue="")String mobilecode,
@RequestParam(value="password",defaultValue="")String password
......
......@@ -532,6 +532,14 @@ public class AppPermissionService {
Integer userid = user.getId();
String nickname = SystemConfig.USER_NIKENAME_DEFAULT + (int) ((Math.random() * 9 + 1) * 100000);
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) {
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