Commit 89afd892 authored by hezhen's avatar hezhen

Merge branch 'hz_master'

parents 5708ebdf a22c50e5
...@@ -135,9 +135,11 @@ public class AuthController { ...@@ -135,9 +135,11 @@ public class AuthController {
return appAuthService.checkBindWechat(username); return appAuthService.checkBindWechat(username);
} }
@RequestMapping(value = "/wxlogin", method = RequestMethod.POST) @RequestMapping(value = "/wxlogin", method = RequestMethod.POST)
public JSONObject wxlogin(@RequestParam(value="openid",defaultValue="")String openid,@RequestParam(value="isQQ",defaultValue="0")Integer isQQ)throws Exception{ public JSONObject wxlogin(@RequestParam(value="openid",defaultValue="")String openid,
@RequestParam(value="isQQ",defaultValue="0")Integer isQQ,
@RequestParam(value="code",defaultValue="")String code)throws Exception{
log.info(openid+"----require wxlogin..."); log.info(openid+"----require wxlogin...");
JSONObject data=appAuthService.wxlogin(openid,isQQ); JSONObject data=appAuthService.wxlogin(openid,isQQ,code);
if(data!=null&&data.getInteger("status")== ResultCode.SUCCESS_CODE){ if(data!=null&&data.getInteger("status")== ResultCode.SUCCESS_CODE){
JSONObject result=data.getJSONObject("data"); JSONObject result=data.getJSONObject("data");
if(result==null){ if(result==null){
...@@ -154,10 +156,11 @@ public class AuthController { ...@@ -154,10 +156,11 @@ public class AuthController {
public JSONObject login(@RequestParam(value="username",defaultValue="")String username, public JSONObject login(@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,
@RequestParam(value="type",defaultValue="1")Integer type)throws Exception{ @RequestParam(value="type",defaultValue="1")Integer type,
@RequestParam(value="code",defaultValue="")String code)throws Exception{
log.info(username+"----require login..."); log.info(username+"----require login...");
JSONObject data=appAuthService.tlogin(username,password,mobilecode,type); JSONObject data=appAuthService.tlogin(username,password,mobilecode,type,code);
if(data!=null&&data.getInteger("status")== ResultCode.SUCCESS_CODE){ if(data!=null&&data.getInteger("status")== ResultCode.SUCCESS_CODE){
JSONObject result=data.getJSONObject("data"); JSONObject result=data.getJSONObject("data");
if(result==null){ if(result==null){
......
...@@ -42,12 +42,15 @@ public interface IUserService { ...@@ -42,12 +42,15 @@ public interface IUserService {
@RequestMapping(value = "/api/app/user/checkBindWechat",method = RequestMethod.POST) @RequestMapping(value = "/api/app/user/checkBindWechat",method = RequestMethod.POST)
public JSONObject checkBindWechat( @RequestParam(value="username")String username); public JSONObject checkBindWechat( @RequestParam(value="username")String username);
@RequestMapping(value = "/api/app/user/wxlogin",method = RequestMethod.POST) @RequestMapping(value = "/api/app/user/wxlogin",method = RequestMethod.POST)
public JSONObject wxlogin(@RequestParam(value="openid")String openid,@RequestParam(value="isQQ")Integer isQQ); public JSONObject wxlogin(@RequestParam(value="openid")String openid,
@RequestParam(value="isQQ")Integer isQQ,
@RequestParam(value="code",defaultValue="")String code);
@RequestMapping(value = "/api/app/user/login", method = RequestMethod.POST) @RequestMapping(value = "/api/app/user/login", method = RequestMethod.POST)
public JSONObject login( @RequestParam(value="username")String username, public JSONObject login( @RequestParam(value="username")String username,
@RequestParam(value="password")String password, @RequestParam(value="password")String password,
@RequestParam(value="mobilecode")String mobilecode, @RequestParam(value="mobilecode")String mobilecode,
@RequestParam(value="type")Integer type); @RequestParam(value="type")Integer type,
@RequestParam(value="")String code);
@RequestMapping(value = "/api/app/user/reset", method = RequestMethod.POST) @RequestMapping(value = "/api/app/user/reset", method = RequestMethod.POST)
public JSONObject reset( @RequestParam(value="username")String username, public JSONObject reset( @RequestParam(value="username")String username,
@RequestParam(value="mobilecode")String mobilecode, @RequestParam(value="mobilecode")String mobilecode,
......
...@@ -15,8 +15,8 @@ public interface AuthService { ...@@ -15,8 +15,8 @@ public interface AuthService {
JSONObject register(String username, String mobilecode, String password,String code) throws Exception; JSONObject register(String username, String mobilecode, String password,String code) throws Exception;
JSONObject wxregister( String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ,String code) throws Exception; JSONObject wxregister( String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ,String code) throws Exception;
JSONObject checkBindWechat(String username) throws Exception; JSONObject checkBindWechat(String username) throws Exception;
JSONObject wxlogin(String openid,Integer isQQ) throws Exception; JSONObject wxlogin(String openid,Integer isQQ,String code) throws Exception;
JSONObject tlogin(String username, String password,String mobilecode,Integer type) throws Exception; JSONObject tlogin(String username, String password,String mobilecode,Integer type,String code) throws Exception;
String getToken(String username,Integer id) throws Exception; String getToken(String username,Integer id) throws Exception;
JSONObject reset(String username, String mobilecode, String password) throws Exception; JSONObject reset(String username, String mobilecode, String password) throws Exception;
......
...@@ -84,13 +84,13 @@ public class AppAuthServiceImpl implements AuthService { ...@@ -84,13 +84,13 @@ public class AppAuthServiceImpl implements AuthService {
} }
@Override @Override
public JSONObject wxlogin(String openid,Integer isQQ) throws Exception { public JSONObject wxlogin(String openid,Integer isQQ,String code) throws Exception {
return userService.wxlogin(openid,isQQ); return userService.wxlogin(openid,isQQ,code);
} }
@Override @Override
public JSONObject tlogin(String username, String password, String mobilecode, Integer type) throws Exception { public JSONObject tlogin(String username, String password, String mobilecode, Integer type,String code) throws Exception {
return userService.login(username,password,mobilecode,type); return userService.login(username,password,mobilecode,type,code);
} }
@Override @Override
......
...@@ -82,13 +82,13 @@ public class AuthServiceImpl implements AuthService { ...@@ -82,13 +82,13 @@ public class AuthServiceImpl implements AuthService {
} }
@Override @Override
public JSONObject wxlogin(String openid,Integer isQQ) throws Exception { public JSONObject wxlogin(String openid,Integer isQQ,String code) throws Exception {
return userService.wxlogin(openid,isQQ); return userService.wxlogin(openid,isQQ,code);
} }
@Override @Override
public JSONObject tlogin(String username, String password, String mobilecode, Integer type) throws Exception { public JSONObject tlogin(String username, String password, String mobilecode, Integer type,String code) throws Exception {
return userService.login(username,password,mobilecode,type); return userService.login(username,password,mobilecode,type,code);
} }
@Override @Override
......
...@@ -316,8 +316,8 @@ public class AppPermissionService { ...@@ -316,8 +316,8 @@ public class AppPermissionService {
}*/ }*/
//临时会员绑定 //临时会员绑定
insertUserMemberByUserIdAndPhone(userid, username); insertUserMemberByUserIdAndPhone(userid, username);
/*//参加新人活动 //参加新人活动
jionActivity(userid);*/ jionActivity(userid);
//创建钱包 //创建钱包
walletBiz.createWalletByUserId(appUserLogin.getId()); walletBiz.createWalletByUserId(appUserLogin.getId());
// 登录结果要做做统一处理 // 登录结果要做做统一处理
...@@ -950,8 +950,8 @@ public class AppPermissionService { ...@@ -950,8 +950,8 @@ public class AppPermissionService {
relationBiz.bindByUserId(userid, small_id); relationBiz.bindByUserId(userid, small_id);
//发送短信通知用户 //发送短信通知用户
thirdFeign.sendCode(username, password, SystemConfig.TEMPLATECODE); thirdFeign.sendCode(username, password, SystemConfig.TEMPLATECODE);
/* //参加新人活动 //参加新人活动
jionActivity(userid);*/ jionActivity(userid);
// 登录结果要做做统一处理 // 登录结果要做做统一处理
JSONObject data = autoLogin(userid, username, headimgurl, nickname,null,null,2); JSONObject data = autoLogin(userid, username, headimgurl, nickname,null,null,2);
// 到im注册,获取返回结果 // 到im注册,获取返回结果
...@@ -1024,8 +1024,10 @@ public class AppPermissionService { ...@@ -1024,8 +1024,10 @@ public class AppPermissionService {
} }
Map<Integer, AppUserDetail> userIdAndAppUserDetail = appUserDetailBiz.findUserIdAndUserDetailMapByMemberIds(Arrays.asList(appUserLogin.getId())); Map<Integer, AppUserDetail> userIdAndAppUserDetail = appUserDetailBiz.findUserIdAndUserDetailMapByMemberIds(Arrays.asList(appUserLogin.getId()));
AppUserDetail appUserDetail = userIdAndAppUserDetail.get(appUserLogin.getId()); AppUserDetail appUserDetail = userIdAndAppUserDetail.get(appUserLogin.getId());
if (appUserDetail != null) {
imiVo.setNickname(appUserDetail.getNickname()); imiVo.setNickname(appUserDetail.getNickname());
imiVo.setHeadimgurl(appUserDetail.getHeadimgurl()); imiVo.setHeadimgurl(appUserDetail.getHeadimgurl());
}
return imiVo; return imiVo;
} }
......
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