Commit a22c50e5 authored by hezhen's avatar hezhen

推广和放开活动

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