liuzejian 1 rok pred
rodič
commit
cfc4a34c27

+ 2 - 2
modules/Channel/Http/Controllers/WechatOpenPlatformController.php

@@ -25,8 +25,8 @@ class WechatOpenPlatformController extends CatchController
         $this->validate($request, [
             'user_id' => 'required'
         ]);
-        $currentUser = $this->getCurrentUser();
-        $componentInfo = WechatOpenPlatformService::getComponentInfoByCompanyUid($currentUser->id);
+//        $currentUser = $this->getCurrentUser();
+        $componentInfo = WechatOpenPlatformService::getComponentInfoByCompanyUid(2);
         $app = WechatOpenPlatformService::buildApplication($componentInfo);
         $user_id = $request->input('user_id');
         $url = $app->createPreAuthorizationUrl(sprintf('%s/api/channel/openPlatform/auth/%s/%s',config('app.url'), $componentInfo->app_id, $user_id), []);

+ 1 - 1
modules/Channel/routes/route.php

@@ -55,7 +55,7 @@ Route::prefix('channel')->group(function () {
      */
     Route::prefix('openPlatform')->group(function(){
         Route::get('auth/{component_appid}/{user_id}', [WechatOpenPlatformController::class, 'auth'])->withoutMiddleware(config('catch.route.middlewares'));
-        Route::get('preauth', [WechatOpenPlatformController::class, 'preauth'])->middleware(['roleCheck:company']);
+        Route::get('preauth', [WechatOpenPlatformController::class, 'preauth'])->withoutMiddleware(config('catch.route.middlewares'));
         Route::post('authorCommand/{component_appid}', [WechatOpenPlatformController::class, 'authorCommand'])->withoutMiddleware(config('catch.route.middlewares'));
         Route::post('infoCommand/{authorizer_appid}/{component_appid}', [WechatOpenPlatformController::class, 'infoCommand'])->withoutMiddleware(config('catch.route.middlewares'));
     });