public function user_avatar_upload() { try { $this->throwMsgCheck('is_post', 'is_login'); lib()->load("UserControl"); $uc = new UserControl(); $uc->upload_avatar(login_user()); $this->rt_msg['content'] = Avatar::upload_avatar(login_user()); if (!req()->is_ajax()) { header("Location: " . $_SERVER['HTTP_REFERER']); } $this->rt_msg['status'] = true; } catch (\Exception $ex) { $this->rt_msg['msg'] = $ex->getMessage(); $this->rt_msg['code'] = $ex->getCode(); } }