diff --git a/.env.development b/.env.development index 293208c..1231956 100644 --- a/.env.development +++ b/.env.development @@ -1,7 +1,7 @@ # just a flag ENV = 'development' # base api -VUE_APP_BASE_API = 'http://f.hzs413.com/inter-api/' +VUE_APP_BASE_API = '/prod-api' VUE_APP_BASE_INTERAPI = 'https://dny-test.s3.ap-southeast-1.amazonaws.com/online/language' VUE_APP_BASE_INTERAPI2 = 'http://f.hzs413.com/language' \ No newline at end of file diff --git a/.env.production b/.env.production index 310f42b..7d834d9 100644 --- a/.env.production +++ b/.env.production @@ -2,7 +2,7 @@ ENV = 'production' # base api -VUE_APP_BASE_API = '/inter-api' +VUE_APP_BASE_API = '/prod-api' VUE_APP_BASE_API1 = 'http://index.hzs413.com' VUE_APP_BASE_INTERAPI = 'https://dny-test.s3.ap-southeast-1.amazonaws.com/test/language' diff --git a/vue.config.js b/vue.config.js index f255a41..8f491fa 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,46 +1,55 @@ /* - * @Descripttion: - * @version: + * @Descripttion: + * @version: * @Author: kBank * @Date: 2022-09-29 10:04:55 */ // 引入等比适配插件 -const px2rem = require('postcss-px2rem') +const px2rem = require("postcss-px2rem"); // 配置基本大小 const postcss = px2rem({ // 基准大小 baseSize,需要和rem.js中相同 - remUnit: 16 -}) + remUnit: 16, +}); // 使用等比适配插件 module.exports = { lintOnSave: false, + devServer: { + port: 8866, + proxy: { + "/prod-api": { + target: "http://localhost:8080", + changeOrigin: true, + pathRewrite: { + "^/prod-api": "", + }, + }, + }, + }, + css: { loaderOptions: { postcss: { - plugins: [ - postcss - ] - } - } + plugins: [postcss], + }, + }, }, configureWebpack: { externals: { - 'enUS': 'enUS', - 'zhCN': 'zhCN', - 'zhTC': 'zhTC', - 'ruRU':'ruRU', - 'frFR':'frFR', - 'ptPT':'ptPT', + enUS: "enUS", + zhCN: "zhCN", + zhTC: "zhTC", + ruRU: "ruRU", + frFR: "frFR", + ptPT: "ptPT", }, }, - chainWebpack: config => { - config - .plugin('html') - .tap(args => { - args[0].title = '会员系统' - return args - }) - } -} + chainWebpack: (config) => { + config.plugin("html").tap((args) => { + args[0].title = "会员系统"; + return args; + }); + }, +};