getCurrentUser(); if (empty($userInfo['identity'])) { Render([], '2001', lang('Common','Api') -> get('user does login')); } $updateWhere['account_identity'] = $userInfo['identity']; $updateData = []; // 提取修改数据 if (!empty($_POST['email'])) { $updateData['email'] = $_POST['email']; } if (!empty($_POST['phone'])) { $updateData['phone'] = $_POST['phone']; } if (!empty($_POST['img_id'])) { $updateData['img_id'] = $_POST['img_id']; $updateData['img_url'] = ''; } if (!empty($_POST['name'])) { $updateData['name'] = $_POST['name']; } if (empty($updateData)) { Render([], '4027', lang('Common','Api') -> get('please enter the modification')); } return lm('Account_detailed', 'commons') -> updateDetailed($updateWhere, $updateData); } /** * 上传用户基本信息头像 * * @access public * @return String */ public function updateHeader() { // 获取用户信息 $accountManagerClass = new AccountManager; $userInfo = $accountManagerClass -> getCurrentUser(); if (empty($userInfo['identity'])) { Render([], '2001', lang('Common','Api') -> get('user does login')); } $updateWhere['account_identity'] = $userInfo['identity']; $avatar = $request->file('avatar')->store('/public/' . date('Y-m-d') . '/avatars'); echo json_encode($input);die; $updateData = []; // 提取修改数据 if (!empty($_POST['email'])) { $updateData['email'] = $_POST['email']; } if (!empty($_POST['phone'])) { $updateData['phone'] = $_POST['phone']; } if (!empty($_POST['img_id'])) { $updateData['img_id'] = $_POST['img_id']; $updateData['img_url'] = ''; } if (!empty($_POST['name'])) { $updateData['name'] = $_POST['name']; } if (empty($updateData)) { Render([], '4027', lang('Common','Api') -> get('please enter the modification')); } return lm('Account_detailed', 'commons') -> updateDetailed($updateWhere, $updateData); } }