Skip to content

Commit

Permalink
添加 REMAX_APP_PUBLIC_ASSET_HOST 相关配置项
Browse files Browse the repository at this point in the history
  • Loading branch information
war408705279 committed Feb 5, 2021
1 parent 3066c55 commit 8c753eb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
REMAX_APP_HOST=''
REMAX_APP_API_HOST='http://rap2.taobao.org:38080/app/mock/263489'
REMAX_APP_PUBLIC_ASSET_HOST=''
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
REMAX_APP_HOST=''
REMAX_APP_API_HOST=''
REMAX_APP_PUBLIC_ASSET_HOST='https://portal-mp-static.qiniu.com'
9 changes: 6 additions & 3 deletions src/constants/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@ function must(name: string, variable?: string): string {
return variable
}

/** Host */
// Host
export const host = must('host', process.env.REMAX_APP_HOST)

/** API Host */
// API Host
export const apiHost = must('apiHost', process.env.REMAX_APP_API_HOST)

/** Platform */
// Platform
export const platform = must('platform', process.env.REMAX_PLATFORM)

// Asset Host
export const publicAssetHost = must('publicAssetHost', process.env.REMAX_APP_PUBLIC_ASSET_HOST)

export enum Platform {
Wechat = 'wechat',
Ali = 'ali'
Expand Down

0 comments on commit 8c753eb

Please sign in to comment.