liuzejian 1 ano atrás
pai
commit
c5e873aebe

+ 26 - 1
modules/Channel/Http/Controllers/WechatOpenPlatformController.php

@@ -20,7 +20,20 @@ class WechatOpenPlatformController extends CatchController
 {
     use UserTrait;
     use ValidatesRequests;
-    // 授权跳转页
+
+    /**
+     * 三方授权跳转页
+     * @param Request $request
+     * @return string
+     * @throws \EasyWeChat\Kernel\Exceptions\HttpException
+     * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
+     * @throws \Illuminate\Validation\ValidationException
+     * @throws \Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface
+     * @throws \Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface
+     * @throws \Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface
+     * @throws \Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface
+     * @throws \Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface
+     */
     public function preauth(Request $request) {
         $this->validate($request, [
             'user_id' => 'required'
@@ -33,6 +46,18 @@ class WechatOpenPlatformController extends CatchController
         return $url;
     }
 
+    /**
+     * 三方授权回调
+     * @param Request $request
+     * @param $component_appid
+     * @param $user_id
+     * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View|\Illuminate\Foundation\Application
+     * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
+     * @throws \Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface
+     * @throws \Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface
+     * @throws \Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface
+     * @throws \Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface
+     */
     public function auth(Request $request, $component_appid, $user_id) {
         $auth_code = $request->input('auth_code');
         $auth_user = DB::table('users')