登录车辆模块
This commit is contained in:
@@ -3,9 +3,13 @@ import { getStore, setStore } from '@config/utils.js'
|
||||
|
||||
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://43.139.166.161:8018' : 'http://localhost:8018'
|
||||
const setTime = '1000'
|
||||
const username = 'admin'
|
||||
const password = '123456'
|
||||
const state = {
|
||||
baseUrl: getStore('baseUrl') || baseUrl,
|
||||
setTime: getStore('setTime') || setTime,
|
||||
defaultUsername: getStore('defaultUsername') || username,
|
||||
defaultPassword: getStore('defaultPassword') || password,
|
||||
loading: false,
|
||||
showToast: false,
|
||||
showAlert: false,
|
||||
@@ -18,6 +22,8 @@ const state = {
|
||||
const getters = {
|
||||
baseUrl: state => state.baseUrl,
|
||||
setTime: state => state.setTime,
|
||||
defaultUsername: state => state.defaultUsername,
|
||||
defaultPassword: state => state.defaultPassword,
|
||||
loading: state => state.loading,
|
||||
showToast: state => state.showToast,
|
||||
showAlert: state => state.showAlert
|
||||
@@ -29,6 +35,11 @@ const actions = {
|
||||
setStore('setTime', res.setTime)
|
||||
commit(types.COM_CONFIG, res)
|
||||
},
|
||||
setLoginInfo ({commit}, res) {
|
||||
setStore('defaultUsername', res.username)
|
||||
setStore('defaultPassword', res.password)
|
||||
commit(types.COM_LOGIN_INFO, res)
|
||||
},
|
||||
setLoadingState ({ commit }, status) {
|
||||
commit(types.COM_LOADING_STATUS, status)
|
||||
},
|
||||
@@ -58,6 +69,11 @@ const mutations = {
|
||||
state.setTime = res.setTime
|
||||
},
|
||||
|
||||
[types.COM_LOGIN_INFO] (state, res) {
|
||||
state.defaultUsername = res.username
|
||||
state.defaultPassword = res.password
|
||||
},
|
||||
|
||||
[types.COM_LOADING_STATUS] (state, status) {
|
||||
state.loading = status
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user