Commit e29fdfa2 authored by hezhen's avatar hezhen

Merge branch 'master_guanjia' into dev

parents 84e77f20 639a80aa
......@@ -23,6 +23,7 @@ import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
@Api(tags = "用户登录")
@RestController
......@@ -172,6 +173,28 @@ public class AuthController {
}
return data;
}
@RequestMapping(value = "/otherLogin", method = RequestMethod.POST)
public JSONObject otherLogin(@RequestBody Map<String,Object> params)throws Exception{
log.info("----require otherLogin...");
String username=params.get("username")==null?"":params.get("username").toString();
String mobilecode=params.get("mobilecode")==null?"":params.get("mobilecode").toString();
String password=params.get("password")==null?"":params.get("password").toString();
Integer type=params.get("type")==null?1:params.get("type").hashCode();
String code=params.get("code")==null?"":params.get("code").toString();
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){
data.put("status",1001);
}else {
String token=appAuthService.getToken(username,result.getInteger("userId"));
data.put("token",token);
}
}
return data;
}
@RequestMapping(value = "/reset", method = RequestMethod.POST)
public JSONObject reset(@RequestParam(value="username",defaultValue="")String username,
@RequestParam(value="mobilecode",defaultValue="")String mobilecode,
......
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