This commit is contained in:
root 2019-12-25 15:31:40 +08:00
parent 5732cd59f3
commit b19d6d768c

View File

@ -38,6 +38,7 @@ class LoginController extends Controller
if (empty($request->input('token'))) { if (empty($request->input('token'))) {
abort(500, '参数错误'); abort(500, '参数错误');
} }
$redirect = $request->input('redirect') ? $request->input('redirect') : 'dashboard';
$user = User::where('token', $request->input('token'))->first(); $user = User::where('token', $request->input('token'))->first();
if ($user) { if ($user) {
$request->session()->put('email', $user->email); $request->session()->put('email', $user->email);
@ -47,9 +48,9 @@ class LoginController extends Controller
} }
} }
if (config('v2board.app_url')) { if (config('v2board.app_url')) {
$location = config('v2board.app_url') . '/#/' . $request->input('redirect') ? $request->input('redirect') : 'dashboard'; $location = config('v2board.app_url') . '/#/' . $redirect;
} else { } else {
$location = url('/#/' . $request->input('redirect') ? $request->input('redirect') : 'dashboard'); $location = url('/#/' . $redirect);
} }
header('Location:' . $location); header('Location:' . $location);
} }