fix: 修复头像上传
This commit is contained in:
@@ -587,9 +587,10 @@ class User extends HomeController
|
|||||||
if (!$response) {
|
if (!$response) {
|
||||||
return $this->error(Upload::instance()->getError());
|
return $this->error(Upload::instance()->getError());
|
||||||
}
|
}
|
||||||
$userInfo = $request->userInfo;
|
|
||||||
$userInfo->avatar = $response['url'] . '?' . Random::alpha(12);
|
$avatar = $response['url'] . '?' . Random::alpha(12);
|
||||||
if ($userInfo->save()) {
|
$result = $this->model->where('id', $request->userId)->update(['avatar' => $avatar]);
|
||||||
|
if (!empty($result)) {
|
||||||
return json($response);
|
return json($response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user