feat: 登录界面优化与API代理配置
- 移除登录页面的登录/注册切换,只保留登录功能 - 添加API代理配置支持远程访问 - 添加favicon.ico - 后端CORS配置支持前端访问 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
a89d4f2402
commit
02f48927a3
@@ -0,0 +1,17 @@
|
||||
export default async function handler(req, res) {
|
||||
const { 0: path } = req.query;
|
||||
|
||||
const backendUrl = `http://localhost:3501/${path}`;
|
||||
|
||||
const response = await fetch(backendUrl, {
|
||||
method: req.method,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(req.headers.authorization ? { Authorization: req.headers.authorization } : {}),
|
||||
},
|
||||
body: req.method !== 'GET' && req.method !== 'HEAD' ? JSON.stringify(req.body) : undefined,
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
res.status(response.status).json(data);
|
||||
}
|
||||
Reference in New Issue
Block a user