|
@@ -176,8 +176,13 @@ class UserController extends Controller
|
|
|
}
|
|
|
|
|
|
// 修改联系方式
|
|
|
- if ($request->has(['username', 'wechat', 'qq'])) {
|
|
|
- $data = $request->only(['username', 'wechat', 'qq']);
|
|
|
+ if ($request->has(['email','username', 'wechat', 'qq'])) {
|
|
|
+ $data = $request->only(['email','username', 'wechat', 'qq']);
|
|
|
+
|
|
|
+ if ($data['email'] === $user->email) {
|
|
|
+ return Redirect::back()->withErrors(trans('common.update_action', ['action' => trans('common.failed_email')]));
|
|
|
+ }
|
|
|
+
|
|
|
if (empty($data['username'])) {
|
|
|
return Redirect::back()->withErrors(trans('validation.required', ['attribute' => trans('validation.attributes.username')]));
|
|
|
}
|
|
@@ -187,6 +192,8 @@ class UserController extends Controller
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
return Redirect::back()->with('successMsg', trans('common.update_action', ['action' => trans('common.success')]));
|
|
|
}
|
|
|
|