Commit 9aa597e8 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents 8dd552f1 c783f24c
......@@ -2,11 +2,27 @@ import { defineConfig } from 'umi';
import routes from './router';
import proxy from './proxy';
import theme from './lingxi.theme.config';
import envValue from '../env'
import { setEnv, getEnv } from '../scripts/utils/envTool.js'
import CaseSensitivePathsWebpackPlugins from 'case-sensitive-paths-webpack-plugin'
const OPEN_THEME_BUILD = process.env.NODE_ENV === 'production' ? true : false; // 是否开启动态主题
const isProduction = process.env.NODE_ENV === 'production' ? true : false;
// 构建时带上的环境变量
const PRO_ENV = process.env.PRO_ENV
if (PRO_ENV) {
const envs = envValue[PRO_ENV]
if (envs) {
Object.keys(envs).forEach(key => {
process.env[key] = envs[key]
})
}
} else {
console.warn('未传入PRO_ENV, 如果是 yarn的时候出现 可以忽略')
}
const config: any = {
// 如需写入环境变量 需在config中先写入
define: {
......
......@@ -80,7 +80,7 @@ const ChannelPreview: React.FC<ChannelPreviewPropsType> = (props) => {
const headers: any = {
shopId
}
getTemplateAdornWebChannelFindAllFirstCategory(params).then(res => {
getTemplateAdornWebChannelFindAllFirstCategory(params, { headers }).then(res => {
if (res.code === 1000) {
resolve(res.data)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment