mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-05-06 20:42:52 +08:00
build(tauri): 更新后端端口并优化打包流程
- 将后端端口从8000 修改为 8483 - 更新前端请求基础 URL 以匹配新的后端端口 - 优化后端打包脚本,确保 .env 文件正确复制和清理 - 修改后端主程序和请求工具中的端口配置
This commit is contained in:
2
BillNote_frontend/.env.tauri
Normal file
2
BillNote_frontend/.env.tauri
Normal file
@@ -0,0 +1,2 @@
|
||||
VITE_API_BASE_URL=http://127.0.0.1:8483/api
|
||||
VITE_PLATFORM=tauri
|
||||
@@ -7,7 +7,7 @@
|
||||
"frontendDist": "../dist",
|
||||
"devUrl": "http://localhost:3015",
|
||||
"beforeDevCommand": "pnpm dev",
|
||||
"beforeBuildCommand": "pnpm build"
|
||||
"beforeBuildCommand": "pnpm build --mode tauri "
|
||||
},
|
||||
"app": {
|
||||
"windows": [
|
||||
|
||||
@@ -11,10 +11,11 @@ export interface IResponse<T = any> {
|
||||
// 模拟一个消息提示函数 (实际项目中会使用UI库的组件,如 Ant Design 的 message 或 Element UI 的 ElMessage)
|
||||
// This function simulates a message display (in real projects, you'd use a UI library's component)
|
||||
|
||||
const baseURL = import.meta.env.VITE_API_BASE_URL;
|
||||
|
||||
// 创建实例
|
||||
const request: AxiosInstance = axios.create({
|
||||
baseURL: '/api', // 请确保你的开发服务器代理设置正确
|
||||
baseURL: baseURL || '/api',
|
||||
timeout: 10000,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user