linwu 1 year ago
parent
commit
48bdab9036
2 changed files with 2 additions and 1 deletions
  1. 1 0
      app/Http/Controllers/Api/Auth/AuthController.php
  2. 1 1
      routes/api.php

+ 1 - 0
app/Http/Controllers/Api/Auth/AuthController.php

@@ -140,6 +140,7 @@ EOF;
      */
     public function getInfoByToken(Request $request)
     {
+        header('Access-Control-Allow-Origin: *');
         $token = $request->post('token');
         if (empty($token)) {
             return response()->json([

+ 1 - 1
routes/api.php

@@ -107,7 +107,7 @@ Route::group([
     $router->get('wechat_auth', 'Api\Auth\AuthController@wechatAuth')->name('api.auth.wechat_auth');
     $router->get('wechat_auth_back', 'Api\Auth\AuthController@wechatAuthBack')->name('api.auth.wechat_auth_back');
     $router->post('test', 'Api\Auth\AuthController@test')->name('api.auth.test');
-    $router->post('getInfoByToken', 'Api\Auth\AuthController@getInfoByToken')->name('api.auth.getInfoByToken')->middleware('crossDomain');
+    $router->post('getInfoByToken', 'Api\Auth\AuthController@getInfoByToken')->name('api.auth.getInfoByToken');
 });
 
 /*抖音招聘*/