抽离全局变量

This commit is contained in:
lsy
2018-01-08 14:40:16 +08:00
parent 583bd04e91
commit c5c846abed
3 changed files with 10 additions and 3 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ module.exports = {
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
port: 80, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
notifyOnErrors: true,
+2 -2
View File
@@ -42,9 +42,9 @@
return signIn
},
methods: {
signIn: function () {
signIn () {
let that = this
that.$http.post('http://fthipw.natappfree.cc:10006/upms/user/login', that.$querystring.stringify(signIn))
that.$http.post(that.$msConfig.reqUpms + '/user/login', that.$querystring.stringify(signIn))
.then(response => {
console.log(response.data)
}, error => {
+7
View File
@@ -19,6 +19,13 @@ Vue.prototype.$http = axios
// 用于转换json数据
let querystring = require('querystring')
Vue.prototype.$querystring = querystring
// 全局参数配置
Vue.prototype.$msConfig = {
// ms系统的请求的基础路径
reqBaseUrl: 'http://fthipw.natappfree.cc',
// 权限管理系统请求的基础路径
reqUpms: this.reqBaseUrl + ':10006/upms'
}
// admin模块的state和action
const admin = new Vuex.Store({
// 模块的state