|
@@ -82,10 +82,12 @@ class ReadOauth
|
|
}
|
|
}
|
|
$this->share($request);
|
|
$this->share($request);
|
|
Cookie::queue('auth_redirect', urlencode($url), env('U_COOKIE_EXPIRE'));
|
|
Cookie::queue('auth_redirect', urlencode($url), env('U_COOKIE_EXPIRE'));
|
|
|
|
+ $appid = env('WECHAT_AUTH_APPID');
|
|
$params['redirect_url'] = urlencode($url);
|
|
$params['redirect_url'] = urlencode($url);
|
|
$params['timestamp'] = time();
|
|
$params['timestamp'] = time();
|
|
$params['channel_id'] = $distribution_channel_id;
|
|
$params['channel_id'] = $distribution_channel_id;
|
|
- $params['gzh_app_id'] = env('WECHAT_AUTH_APPID');
|
|
|
|
|
|
+ $params['gzh_app_id'] = $appid;
|
|
|
|
+ $params['appid'] = $appid;
|
|
$params['sid'] = $uri_send_order_id;
|
|
$params['sid'] = $uri_send_order_id;
|
|
$params['sign'] = $this->getSign($params, env('OAUTH_KEY'));
|
|
$params['sign'] = $this->getSign($params, env('OAUTH_KEY'));
|
|
|
|
|
|
@@ -99,7 +101,28 @@ class ReadOauth
|
|
if ($redirect_V2) {
|
|
if ($redirect_V2) {
|
|
return redirect()->to($redirect_V2);
|
|
return redirect()->to($redirect_V2);
|
|
}*/
|
|
}*/
|
|
- return redirect()->to($redirect);
|
|
|
|
|
|
+
|
|
|
|
+ $info = DB::table('official_setting')->where('appid',$appid)->select('secret')->first();
|
|
|
|
+ if($info && $info->secret){
|
|
|
|
+ $secter = $info->secre;
|
|
|
|
+ }else{
|
|
|
|
+ $secter = '';
|
|
|
|
+ abort(404);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $options = [
|
|
|
|
+ 'app_id'=>env('WECHAT_AUTH_APPID'),
|
|
|
|
+ 'secret'=>$secter,
|
|
|
|
+ 'oauth' => [
|
|
|
|
+ 'scopes' => ['snsapi_base'],
|
|
|
|
+ 'callback' => env('AUTH_CALLBACK_URL').'?'.http_build_query($params),
|
|
|
|
+ ],
|
|
|
|
+ ];
|
|
|
|
+ Log::info('$options is:');
|
|
|
|
+ Log::info($options);
|
|
|
|
+ $app = new Application($options);
|
|
|
|
+ return $app->oauth->redirect();
|
|
|
|
+ //return redirect()->to($redirect);
|
|
}
|
|
}
|
|
|
|
|
|
//个性化推送
|
|
//个性化推送
|