Commit 5eb42a70 authored by hezhen's avatar hezhen

123

parent 20f0e52c
......@@ -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
......
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