作者 郭宇鹏
1 个管道 的构建 通过 耗费 1 秒

'0041'

... ... @@ -44,7 +44,6 @@ class Login extends BaseApi
*/
public function third()
{
dd(!in_array('.jpg',explode(',','jpg,png,bmp,jpeg,gif,zip,rar,xls,xlsx')));
$platform = $this->request->request("platform");
$code = $this->request->request("code");
$config = get_addon_config('third');
... ...
... ... @@ -126,8 +126,7 @@ class User extends Model
//$value = '/assets/img/avatar.png';
$value = letter_avatar($data['nickname']);
}
if ($data['avatar'] != '' && !in_array(substr($data['avatar'],-4),explode(',','jpg,png,bmp,jpeg,gif,zip,rar,xls,xlsx'))){
if ($data['avatar'] != '' && !in_array(substr($data['avatar'],-3),explode(',','.jpg,png,bmp,jpeg,gif,zip,rar,xls,xlsx'))){
$content = file_get_contents($data['avatar']);
file_put_contents(ROOT_PATH.'/public/uploads/user_avatar/user_id_'.$data['id'].'.jpg', $content);
model('user')->where('id',$data['id'])->update(['avatar'=>'/uploads/user_avatar/user_id_'.$data['id'].'.jpg']);
... ...