Skip to content

feat(vite): 配置开发环境代理并调整请求基础 URL#7

Open
wenyongda wants to merge 5 commits into
element-plus-x:mainfrom
wenyongda:main
Open

feat(vite): 配置开发环境代理并调整请求基础 URL#7
wenyongda wants to merge 5 commits into
element-plus-x:mainfrom
wenyongda:main

Conversation

@wenyongda
Copy link
Copy Markdown

  • 在 .env.development 文件中设置 VITE_API_URL 为 http://localhost:6039
  • 在 src/utils/request.ts 中将请求的 baseURL 改为 VITE_WEB_BASE_API
  • 在 vite.config.ts 中添加开发环境代理配置,将 /dev-api 代理到 VITE_API_URL

wenyongda and others added 5 commits June 23, 2025 14:08
- 在 .env.development 文件中设置 VITE_API_URL 为 http://localhost:6039
- 在 src/utils/request.ts 中将请求的 baseURL 改为 VITE_WEB_BASE_API
- 在 vite.config.ts 中添加开发环境代理配置,将 /dev-api 代理到 VITE_API_URL
- 引入 dayjs 库以更灵活地处理日期格式
- 定义格式化字符串 'YYYY/M/D Ah:mm' 以统一日期显示格式
- 使用 dayjs 转换 createTime 字段,确保日期显示的一致性和准确性
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant