setup
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
import * as types from '../types'
|
||||
|
||||
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.162:8011' : 'http://192.168.81.162:8011'
|
||||
const acsUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.162:8010' : 'http://192.168.81.162:8010'
|
||||
const printUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.162:8010' : 'http://192.168.81.162:8010'
|
||||
const state = {
|
||||
baseUrl: uni.getStorageSync('baseUrl') || baseUrl,
|
||||
acsUrl: uni.getStorageSync('acsUrl') || acsUrl,
|
||||
printUrl: uni.getStorageSync('printUrl') || printUrl,
|
||||
setTime: uni.getStorageSync('setTime') || 5000,
|
||||
loginName: uni.getStorageSync('loginName') ? uni.getStorageSync('loginName') : '',
|
||||
userInfo: uni.getStorageSync('userInfo') ? uni.getStorageSync('userInfo') : '',
|
||||
@@ -14,9 +10,7 @@ const state = {
|
||||
}
|
||||
const getters = {
|
||||
baseUrl: state => state.baseUrl,
|
||||
acsUrl: state => state.acsUrl,
|
||||
printUrl: state => state.printUrl,
|
||||
setTime: state => state.setTime,
|
||||
setTime: state => state.setTime,
|
||||
loginName: state => state.loginName,
|
||||
userInfo: state => state.userInfo,
|
||||
saveToken: state => state.saveToken
|
||||
@@ -24,8 +18,6 @@ const getters = {
|
||||
const actions = {
|
||||
setConfig ({commit}, res) {
|
||||
uni.setStorageSync('baseUrl', res.baseUrl)
|
||||
uni.setStorageSync('acsUrl', res.acsUrl)
|
||||
uni.setStorageSync('printUrl', res.printUrl)
|
||||
uni.setStorageSync('setTime', res.setTime)
|
||||
commit(types.COM_CONFIG, res)
|
||||
},
|
||||
@@ -54,8 +46,6 @@ const actions = {
|
||||
const mutations = {
|
||||
[types.COM_CONFIG] (state, res) {
|
||||
state.baseUrl = res.baseUrl
|
||||
state.acsUrl = res.acsUrl
|
||||
state.printUrl = res.printUrl
|
||||
state.setTime = res.setTime
|
||||
},
|
||||
[types.SAVE_LOGIN_NAME] (state, res) {
|
||||
|
||||
Reference in New Issue
Block a user