Browse Source

del废代码

Cherry 2 years ago
parent
commit
5248b2bd03
2 changed files with 178 additions and 261 deletions
  1. 0 41
      application/api/controller/User.php
  2. 178 220
      public/api.html

+ 0 - 41
application/api/controller/User.php

@@ -399,47 +399,6 @@ class User extends Api
         return $data;
     }
 
-    /**
-     * 绑定微信手机号
-     * @ApiMethod (POST)
-     * @ApiParams (name=code,description="获取手机号code")
-     */
-    public function bind_wechat_phone()
-    {
-        $this->success('成功');
-        $code = $this->request->post("code");
-        if (!$code) {
-            $this->error('参数错误');
-        }
-        $access_token_result = \app\common\service\WxService::getWxAccessToken();
-        if (!$access_token_result) {
-            $this->error('请刷新后重试');
-        }
-        $access_token = $access_token_result['access_token'];
-
-        // 获取手机号
-        $phone_info = \app\common\service\WxService::getWxphonenumber($access_token, $code);
-        if (!$phone_info) {
-            $this->error('请刷新后重试!');
-        }
-
-        //{"ret":true,"msg":"{\"errcode\":0,\"errmsg\":\"ok\",\"phone_info\":{\"phoneNumber\":\"18206485031\",\"purePhoneNumber\":\"18206485031\",\"countryCode\":\"86\",\"watermark\":{\"timestamp\":1679738067,\"appid\":\"wx20bb65dcc885b693\"}}}"}
-
-        $mobile = $phone_info['phone_info']['phoneNumber'];
-        $user = $this->auth->getUser();
-        if (\app\common\model\User::where('mobile', $mobile)->where('id', '<>', $user->id)->find()) {
-            $this->error(__('手机号已存在'));
-        }
-        // 修改手机号
-        $verification = $user->verification;
-        $verification->mobile = 1;
-        $user->verification = $verification;
-        $user->mobile = $mobile;
-        $user->save();
-
-        $this->success('成功');
-    }
-
     public function wxapp()
     {
         $url = url('user/index');

File diff suppressed because it is too large
+ 178 - 220
public/api.html


Some files were not shown because too many files changed in this diff