|
@@ -25,12 +25,11 @@ class WechatOpenPlatformController extends CatchController
|
|
|
$this->validate($request, [
|
|
|
'user_id' => 'required'
|
|
|
]);
|
|
|
-// $currentUser = $this->getCurrentUser();
|
|
|
- $componentInfo = WechatOpenPlatformService::getComponentInfoByCompanyUid(2);
|
|
|
+ $currentUser = $this->getCurrentUser();
|
|
|
+ $componentInfo = WechatOpenPlatformService::getComponentInfoByCompanyUid($currentUser->id);
|
|
|
$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), []);
|
|
|
-// return view('wechat.openPlatform.preauth')->with('url', $url);
|
|
|
return $url;
|
|
|
}
|
|
|
|