Просмотр исходного кода

[B端登录][新增]:经纬度log添加

release_toaliyun_real
Stormeye.Wu 7 лет назад
Родитель
Сommit
d00f8671dd
2 измененных файлов: 14 добавлений и 6 удалений
  1. +12
    -3
      mallinkBApi/src/main/java/com/simple/controller/WxMerchantBUserController.java
  2. +2
    -3
      mallinkService/src/main/java/com/simple/domain/po/WxMerchantBUser.java

+ 12
- 3
mallinkBApi/src/main/java/com/simple/controller/WxMerchantBUserController.java Просмотреть файл

@@ -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);


+ 2
- 3
mallinkService/src/main/java/com/simple/domain/po/WxMerchantBUser.java Просмотреть файл

@@ -43,7 +43,6 @@ public class WxMerchantBUser implements Serializable {
}
/*租户ID**/
@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;
@@ -143,8 +142,8 @@ public class WxMerchantBUser implements Serializable {
return name;
}

public void setName(String name) {
this.name = name;
public void setName(String _name) {
this.name = _name;
}

public static enum Field


Загрузка…
Отмена
Сохранить