|
@@ -20,7 +20,20 @@ class WechatOpenPlatformController extends CatchController
|
|
{
|
|
{
|
|
use UserTrait;
|
|
use UserTrait;
|
|
use ValidatesRequests;
|
|
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) {
|
|
public function preauth(Request $request) {
|
|
$this->validate($request, [
|
|
$this->validate($request, [
|
|
'user_id' => 'required'
|
|
'user_id' => 'required'
|
|
@@ -33,6 +46,18 @@ class WechatOpenPlatformController extends CatchController
|
|
return $url;
|
|
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) {
|
|
public function auth(Request $request, $component_appid, $user_id) {
|
|
$auth_code = $request->input('auth_code');
|
|
$auth_code = $request->input('auth_code');
|
|
$auth_user = DB::table('users')
|
|
$auth_user = DB::table('users')
|