feat: 部署前端到dm.all8ai.top + 性能优化 + 登录页密码验证
- 前端构建部署到152.136.182.184服务器,nginx反向代理 - SSH反向隧道(13333端口)连接服务器到本地后端 - SSL证书自动配置(Let's Encrypt) - API baseURL支持环境变量VITE_API_BASE_URL - 后端端口改为3333,CORS允许所有来源 - 物化6个慢视图(overview/risk/loop_health/benchmark/region/followup) - 登录页保留密码输入框,必须输入密码才能登录 - run.md添加登录账号信息
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios'
|
||||
|
||||
const api = axios.create({
|
||||
baseURL: '/api',
|
||||
baseURL: import.meta.env.VITE_API_BASE_URL || '/api',
|
||||
timeout: 30000,
|
||||
})
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ interface LoginPageProps {
|
||||
export function LoginPage({ onLogin }: LoginPageProps) {
|
||||
const navigate = useNavigate()
|
||||
const [username, setUsername] = useState('总部管理员')
|
||||
const [password, setPassword] = useState('123')
|
||||
const [password, setPassword] = useState('')
|
||||
const [error, setError] = useState('')
|
||||
|
||||
const handleLogin = async () => {
|
||||
@@ -34,9 +34,11 @@ export function LoginPage({ onLogin }: LoginPageProps) {
|
||||
<input
|
||||
value={username}
|
||||
onChange={(e) => setUsername(e.target.value)}
|
||||
onKeyDown={(e) => e.key === 'Enter' && handleLogin()}
|
||||
className="mt-1 w-full rounded-md border px-3 py-2 text-sm"
|
||||
/>
|
||||
</div>
|
||||
{error && <p className="text-sm text-red-600">{error}</p>}
|
||||
<div>
|
||||
<label className="text-sm text-muted-foreground">密码</label>
|
||||
<input
|
||||
@@ -47,7 +49,6 @@ export function LoginPage({ onLogin }: LoginPageProps) {
|
||||
className="mt-1 w-full rounded-md border px-3 py-2 text-sm"
|
||||
/>
|
||||
</div>
|
||||
{error && <p className="text-sm text-red-600">{error}</p>}
|
||||
<button
|
||||
onClick={handleLogin}
|
||||
className="w-full rounded-md bg-primary py-2 text-sm font-medium text-primary-foreground"
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
/// <reference types="vite/client" />
|
||||
Reference in New Issue
Block a user