文件地址:app/services/wechat/RoutineServices.php
方法:routineOauth
根据下代码,替换此方法
代码:
public function routineOauth($routine)
{
$routineInfo['nickname'] = isset($routine['nickName']) ? filter_emoji($routine['nickName']) : (isset($routine['nickname']) ? filter_emoji($routine['nickname']) : '');//姓名
$routineInfo['sex'] = $routine['gender'] ?? '';//性别
$routineInfo['language'] = $routine['language'] ?? '';//语言
$routineInfo['city'] = $routine['city'] ?? '';//城市
$routineInfo['province'] = $routine['province'] ?? "";//省份
$routineInfo['country'] = $routine['country'] ?? '';//国家
$routineInfo['headimgurl'] = $routine['avatarUrl'] ?? $routine['headimgurl'] ?? '';//头像
$routineInfo['openid'] = $routine['openid'] ?? '';
$routineInfo['session_key'] = $routine['session_key'] ?? '';//会话密匙
$routineInfo['unionid'] = $routine['unionId'] ?? $routine['unionid'] ?? '';//用户在开放平台的唯一标识符
$routineInfo['user_type'] = 'routine';//用户类型
$routineInfo['phone'] = $routine['phone'] ?? $routine['purePhoneNumber'] ?? '';
$spid = (int)($routine['spid'] ?? 0);//绑定关系uid
if (!$spid && isset($routine['code']) && $routine['code']) {
//获取是否有扫码进小程序
/** @var QrcodeServices $qrcode */
$qrcode = app()->make(QrcodeServices::class);
$info = $qrcode->get((int)$routine['code']);
if ($info) {
$spid = $info['third_id'];
}
}
return [$routine['openid'] ?? '', $routineInfo, $spid, $routine['login_type'] ?? 'routine', 'routine'];
}
{{item.user_info.nickname ? item.user_info.nickname : item.user_name}}
作者 管理员 企业
{{itemf.name}}
{{itemc.user_info.nickname}}
{{itemc.user_name}}
回复 {{itemc.comment_user_info.nickname}}
{{itemf.name}}