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

'0041'

@@ -44,7 +44,6 @@ class Login extends BaseApi @@ -44,7 +44,6 @@ class Login extends BaseApi
44 */ 44 */
45 public function third() 45 public function third()
46 { 46 {
47 - dd(!in_array('.jpg',explode(',','jpg,png,bmp,jpeg,gif,zip,rar,xls,xlsx')));  
48 $platform = $this->request->request("platform"); 47 $platform = $this->request->request("platform");
49 $code = $this->request->request("code"); 48 $code = $this->request->request("code");
50 $config = get_addon_config('third'); 49 $config = get_addon_config('third');
@@ -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']);