1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- // The Vue build version to load with the `import` command
- // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
- import Vue from "vue";
- import App from "./App";
- import router from "./router";
- import axios from "axios";
- import Cube from "./index";
- import "lib-flexible";
- import "./filters";
- // import VConsole from "vconsole";
- // import host from '../src/request/host'
- // import {get,post} from './service/http'
- // new VConsole();
- Vue.use(Cube);
- console.info('v1.0.2');
- // 修改请求接口(删掉地址栏中的app2)
- let domainName = document.domain; //域名
- let protocolName = document.location.protocol; //http协议
- axios.defaults.baseURL = protocolName + "//" + domainName;
- // axios.defaults.timeout = 5000;
- axios.interceptors.response.use(function (response) {
- return response;
- }, function (error) {
- if(error && error.response && error.response.status == 444){
- window.location.href = location.origin + '/user.jsp';
- }
- return Promise.reject(error);
- });
- Vue.prototype.$http = axios;
- Vue.config.productionTip = false;
- Vue.prototype.$host = protocolName + "//" + domainName;
- //因项目众多,前端为了加以区分,所以用域名加以判断,后期有更好的方式可以自行修改
- // 中南财大
- Vue.prototype.isZncd = document.domain === 'itsm.zuel.edu.cn';
- /* eslint-disable no-new */
- new Vue({
- el: "#app",
- router,
- components: { App },
- template: "<App/>"
- });
|