新版仿ok交易所-后端
1
zj
2025-10-30 14c1946eae86a86f8d1edee6cf3bdaf7572fc966
trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiUserController.java
@@ -140,14 +140,17 @@
        return Result.succeed(data);
    }
    private String validateParam(String username, String verifcode, String password, String type) {
    private String validateParam(String phone,String username, String verifcode, String password,String usercode, String type) {
        if (StringUtils.isEmptyString(username)) {
            return "用户名不能为空";
        }
//      if (StringUtils.isEmptyString(verifcode)) {
//         return "验证码不能为空";
//      }
        if (StringUtils.isEmptyString(phone)) {
            return "手机号不能为空";
        }
      if (StringUtils.isEmptyString(verifcode)) {
         return "验证码不能为空";
      }
        if (StringUtils.isEmptyString(password)) {
            return "登录密码不能为空";
        }
@@ -160,9 +163,9 @@
//         // 只能输入数字
//         return "登陆密码不符合设定";
//      }
//      if (StringUtils.isEmptyString(this.usercode)) {
//         return "推荐码不能为空";
//      }
      if (StringUtils.isEmptyString(usercode)) {
         return "推荐码不能为空";
      }
        if (StringUtils.isEmptyString(type) || !Arrays.asList("1", "2").contains(type)) {
            return "类型不能为空";
        }
@@ -173,9 +176,9 @@
     * 手机/邮箱注册接口
     */
    @RequestMapping("register")
    public Object register(String username, String password, String safeword, String verifcode, String usercode, String type) {
    public Object register(String username, String password, String phone,String safeword, String verifcode, String usercode, String type) {
        // 注册类型:1/手机;2/邮箱;
        String error = this.validateParam(username, verifcode, password, type);
        String error = this.validateParam(phone,username, verifcode, password, usercode,type);
        if (!StringUtils.isNullOrEmpty(error)) {
            throw new YamiShopBindException(error);
        }
@@ -185,7 +188,7 @@
        if (safeword.length() != 6 || !Strings.isNumber(safeword)) {
            throw new YamiShopBindException("资金密码不符合设定");
        }
        userService.saveRegister(username, password, usercode, safeword, verifcode, type);
        userService.saveRegister(username, password,phone, usercode, safeword, verifcode, type);
        User secUser = userService.findByUserName(username);
        Log log = new Log();
        log.setCategory(Constants.LOG_CATEGORY_SECURITY);
@@ -497,6 +500,7 @@
        map.put("advancedverif", party.isHighlevelAuthority());
        map.put("lastlogintime", party.getUserLasttime());
        map.put("lastloginip", party.getUserLastip());
        map.put("creditScore", party.getCreditScore());
        // 实名认证通过返回真实姓名
        if (party.isRealNameAuthority()) {
            map.put("name", kyc.getName());