Skip to content

Commit

Permalink
chore: 提取全局环境变量
Browse files Browse the repository at this point in the history
  • Loading branch information
JackySoft authored and jianbing.chen committed Dec 18, 2024
1 parent d23ccc9 commit 1a1a8e6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
6 changes: 0 additions & 6 deletions packages/admin/src/config/host.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/editor/src/pages/home/PageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export default function Index() {
<Tooltip title="访问">
<SendOutlined
onClick={() => {
window.open(`http://admin.marsview.cc/page/stg/${item.id}`, '_blank');
window.open(`${import.meta.env.VITE_ADMIN_URL}/page/stg/${item.id}`, '_blank');
}}
/>
</Tooltip>
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/pages/home/Template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default function Index() {
<Tooltip title="页面访问">
<SendOutlined
onClick={() => {
window.open(`http://admin.marsview.cc/page/stg/${item.id}`, '_blank');
window.open(`${import.meta.env.VITE_ADMIN_URL}/page/stg/${item.id}`, '_blank');
}}
/>
</Tooltip>
Expand Down
2 changes: 1 addition & 1 deletion packages/materials/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import request from './../utils/request';

// 图片上传
export const uploadImg = (params: any) => {
return request.post('http://mars-api.marsview.cc/api/upload/files', params, { 'Content-Type': 'multipart/form-data' });
return request.post(`${import.meta.env.VITE_BASE_API}/api/upload/files`, params, { 'Content-Type': 'multipart/form-data' });
};

0 comments on commit 1a1a8e6

Please sign in to comment.