|
|
|
@@ -82,7 +82,10 @@ public class WxMerchantBUserController extends BaseController |
|
|
|
*/ |
|
|
|
@AuthIgnore |
|
|
|
@PostMapping("/login") |
|
|
|
@ApiOperation(value="用户登录", notes="{\"appId\":\"string\",\"phone\":\"string\",\"password\":\"string\",\"scene\":\"string\",\"sceneAddress\":\"string\"}") |
|
|
|
@ApiOperation(value="用户登录", notes="{" + |
|
|
|
"\"appId\":\"string\"," + |
|
|
|
"\"phone\":\"string\",\"password\":\"string\"," + |
|
|
|
"\"latitude\":\"string\",\"longitude\":\"string\"}") |
|
|
|
public ResultData userLogin(@RequestBody Map<String, String> map) { |
|
|
|
logger.debug(map.toString()); |
|
|
|
|
|
|
|
@@ -91,17 +94,23 @@ public class WxMerchantBUserController extends BaseController |
|
|
|
String appId = map.get("appId"); |
|
|
|
String phone = map.get("phone"); |
|
|
|
String password = map.get("password"); |
|
|
|
String latitude = map.get("latitude"); |
|
|
|
String longitude = map.get("longitude"); |
|
|
|
//登录凭证不能为空 |
|
|
|
if (StringUtils.isBlank(phone)) { |
|
|
|
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "phone不能为空"); |
|
|
|
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "手机号不能为空"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(password)) { |
|
|
|
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "password不能为空"); |
|
|
|
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "密码不能为空"); |
|
|
|
} |
|
|
|
|
|
|
|
String token = null; |
|
|
|
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String ipaddress = IPUtil.getIpAddr(request); |
|
|
|
if (!StringUtils.isBlank(latitude)&&!StringUtils.isBlank(longitude)) { |
|
|
|
//return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "经纬度未获取"); |
|
|
|
logger.info("B端用户: " + phone + " 登录 IP" + ipaddress + ", 经纬度(" + longitude + "," + latitude + ")"); |
|
|
|
} |
|
|
|
|
|
|
|
WxMerchantBUser user = new WxMerchantBUser(); |
|
|
|
user.setAppId(appId); |
|
|
|
|