|
@@ -126,8 +126,7 @@ class User extends Model |
|
@@ -126,8 +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
|
-
|
|
|
130
|
- if ($data['avatar'] != '' && !in_array(substr($data['avatar'],-4),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'))){
|
131
|
$content = file_get_contents($data['avatar']);
|
130
|
$content = file_get_contents($data['avatar']);
|
132
|
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);
|
133
|
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']);
|