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();
 }

众号未认证 人人商城后台开启了WAP访问可以在普通浏览器里面用手机号密码登录 不过在微信里浏览器里访问url提示需要认证号认证登录
首先判断微信环境下访问返回false

然后在wei_shopv2/core/model/member.php 中 checkMember()函数中注释掉 userinfo = mc_oauth_userinfo(); 添加else中$user_info赋值

在这里插入图片描述

注释掉inc/page_mobile.php中$member = m(‘member’)->checkMember();

在这里插入图片描述

到这里微信浏览器里就可以使用手机号密码登录

如果仍希望使用公众号支付:

需要在page_mobile.php中将获取的授权openid赋值给另一变量。

而后在common.php类中,如下代码中将这一变量赋值给 $package[‘openid’]

p a c k a g e [ ‘ o p e n i d ’ ] = e m p t y ( package[‘openid’] = empty( package[‘openid’]=empty(params[‘openid’]) ? trim( W [ ‘ o p e n i d ’ ] ) : t r i m ( _W[‘openid’]) : trim( 
W
​ 
 [‘openid’]):trim(params[‘openid’]);

点赞(0)

评论列表 共有 0 条评论

暂无评论
立即
投稿
发表
评论
返回
顶部