Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: local api url #40

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v2

- name: 'Set pnpm'
uses: pnpm/action-setup@v2.2.2
uses: pnpm/action-setup@v4.0.0
with:
version: 6.32.20

Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
- uses: actions/checkout@v2

- name: 'Set pnpm'
uses: pnpm/action-setup@v2.2.2
uses: pnpm/action-setup@v4.0.0
with:
version: 6.32.20

Expand All @@ -80,7 +80,7 @@ jobs:
- uses: actions/checkout@v2

- name: 'Set pnpm'
uses: pnpm/action-setup@v2.2.2
uses: pnpm/action-setup@v4.0.0
with:
version: 6.32.20

Expand Down
1 change: 1 addition & 0 deletions src/data/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const APP_CONF = {
COMPONENT: 'https://dtstack.github.io/dt-react-component/?path=/story/*',
TAIER: 'https://dtstack.github.io/Taier/',
DT_UTILS: 'https://dtstack.github.io/dt-utils/#/',
YI_CE: 'https://github.com/DTStack/yice-performance',
DT_SQL_PARSER: 'https://dtstack.github.io/monaco-sql-languages/',
DORAEMON: 'https://dtstack.github.io/doraemon/docsify/#/',
IMAGE_DOMAIN: 'http://assets.dtstack.com',
Expand Down
17 changes: 12 additions & 5 deletions src/data/doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,19 @@ export const OriginList = [
jump_url: APP_CONF.KO,
},
{
key: 'dt-utils',
imgUrl: `${APP_CONF.IMAGE_DOMAIN}/UEDLanding/Home/dt-utils.png`,
title: 'dt-utils',
subTitle: '袋鼠云实用工具库',
jump_url: APP_CONF.DT_UTILS
key: 'yice-performance',
imgUrl: `${APP_CONF.IMAGE_DOMAIN}/UEDLanding/Home/yice.png`,
title: '易测',
subTitle: '易测性能检测平台',
jump_url: APP_CONF.YI_CE
},
// {
// key: 'dt-utils',
// imgUrl: `${APP_CONF.IMAGE_DOMAIN}/UEDLanding/Home/yice.png`,
// title: 'dt-utils',
// subTitle: '袋鼠云实用工具库',
// jump_url: APP_CONF.DT_UTILS
// },
{
key: 'Doraemon',
imgUrl: `${APP_CONF.IMAGE_DOMAIN}/UEDLanding/Home/doraemon.png`,
Expand Down
8 changes: 7 additions & 1 deletion src/data/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const menu = [
label: 'dt-sql-parser',
jump_url: APP_CONF.DT_SQL_PARSER
},
{
{
key: 'code-review-practices',
name: 'code-review-practices',
label: 'code-review-practices',
Expand Down Expand Up @@ -76,6 +76,12 @@ const menu = [
label: 'dt-utils',
jump_url: APP_CONF.DT_UTILS
},
{
key: 'yice-performance',
name: '易测性能检测平台',
label: '易测性能检测平台',
jump_url: APP_CONF.YI_CE
},
{
key: 'Doraemon',
name: 'Doraemon',
Expand Down
6 changes: 4 additions & 2 deletions src/pages/article/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ const Article = (data) => {
]
const {title, description, keywords} = seo || {};
const sortTag = tagList?.find(item => item.key === tag_type)?.label;
const env = process.env.NODE_ENV || 'development';
const fetchUrl = env === 'development' ? 'http://localhost:3002' : '';

useEffect(() => {
setMobile(isMobile(window));
fetch('/api/getTagList')
fetch(`${fetchUrl}/api/getTagList`)
.then(res => res.json())
.then(res => {
const tagList = res.data?.map((item) => {
Expand Down Expand Up @@ -75,7 +77,7 @@ const Article = (data) => {
sort_type,
}
setSpinning(true)
fetch(`/api/getArticleList?${new URLSearchParams(params).toString()}`)
fetch(`${fetchUrl}/api/getArticleList?${new URLSearchParams(params).toString()}`)
.then(res => res.json())
.then(res => {
handleArticleList(res.data)
Expand Down
Loading