纽迪希亚平板

This commit is contained in:
2025-02-17 17:02:02 +08:00
commit be0cecfae5
166 changed files with 17382 additions and 0 deletions

31
vuex/modules/data.js Normal file
View File

@@ -0,0 +1,31 @@
import * as types from '../types'
const state = {
publicObj: '',
publicArr: ''
}
const getters = {
publicObj: state => state.publicObj,
publicArr: state => state.publicArr
}
const actions = {
setPublicObj ({commit}, res) {
commit(types.PUBLIC_OBJ, res)
},
setPublicArr ({commit}, res) {
commit(types.PUBLIC_ARR, res)
}
}
const mutations = {
[types.PUBLIC_OBJ] (state, res) {
state.publicObj = res
},
[types.PUBLIC_ARR] (state, res) {
state.publicArr = res
}
}
export default {
state,
getters,
actions,
mutations
}

77
vuex/modules/user.js Normal file
View File

@@ -0,0 +1,77 @@
import * as types from '../types'
const baseUrl = process.env.NODE_ENV === 'development' ? 'http://localhost:8011' : 'http://10.10.188.45:8011'
const imgBaseUrl = process.env.NODE_ENV === 'development' ? 'http://192.168.81.252:8010' : 'http://192.168.81.252:8010'
const state = {
baseUrl: uni.getStorageSync('baseUrl') || baseUrl,
imgBaseUrl: uni.getStorageSync('imgBaseUrl') || imgBaseUrl,
setTime: uni.getStorageSync('setTime') || 10000,
loginName: uni.getStorageSync('loginName') ? uni.getStorageSync('loginName') : '',
userInfo: uni.getStorageSync('userInfo') ? uni.getStorageSync('userInfo') : '',
saveToken: uni.getStorageSync('saveToken') || ''
}
const getters = {
baseUrl: state => state.baseUrl,
imgBaseUrl: state => state.imgBaseUrl,
setTime: state => state.setTime,
loginName: state => state.loginName,
userInfo: state => state.userInfo,
saveToken: state => state.saveToken
}
const actions = {
setConfig ({commit}, res) {
uni.setStorageSync('baseUrl', res.baseUrl)
uni.setStorageSync('setTime', res.setTime)
commit(types.COM_CONFIG, res)
},
saveLoginName({commit}, res) {
uni.setStorageSync('loginName', res)
commit(types.SAVE_LOGIN_NAME, res)
},
delLoginName({commit}, res) {
uni.clearStorageSync('loginName')
commit(types.DEL_LOGIN_NAME, res)
},
saveUserInfo({commit}, res) {
uni.setStorageSync('userInfo', res)
commit(types.SAVE_USER_INFO, res)
},
delUserInfo({commit}, res) {
uni.clearStorageSync('userInfo')
uni.clearStorageSync('saveToken')
commit(types.DEL_USER_INFO, res)
},
saveToken({commit}, res) {
uni.setStorageSync('saveToken', res)
commit(types.SAVE_TOKEN, res)
}
}
const mutations = {
[types.COM_CONFIG] (state, res) {
state.baseUrl = res.baseUrl
state.setTime = res.setTime
},
[types.SAVE_LOGIN_NAME] (state, res) {
state.loginName = res
},
[types.DEL_LOGIN_NAME] (state, res) {
state.loginName = res
},
[types.SAVE_USER_INFO] (state, res) {
state.userInfo = res
},
[types.DEL_USER_INFO] (state, res) {
state.userInfo = res
state.saveToken = res
},
[types.SAVE_TOKEN] (state, res) {
state.saveToken = res
}
}
export default {
state,
getters,
actions,
mutations
}