- 移除登录页面的登录/注册切换,只保留登录功能 - 添加API代理配置支持远程访问 - 添加favicon.ico - 后端CORS配置支持前端访问 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
18 lines
547 B
JavaScript
18 lines
547 B
JavaScript
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);
|
|
}
|