微擎粉丝头像修复

2018-10-17 小惟 27

前不久发现低版本的微擎用户获取头像时,会莫名其妙的多132的后缀,每次改应用模块,最后没办法,全局搜索了一下,简单的修改,代码冗余问题也没有处理(有点蠢),具体文件就是下面的文件。


framework/builtin/core/receiver.php


$userinfo['headimgurl'] = rtrim($userinfo['headimgurl'], '0') . 132; 


替换为 $userinfo['headimgurl'] = $userinfo['headimgurl'];




framework/model/mc.mod.php

$userinfo['headimgurl'] = rtrim($userinfo['headimgurl'], '0') . 132; 


替换为 $userinfo['headimgurl'] = $userinfo['headimgurl'];


$fans['headimgurl'] = rtrim($fans['headimgurl'], '0') . 132; 


替换为 $fans['headimgurl'] = $fans['headimgurl'];




app/source/mc/profile.ctrl.php

empty($profile['avatar']) ? ($data['avatar'] = rtrim($map_fans['headimgurl'], '0') . 132) : ''; 


替换为 empty($profile['avatar']) ? ($data['avatar'] = $map_fans['headimgurl']) : '';




app/source/auth/register.ctrl.php

$data['avatar'] = rtrim($map_fans['headimgurl'], '0') . 132; 


 替换为  $data['avatar'] = $map_fans['headimgurl'];




app/source/auth/oauth.ctrl.php

$userinfo['headimgurl'] = rtrim($userinfo['headimgurl'], '0') . 132; 


替换为 $userinfo['headimgurl'] =$userinfo['headimgurl'];




app/source/auth/forward.ctrl.php

$record['avatar'] = rtrim($userinfo['headimgurl'], '0') . 132;  


替换为 $record['avatar'] = $userinfo['headimgurl'];