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:
freedakgmail
2026-07-27 09:44:21 +08:00
parent 9739c4f29b
commit f5fa9ace88
9 changed files with 29 additions and 42 deletions
+1 -1
View File
@@ -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,
})
+3 -2
View File
@@ -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"
+1
View File
@@ -0,0 +1 @@
/// <reference types="vite/client" />