|
|
@@ -19,11 +19,11 @@ class OpenendController extends PublicController{
|
|
|
|
|
|
public $isLogin = false;
|
|
|
public $withoutLogin = [];//不需要登陆的方法名
|
|
|
- public $userId,$user,$isWeixin,$signPackage,$merchant,$merchantId,$merchantExtend;
|
|
|
+ public $userId,$user,$isWx,$signPackage,$merchant,$merchantId,$merchantExtend;
|
|
|
public $wxOpen;
|
|
|
|
|
|
public function beforeAction($action){
|
|
|
- $this->isWeixin = util::isWeixin();
|
|
|
+ $this->isWx = util::isWx();
|
|
|
$get = Yii::$app->request->get();
|
|
|
$account = isset($get['account']) ? $get['account'] : '';
|
|
|
$one = xhMerchantService::getOne();
|
|
|
@@ -41,7 +41,7 @@ class OpenendController extends PublicController{
|
|
|
$merchantId = $merchant['id'];
|
|
|
$this->merchantId = $merchantId;
|
|
|
$this->merchantExtend = xhMerchantExtendService::getByMerchantId($merchantId);
|
|
|
- if($this->isWeixin){
|
|
|
+ if($this->isWx){
|
|
|
$jssdk = new jsSDK();//微信分享
|
|
|
$this->signPackage = $jssdk->GetSignPackage($merchant);
|
|
|
}
|
|
|
@@ -63,7 +63,7 @@ class OpenendController extends PublicController{
|
|
|
$this->user = $user;
|
|
|
$noNeedLogin = true;
|
|
|
}
|
|
|
- if ($this->isWeixin) {//如果是微信,走微信授权取用户信息
|
|
|
+ if ($this->isWx) {//如果是微信,走微信授权取用户信息
|
|
|
if($noNeedLogin == false){
|
|
|
//snsapi_userinfo 需要用户授权获取用户信息,snsapi_base表示自动静默方式
|
|
|
$authScope = isset($get['authScope']) ? $get['authScope'] : 'snsapi_userinfo';
|