diff --git a/.env.development b/.env.development index 8f5856d..f67b802 100644 --- a/.env.development +++ b/.env.development @@ -2,7 +2,7 @@ ENV = 'development' # base api -VUE_APP_BASE_API = '/dev-api' +VUE_APP_BASE_API = '/api' # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable, # to control whether the babel-plugin-dynamic-import-node plugin is enabled. diff --git a/.env.production b/.env.production index 80c8103..14da59c 100644 --- a/.env.production +++ b/.env.production @@ -2,5 +2,5 @@ ENV = 'production' # base api -VUE_APP_BASE_API = '/prod-api' +VUE_APP_BASE_API = '/' diff --git a/package.json b/package.json index 938258c..b52f14a 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,9 @@ "lint": "eslint --ext .js,.vue src", "test:unit": "jest --clearCache && vue-cli-service test:unit", "test:ci": "npm run lint && npm run test:unit", - "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml" + "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml", + "start": "node index.js", + "server": "nodemon index.js --ignore client" }, "dependencies": { "axios": "0.18.1", diff --git a/src/api/user.js b/src/api/user.js index 8ff4389..2ee8b75 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -2,7 +2,7 @@ import request from '@/utils/request' export function login(data) { return request({ - url: '/vue-admin-template/user/login', + url: '/login', method: 'post', data }) diff --git a/src/main.js b/src/main.js index bd204b2..775b0a6 100644 --- a/src/main.js +++ b/src/main.js @@ -33,10 +33,10 @@ Vue.component(CollapseTransition.name, CollapseTransition) * Currently MockJs will be used in the production environment, * please remove it before going online ! ! ! */ -if (process.env.NODE_ENV === 'production') { - const { mockXHR } = require('../mock') - mockXHR() -} +// if (process.env.NODE_ENV === 'production') { +// const { mockXHR } = require('../mock') +// mockXHR() +// } // set ElementUI lang to EN Vue.use(ElementUI, { locale }) diff --git a/src/utils/request.js b/src/utils/request.js index 2fb95ac..28c6c96 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -7,7 +7,7 @@ import { getToken } from '@/utils/auth' const service = axios.create({ baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url // withCredentials: true, // send cookies when cross-domain requests - timeout: 5000 // request timeout + timeout: 15000 // request timeout }) // request interceptor diff --git a/src/views/account/index.vue b/src/views/account/index.vue index b17fe0b..04c327d 100644 --- a/src/views/account/index.vue +++ b/src/views/account/index.vue @@ -227,7 +227,8 @@ export default {