assign('msg', 'appid未配置'); return $this->fetch('public/tips_error'); } // 回调地址 $redirect_uri = urlencode(PluginsHomeUrl('weixinwebauthorization', 'auth', 'callback')); // 授权方式 $auth_type = (isset($ret['data']['auth_type']) && $ret['data']['auth_type'] == 1) ? 'snsapi_userinfo' : 'snsapi_base'; // 授权code $url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='.$ret['data']['appid'].'&redirect_uri='.$redirect_uri.'&response_type=cossde&scope='.$auth_type.'&state=login#wechat_redirect'; return redirect($url); } else { $this->assign('msg', $ret['msg']); return $this->fetch('public/tips_error'); } } /** * 回调 * @author Devil * @blog http://gong.gg/ * @version 1.0.0 * @datetime 2019-02-07T08:21:54+0800 * @param [array] $params [输入参数] */ public function callback($params = []) { // 参数校验 if(empty($params['code'])) { $this->assign('msg', '授权code为空'); return $this->fetch('public/tips_error'); } echo '
';
        print_r($params);

        echo __MY_VIEW_URL__;
    }

}
?>