fix(api): 替换所有接口请求的域名为 guilixu-api.websoft.top
- 将获取 STS Token 的接口地址由 paopao-api 改为 guilixu-api - 更新图片上传接口地址为新的 guilixu-api 域名 - 修改用户推广页面中邀请码链接和二维码接口的域名 - 更改注册页微信登录接口请求的域名为 guilixu-api
This commit is contained in:
7
config/app.ts
Normal file
7
config/app.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { API_BASE_URL, SERVER_API_URL } from './env'
|
||||
|
||||
export const TenantId = '10610'
|
||||
export const TenantName = '鑫龙家电'
|
||||
export const BaseUrl = API_BASE_URL
|
||||
export const ServerBaseUrl = SERVER_API_URL
|
||||
export const Version = 'v1.0.0'
|
||||
17
config/dev.ts
Normal file
17
config/dev.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export default {
|
||||
env: {
|
||||
NODE_ENV: '"development"'
|
||||
},
|
||||
defineConstants: {
|
||||
__DEV__: JSON.stringify(true)
|
||||
},
|
||||
mini: {},
|
||||
h5: {
|
||||
devServer: {
|
||||
host: 'localhost',
|
||||
port: 10086,
|
||||
hot: true,
|
||||
open: false
|
||||
}
|
||||
}
|
||||
}
|
||||
28
config/env.js
Normal file
28
config/env.js
Normal file
@@ -0,0 +1,28 @@
|
||||
const CURRENT_ENV = process.env.NODE_ENV === 'production' ? 'production' : 'development'
|
||||
|
||||
export const ENV_CONFIG = {
|
||||
development: {
|
||||
API_BASE_URL: 'https://shop-api.websoft.top/api',
|
||||
SERVER_API_URL: 'https://server.websoft.top/api',
|
||||
APP_NAME: '鑫龙家电',
|
||||
DEBUG: 'true',
|
||||
},
|
||||
test: {
|
||||
API_BASE_URL: 'https://shop-api.websoft.top/api',
|
||||
SERVER_API_URL: 'https://server.websoft.top/api',
|
||||
APP_NAME: '鑫龙家电',
|
||||
DEBUG: 'true',
|
||||
},
|
||||
production: {
|
||||
API_BASE_URL: 'https://shop-api.websoft.top/api',
|
||||
SERVER_API_URL: 'https://server.websoft.top/api',
|
||||
APP_NAME: '鑫龙家电',
|
||||
DEBUG: 'false',
|
||||
},
|
||||
}
|
||||
|
||||
export function getEnvConfig() {
|
||||
return ENV_CONFIG[CURRENT_ENV] || ENV_CONFIG.development
|
||||
}
|
||||
|
||||
export const { API_BASE_URL, SERVER_API_URL, APP_NAME, DEBUG } = getEnvConfig()
|
||||
120
config/index.ts
Normal file
120
config/index.ts
Normal file
@@ -0,0 +1,120 @@
|
||||
import { defineConfig, type UserConfigExport } from '@tarojs/cli'
|
||||
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin'
|
||||
import { UnifiedWebpackPluginV5 } from 'weapp-tailwindcss/webpack'
|
||||
import devConfig from './dev'
|
||||
import prodConfig from './prod'
|
||||
import path from 'path'
|
||||
import { getEnvConfig } from './env.js'
|
||||
|
||||
// https://taro-docs.jd.com/docs/next/config
|
||||
export default defineConfig<'webpack5'>(async (merge, { mode }) => {
|
||||
const baseConfig: UserConfigExport<'webpack5'> = {
|
||||
// 项目配置
|
||||
projectName: 'shop-taro',
|
||||
date: '2026-5-10',
|
||||
designWidth: 750,
|
||||
deviceRatio: {
|
||||
640: 2.34 / 2,
|
||||
750: 1,
|
||||
828: 1.81 / 2
|
||||
},
|
||||
sourceRoot: 'src',
|
||||
outputRoot: 'dist',
|
||||
plugins: [
|
||||
'@tarojs/plugin-platform-weapp',
|
||||
'@tarojs/plugin-platform-h5'
|
||||
],
|
||||
|
||||
// 编译配置
|
||||
defineConstants: {
|
||||
API_BASE_URL: JSON.stringify(getEnvConfig().API_BASE_URL),
|
||||
SERVER_API_URL: JSON.stringify(getEnvConfig().SERVER_API_URL),
|
||||
APP_NAME: JSON.stringify(getEnvConfig().APP_NAME),
|
||||
DEBUG: JSON.stringify(getEnvConfig().DEBUG),
|
||||
},
|
||||
copy: {
|
||||
patterns: [],
|
||||
options: {}
|
||||
},
|
||||
framework: 'react',
|
||||
compiler: {
|
||||
type: 'webpack5',
|
||||
prebundle: {
|
||||
enable: false
|
||||
}
|
||||
},
|
||||
// 开启持久化缓存 - 有效提升二次编译速度
|
||||
cache: {
|
||||
enable: false,
|
||||
type: 'filesystem',
|
||||
cacheDirectory: path.resolve(__dirname, '../.webpack-cache'),
|
||||
buildDependencies: {
|
||||
config: [__filename]
|
||||
}
|
||||
},
|
||||
|
||||
// 小程序配置
|
||||
mini: {
|
||||
postcss: {
|
||||
pxtransform: {
|
||||
enable: true,
|
||||
config: {}
|
||||
},
|
||||
url: {
|
||||
enable: true,
|
||||
config: {
|
||||
limit: 1024
|
||||
}
|
||||
},
|
||||
cssModules: {
|
||||
enable: false,
|
||||
config: {
|
||||
namingPattern: 'module',
|
||||
generateScopedName: '[name]__[local]___[hash:base64:5]'
|
||||
}
|
||||
}
|
||||
},
|
||||
webpackChain(chain) {
|
||||
chain.resolve.plugin('tsconfig-paths').use(TsconfigPathsPlugin)
|
||||
// weapp-tailwindcss: 自动处理 TailwindCSS 与 WXSS 的兼容性
|
||||
chain.merge({
|
||||
plugin: {
|
||||
'weapp-tailwindcss': {
|
||||
plugin: UnifiedWebpackPluginV5,
|
||||
args: [{
|
||||
appType: 'taro',
|
||||
rem2rpx: true,
|
||||
}]
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// H5 配置
|
||||
h5: {
|
||||
publicPath: '/',
|
||||
staticDirectory: 'static',
|
||||
postcss: {
|
||||
autoprefixer: {
|
||||
enable: true
|
||||
},
|
||||
cssModules: {
|
||||
enable: false,
|
||||
config: {
|
||||
namingPattern: 'module',
|
||||
generateScopedName: '[name]__[local]___[hash:base64:5]'
|
||||
}
|
||||
}
|
||||
},
|
||||
webpackChain(chain) {
|
||||
chain.resolve.plugin('tsconfig-paths').use(TsconfigPathsPlugin)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
if (mode === 'development') {
|
||||
return merge({}, baseConfig, devConfig)
|
||||
}
|
||||
return merge({}, baseConfig, prodConfig)
|
||||
})
|
||||
12
config/prod.ts
Normal file
12
config/prod.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export default {
|
||||
env: {
|
||||
NODE_ENV: '"production"'
|
||||
},
|
||||
defineConstants: {
|
||||
__DEV__: JSON.stringify(false)
|
||||
},
|
||||
mini: {
|
||||
compressTemplate: true
|
||||
},
|
||||
h5: {}
|
||||
}
|
||||
Reference in New Issue
Block a user