正在显示
1 个修改的文件
包含
1 行增加
和
1 行删除
@@ -126,7 +126,7 @@ class User extends Model | @@ -126,7 +126,7 @@ class User extends Model | ||
126 | //$value = '/assets/img/avatar.png'; | 126 | //$value = '/assets/img/avatar.png'; |
127 | $value = letter_avatar($data['nickname']); | 127 | $value = letter_avatar($data['nickname']); |
128 | } | 128 | } |
129 | - if ($data['avatar'] != '' && !in_array(substr($data['avatar'],-3),explode(',','.jpg,png,bmp,jpeg,gif,zip,rar,xls,xlsx'))){ | 129 | + if ($data['avatar'] != '' && !in_array(substr($data['avatar'],-3),explode(',','jpg,png,bmp,jpeg,gif,zip,rar,xls,xlsx'))){ |
130 | $content = file_get_contents($data['avatar']); | 130 | $content = file_get_contents($data['avatar']); |
131 | file_put_contents(ROOT_PATH.'/public/uploads/user_avatar/user_id_'.$data['id'].'.jpg', $content); | 131 | file_put_contents(ROOT_PATH.'/public/uploads/user_avatar/user_id_'.$data['id'].'.jpg', $content); |
132 | model('user')->where('id',$data['id'])->update(['avatar'=>'/uploads/user_avatar/user_id_'.$data['id'].'.jpg']); | 132 | model('user')->where('id',$data['id'])->update(['avatar'=>'/uploads/user_avatar/user_id_'.$data['id'].'.jpg']); |
-
请 注册 或 登录 后发表评论