dev
wj 2 years ago
parent 369f3d7763
commit c272ea4814

@ -0,0 +1,3 @@
VUE_APP_API_BASE=http://192.168.31.140:9998
template=./public/index-dev.html
outputDir=serve

@ -18,7 +18,7 @@
"file-saver": "^2.0.2",
"js-cookie": "^2.2.0",
"mockjs": "^1.0.1-beta3",
"node-sass": "^6.0.1",
"sass": "^1.32.8",
"nprogress": "^0.2.0",
"pinyin": "^2.10.2",
"useless-files-webpack-plugin": "^1.0.1",
@ -38,7 +38,7 @@
"@vue/test-utils": "^1.0.0-beta.16",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^23.0.1",
"sass-loader": "^7.0.1",
"sass-loader": "^8.0.2",
"vue-template-compiler": "2.5.16"
},
"browserslist": [

@ -11,16 +11,18 @@ import "../../public/config.json";
import axios from "axios";
import myReq from "@/utils/axios";
let BASE_URL = "";
// let BASE_URL = "";
let BASE_URL = process.env.VUE_APP_API_BASE;
let SERVER_IP = "";
let ROUTER_MODE = "";
let IMG_BASE_URL = BASE_URL;
export {BASE_URL, ROUTER_MODE, IMG_BASE_URL, SERVER_IP};
axios.get('./config.json').then((res) => {
let url = process.env.VUE_APP_API_BASE;
// axios.get('./config.json').then((res) => {
// 基础地址
BASE_URL = res.data.BASE_URL;
SERVER_IP = res.data.SERVER_IP;
// BASE_URL = res.data.BASE_URL;
// SERVER_IP = res.data.SERVER_IP;
myReq.defaults.baseURL = BASE_URL;
});
// });

@ -19,7 +19,7 @@ import {addDateRange,selectDictLabel} from '@/utils/tools';
import "./assets/icons/iconfont";
import IconSvg from "./components/common/IconSvg.vue"; // svg组件
import { BASE_URL } from "./config/app"
// import { BASE_URL } from "./config/app"
import axios from "axios";
import "../public/config.json";
import myReq from "./utils/axios"
@ -37,18 +37,22 @@ Vue.config.silent = true;
Vue.config.productionTip = false;
Vue.prototype.selectDictLabel = selectDictLabel;
let getUrl = "";
let url = process.env.VUE_APP_API_BASE;
let startApp = function () {
axios.get('./config.json').then((res) => {
// axios.get('./config.json').then((res) => {
// 基础地址
getUrl = res.data.BASE_URL;
getUrl = url;
myReq.defaults.baseURL = getUrl;
// // 基础地址
// getUrl = res.data.BASE_URL;
// myReq.defaults.baseURL = getUrl;
new Vue({
router,
store,
render: h => h(App)
}).$mount("#app");
});
// });
};
startApp();

@ -1,7 +1,8 @@
const UselessFile = require('useless-files-webpack-plugin');
module.exports = {
baseUrl: process.env.NODE_ENV === "production" ? "./" : "/",
lintOnSave:false,
baseUrl: process.env.NODE_ENV === "production"|| "test" ? "./" : "/",
outputDir: process.env.outputDir,
configureWebpack: config => {
if (process.env.NODE_ENV === "production") {

Loading…
Cancel
Save