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

'0041'

@@ -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']);