|
|
@ -9,6 +9,7 @@ import com.hfkj.common.alipay.AlipayUtils; |
|
|
|
import com.hfkj.common.exception.ErrorCode; |
|
|
|
import com.hfkj.common.exception.ErrorCode; |
|
|
|
import com.hfkj.common.exception.ErrorHelp; |
|
|
|
import com.hfkj.common.exception.ErrorHelp; |
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
|
|
|
|
import com.hfkj.common.pay.util.SignatureUtil; |
|
|
|
import com.hfkj.common.security.UserCenter; |
|
|
|
import com.hfkj.common.security.UserCenter; |
|
|
|
import com.hfkj.common.utils.HttpsUtils; |
|
|
|
import com.hfkj.common.utils.HttpsUtils; |
|
|
|
import com.hfkj.common.utils.MemberValidateUtil; |
|
|
|
import com.hfkj.common.utils.MemberValidateUtil; |
|
|
@ -58,16 +59,24 @@ public class BsUserController { |
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/autoLogin", method = RequestMethod.POST) |
|
|
|
@RequestMapping(value = "/autoLogin", method = RequestMethod.POST) |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
|
@ApiOperation(value = "登录并注册") |
|
|
|
@ApiOperation(value = "自动登录并注册") |
|
|
|
public ResponseData autoLogin(@RequestBody JSONObject body) { |
|
|
|
public ResponseData autoLogin(@RequestBody JSONObject body) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
if (body == null |
|
|
|
if (body == null |
|
|
|
|| StringUtils.isBlank(body.getString("appid")) |
|
|
|
|| StringUtils.isBlank(body.getString("appid")) |
|
|
|
|| StringUtils.isBlank(body.getString("phone"))) { |
|
|
|
|| StringUtils.isBlank(body.getString("phone")) |
|
|
|
|
|
|
|
|| StringUtils.isBlank(body.getString("sign")) |
|
|
|
|
|
|
|
) { |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
} |
|
|
|
} |
|
|
|
// 接入appid
|
|
|
|
// 接入appid
|
|
|
|
BsAgentApiParam agentApiParam = agentApiParamService.getParamByAppId(body.getString("appid")); |
|
|
|
BsAgentApiParam agentApiParam = agentApiParamService.getParamByAppId(body.getString("appid")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 验证签名
|
|
|
|
|
|
|
|
BsAgentApiParam apiParam = agentApiParamService.getParamByAppId(agentApiParam.getAppId()); |
|
|
|
|
|
|
|
if (!SignatureUtil.checkSign(body.getString("sign"), body, apiParam.getAppSecret())) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.OpenApi, ErrorCode.OPEN_API_SIGN_ERR, ""); |
|
|
|
|
|
|
|
} |
|
|
|
String phone = body.getString("phone"); |
|
|
|
String phone = body.getString("phone"); |
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> other = new HashMap<>(); |
|
|
|
Map<String, Object> other = new HashMap<>(); |
|
|
@ -77,7 +86,7 @@ public class BsUserController { |
|
|
|
return ResponseMsgUtil.success(userService.login(UserLoginPlatform.TRIPARTITE, UserLoginType.TRIPARTITE, phone, other)); |
|
|
|
return ResponseMsgUtil.success(userService.login(UserLoginPlatform.TRIPARTITE, UserLoginType.TRIPARTITE, phone, other)); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("LoginController --> phone() error!", e); |
|
|
|
log.error("LoginController --> autoLogin() error!", e); |
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
return ResponseMsgUtil.exception(e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|