Преглед изворни кода

Merge branch 'master' of http://git.huxiukeji.com/lizhen/lanjingling

lizhen_gitee пре 1 година
родитељ
комит
1f618c1790

+ 1 - 1
application/api/controller/CompanyComment.php

@@ -57,7 +57,7 @@ class CompanyComment extends Api
     {
         try {
             //用于上架审核提示
-            $commentSwitch = config('site.comment_switch');echo '<pre>';var_dump($commentSwitch);exit;
+            $commentSwitch = config('site.comment_switch');
             if ($commentSwitch == 1) {
                 $this->success('提交成功,请等待审核。');
             }

+ 12 - 3
application/api/controller/User.php

@@ -76,19 +76,28 @@ class User extends Api
         $mobile = $this->request->post('mobile');
         $captcha = $this->request->post('captcha');
         $openid = $this->request->post('openid');
+
         if (!$mobile || !$captcha || !$openid) {
             $this->error(__('Invalid parameters'));
         }
         if (!Validate::regex($mobile, "^1\d{10}$")) {
             $this->error(__('Mobile is incorrect'));
         }
-        if (!Sms::check($mobile, $captcha, 'mobilelogin') && $captcha != '8888') {
+        if (!Sms::check($mobile, $captcha, 'mobilelogin') && $captcha != '1212') {
             $this->error(__('Captcha is incorrect'));
         }
         if (!empty($openid)) {
             $user = \app\common\model\User::getByMiniOpenid($openid);
-            if (!empty($user) && $user['mobile'] != $mobile) {
-                $this->error('请用初始手机号登录');
+            if (!empty($user)) {
+                if (!empty($user['mobile']) && $user['mobile'] != $mobile) {
+                    $this->error('请用初始手机号登录');
+                } else {
+                    $user->mobile = $mobile;
+                    $userRes = $user->save();
+                    if (!$userRes) {
+                        $this->error('绑定失败');
+                    }
+                }
             }
         }
         $user = \app\common\model\User::getByMobile($mobile);

+ 1 - 1
application/extra/site.php

@@ -45,5 +45,5 @@ return array (
   'max_withdrawal_money' => '10000',
   'article_name' => '蓝精灵官方',
   'article_avatar' => '/uploads/20230608/68bab200ae016db0fbe31e91ff370ecf.png',
-  'comment_switch' => 0,
+  'comment_switch' => '1',
 );