Mike 7 rokov pred
rodič
commit
b2d0ff5d23

+ 8 - 8
server/app/Http/Controllers/Api/V1/AuthController.php

xqd xqd
@@ -89,13 +89,13 @@ class AuthController extends Controller
         $phone = $request->phone;
         $wechat = $request->wechat;
 
-        $url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wxc5181c0d406023e6&secret=82d15bf4c5c5baaad1e5a521cfdcf96c&code=".$wechat."&grant_type=authorization_code";
-        $res = file_get_contents($url);     //file_get_contents获取指定路由返回的数据
-        \Log::info($res);
-        $arr = json_decode($res, true);
-        $openid='';
-        if(!$arr['errcode'])$openid = $arr['openid'];
-        \Log::info('openid: ' . $openid);
+//        $url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wxc5181c0d406023e6&secret=82d15bf4c5c5baaad1e5a521cfdcf96c&code=".$wechat."&grant_type=authorization_code";
+//        $res = file_get_contents($url);     //file_get_contents获取指定路由返回的数据
+//        \Log::info($res);
+//        $arr = json_decode($res, true);
+//        $openid='';
+//        if(!$arr['errcode'])$openid = $arr['openid'];
+        \Log::info('openid: ' . $wechat);
 
         $jpush = $request->jpush;
         $key = $this->keySmsCode . $phone;
@@ -106,7 +106,7 @@ class AuthController extends Controller
         if (empty($user)) {
             $user = UserInfoModel::create([
                 'phone'=>$phone,
-                'wechat'=>$openid,
+                'wechat'=>$wechat,
                 'jpush'=>$jpush,
                 'nickname'=>'瞄喵',
                 'status'=>1,