wesmiler 2 年之前
父節點
當前提交
048cc23aee
共有 3 個文件被更改,包括 6 次插入1 次删除
  1. 1 1
      app/Http/Validator/MemberValidator.php
  2. 4 0
      app/Services/Api/MemberService.php
  3. 1 0
      resources/lang/zh-cn/api.php

+ 1 - 1
app/Http/Validator/MemberValidator.php

@@ -57,7 +57,7 @@ class MemberValidator extends BaseValidator
         'recharge'=> ['usdt'],
         'transfer'=> ['money','coin_type','to_user_id'],
         'withdraw'=> ['money','coin_type'],
-        'trade'=> ['email','pay_password','code'],
+        'trade'=> ['pay_password','code'],
         'modify_email'=> ['email','new_email'],
         'modify'=> ['nickname','gender'],
         'wallet'=> ['email','trc_url','code']

+ 4 - 0
app/Services/Api/MemberService.php

@@ -689,6 +689,10 @@ class MemberService extends BaseService
         $password = isset($params['password']) ? $params['password'] : '';
         $payPassword = isset($params['pay_password']) ? $params['pay_password'] : '';
         $scene = isset($params['scene'])? trim($params['scene']) : '';
+        if(empty($email) && empty($mobile)){
+            $this->error = 1064;
+            return false;
+        }
 
         // 用户验证
         $info = $this->model->with(['parent'])->where(['id' => $userId, 'mark' => 1])->select(['id','pay_password','parent_id','code', 'status'])->first();

+ 1 - 0
resources/lang/zh-cn/api.php

@@ -63,6 +63,7 @@ return [
     '1061' => '手机验证码已失效或错误',
     '1062' => '手机验证码错误',
     '1063' => '手机验证码发送成功',
+    '1064' => '请选择邮箱验证或手机号验证',
 
     // 登录注册
     '2001'=> '账号非法或未注册',