fix: 扫码登录成功后返回简单页面,不重定向

移动端扫码完成后显示登录成功页面,用户可直接关闭,
不再重定向到前端页面。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-02-26 11:04:31 +08:00
parent cd1499cd0f
commit fd364be4b6
+45 -2
View File
@@ -261,8 +261,51 @@ class AuthController extends BaseController
$session->user_id = $user->id;
$session->save();
// 重定向到前端页面(Webman 使用全局 redirect 函数)
return redirect('https://xsm.dev.hnxinyouhe.com/login');
// 返回简单页面,让用户知道可以关闭了
return new \Webman\Http\Response(200, [], '<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>登录成功</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
margin: 0;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: #fff;
text-align: center;
}
.container {
padding: 40px 20px;
}
h1 {
margin: 0 0 10px 0;
font-size: 28px;
}
p {
margin: 10px 0 0 0;
font-size: 16px;
opacity: 0.9;
}
.icon {
font-size: 64px;
margin-bottom: 20px;
}
</style>
</head>
<body>
<div class="container">
<div class="icon">✅</div>
<h1>登录成功</h1>
<p>您可以关闭此页面返回电脑端继续操作</p>
</div>
</body>
</html>');
} catch (\Exception $e) {
return $this->error($e->getMessage());
}