|
|
@ -19,6 +19,7 @@ const user = {
|
|
|
|
buttons: [], // 按钮权限
|
|
|
|
buttons: [], // 按钮权限
|
|
|
|
admintype: '', // 是否是超管
|
|
|
|
admintype: '', // 是否是超管
|
|
|
|
roles: [],
|
|
|
|
roles: [],
|
|
|
|
|
|
|
|
FirstLoading: true,
|
|
|
|
messageNum: 0,
|
|
|
|
messageNum: 0,
|
|
|
|
info: {},
|
|
|
|
info: {},
|
|
|
|
notices: [], // 接收的通知公告
|
|
|
|
notices: [], // 接收的通知公告
|
|
|
@ -90,6 +91,9 @@ const user = {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
SET_MESSAGENUM: (state, num) => {
|
|
|
|
SET_MESSAGENUM: (state, num) => {
|
|
|
|
state.messageNum = num
|
|
|
|
state.messageNum = num
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
SET_LOADING: (state, flag) => {
|
|
|
|
|
|
|
|
state.FirstLoading = flag
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
@ -116,8 +120,8 @@ const user = {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 跨平台登录
|
|
|
|
// 跨平台登录
|
|
|
|
LoginWithCode({ commit }, userInfo) {
|
|
|
|
LoginWithCode({ commit }, userInfo) {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
loginWithCode(userInfo)
|
|
|
|
loginWithCode(userInfo)
|
|
|
|
.then(response => {
|
|
|
|
.then(response => {
|
|
|
@ -130,6 +134,7 @@ const user = {
|
|
|
|
Vue.ls.set(ACCESS_TOKEN, result, 7 * 24 * 60 * 60 * 1000)
|
|
|
|
Vue.ls.set(ACCESS_TOKEN, result, 7 * 24 * 60 * 60 * 1000)
|
|
|
|
Vue.ls.set('FIRSTFLAG', true, 7 * 24 * 60 * 60 * 1000)
|
|
|
|
Vue.ls.set('FIRSTFLAG', true, 7 * 24 * 60 * 60 * 1000)
|
|
|
|
commit('SET_TOKEN', result)
|
|
|
|
commit('SET_TOKEN', result)
|
|
|
|
|
|
|
|
commit('SET_LOADING', false)
|
|
|
|
resolve()
|
|
|
|
resolve()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch(error => {
|
|
|
|
.catch(error => {
|
|
|
@ -211,20 +216,20 @@ const user = {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 登出
|
|
|
|
// 登出
|
|
|
|
ClearnInfo({ commit, state }) {
|
|
|
|
ClearnInfo({ commit, state }) {
|
|
|
|
return new Promise(resolve => {
|
|
|
|
return new Promise(resolve => {
|
|
|
|
commit('SET_TOKEN', '')
|
|
|
|
commit('SET_TOKEN', '')
|
|
|
|
commit('SET_ROLES', [])
|
|
|
|
commit('SET_ROLES', [])
|
|
|
|
commit('SET_BUTTONS', [])
|
|
|
|
commit('SET_BUTTONS', [])
|
|
|
|
commit('SET_ADMINTYPE', '')
|
|
|
|
commit('SET_ADMINTYPE', '')
|
|
|
|
commit('SET_INFO', null)
|
|
|
|
commit('SET_INFO', null)
|
|
|
|
Vue.ls.remove(ACCESS_TOKEN)
|
|
|
|
Vue.ls.remove(ACCESS_TOKEN)
|
|
|
|
Vue.ls.remove(ALL_APPS_MENU)
|
|
|
|
Vue.ls.remove(ALL_APPS_MENU)
|
|
|
|
Vue.ls.remove(DICT_TYPE_TREE_DATA)
|
|
|
|
Vue.ls.remove(DICT_TYPE_TREE_DATA)
|
|
|
|
resolve()
|
|
|
|
resolve()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 加载所有字典数据
|
|
|
|
// 加载所有字典数据
|
|
|
|
dictTypeData() {
|
|
|
|
dictTypeData() {
|
|
|
@ -319,25 +324,25 @@ const user = {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 加载所有货物状态
|
|
|
|
// 加载所有货物状态
|
|
|
|
configPageList() {
|
|
|
|
configPageList() {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
getconfigPage({ 'PageSize': 1000 })
|
|
|
|
getconfigPage({ 'PageSize': 1000 })
|
|
|
|
.then(data => {
|
|
|
|
.then(data => {
|
|
|
|
if (data.success) {
|
|
|
|
if (data.success) {
|
|
|
|
const result = data.data.rows
|
|
|
|
const result = data.data.rows
|
|
|
|
Vue.ls.set('configPageList', result)
|
|
|
|
Vue.ls.set('configPageList', result)
|
|
|
|
resolve()
|
|
|
|
resolve()
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// eslint-disable-next-line no-undef
|
|
|
|
// eslint-disable-next-line no-undef
|
|
|
|
reject(new Error(data.message))
|
|
|
|
reject(new Error(data.message))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch(error => {
|
|
|
|
.catch(error => {
|
|
|
|
reject(error)
|
|
|
|
reject(error)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 设置订舱列表
|
|
|
|
// 设置订舱列表
|
|
|
|
setBookingList({ commit }, obj) {
|
|
|
|
setBookingList({ commit }, obj) {
|
|
|
|