人人商城强制关闭微信授权登录

1.core/inc/functions.php


if (!function_exists('is_weixin')) {
	function is_weixin()
	{
		global $_W;
		
        return false;
		if (EWEI_SHOPV2_DEBUG) {
			return true;
		}

		if (empty($_SERVER['HTTP_USER_AGENT']) || strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') === false && strpos($_SERVER['HTTP_USER_AGENT'], 'Windows Phone') === false) {
			return false;
		}

		return true;
	}
}

 2.core/model/member.php

	if ($followed || empty($shopset['shop']['getinfo']) || $shopset['shop']['getinfo'] == 1) {
			$uid = mc_openid2uid($openid);

			if (!EWEI_SHOPV2_DEBUG) {
				//$userinfo = mc_oauth_userinfo();
				$userinfo = array('openid' => $member['openid'], 'nickname' => $member['nickname'], 'headimgurl' => $member['avatar'], 'gender' => $member['gender'], 'province' => $member['province'], 'city' => $member['city']);
			}
			else {
				$userinfo = array('openid' => $member['openid'], 'nickname' => $member['nickname'], 'headimgurl' => $member['avatar'], 'gender' => $member['gender'], 'province' => $member['province'], 'city' => $member['city']);
			}

			$mc = array();
			$mc['nickname'] = $userinfo['nickname'];
			$mc['avatar'] = $userinfo['headimgurl'];
			$mc['gender'] = $userinfo['sex'];
			$mc['resideprovince'] = $userinfo['province'];
			$mc['residecity'] = $userinfo['city'];
		}

3.app/common/bootstrap.app.inc.php注释跳转

if (!empty($_W['account']['oauth']) && $_W['account']['oauth']['support_oauthinfo'] && empty($_W['isajax'])) {
	if (($_W['platform'] == 'account' && !$_GPC['logout'] && empty($_W['openid']) && ($controller != 'auth' || ($controller == 'auth' && !in_array($action, array('forward', 'oauth'))))) ||
		($_W['platform'] == 'account' && !$_GPC['logout'] && empty($_SESSION['oauth_openid']) && ($controller != 'auth'))) {
		$state = 'we7sid-'.$_W['session_id'];
		if (empty($_SESSION['dest_url'])) {
			$_SESSION['dest_url'] = urlencode($_W['siteurl']);
		}
		$str = '';
		if(uni_is_multi_acid()) {
			$str = "&j={$_W['acid']}";
		}
		$oauth_type = 'snsapi_base';
		if ($controller == 'entry' && !empty($_GPC['m'])) {
			$module_info = module_fetch($_GPC['m']);
			if ($module_info['oauth_type'] == OAUTH_TYPE_USERINFO) {
				$oauth_type = 'snsapi_userinfo';
			}
		}
		$oauth_url = uni_account_oauth_host();
		$url = $oauth_url . "app/index.php?i={$_W['uniacid']}{$str}&c=auth&a=oauth&scope=" . $oauth_type;
		$callback = urlencode($url);
		$oauth_account = WeAccount::create($_W['account']['oauth']);
		if ($oauth_type == 'snsapi_base') {
			$forward = $oauth_account->getOauthCodeUrl($callback, $state);
		} else {
			$forward = $oauth_account->getOauthUserInfoUrl($callback, $state);
		}
		//header('Location: ' . $forward);
		//exit();
	}
}

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值