mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 20:39:48 +08:00
Co-authored-by: EdwinBetanc0urt <EdwinBetanco0urt@outlook.com>
This commit is contained in:
parent
cfc744a62c
commit
822b909e8f
@ -107,13 +107,6 @@ const actions = {
|
|||||||
token
|
token
|
||||||
}) {
|
}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
console.log({
|
|
||||||
userName,
|
|
||||||
password,
|
|
||||||
roleUuid,
|
|
||||||
organizationUuid,
|
|
||||||
token
|
|
||||||
})
|
|
||||||
login({
|
login({
|
||||||
userName,
|
userName,
|
||||||
password,
|
password,
|
||||||
@ -137,6 +130,7 @@ const actions = {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get session info
|
* Get session info
|
||||||
* @param {string} sessionUuid as token
|
* @param {string} sessionUuid as token
|
||||||
@ -209,6 +203,7 @@ const actions = {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get user info
|
* Get user info
|
||||||
* @param {string} sessionUuid as token
|
* @param {string} sessionUuid as token
|
||||||
@ -251,6 +246,7 @@ const actions = {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// user logout
|
// user logout
|
||||||
logout({ commit, state, dispatch }) {
|
logout({ commit, state, dispatch }) {
|
||||||
const token = state.token
|
const token = state.token
|
||||||
@ -280,6 +276,7 @@ const actions = {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// remove token
|
// remove token
|
||||||
resetToken({ commit }) {
|
resetToken({ commit }) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
@ -289,6 +286,7 @@ const actions = {
|
|||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
getRolesListFromServer({ commit }, sessionUuid = null) {
|
getRolesListFromServer({ commit }, sessionUuid = null) {
|
||||||
if (isEmptyValue(sessionUuid)) {
|
if (isEmptyValue(sessionUuid)) {
|
||||||
sessionUuid = getToken()
|
sessionUuid = getToken()
|
||||||
@ -334,6 +332,7 @@ const actions = {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
getOrganizationsListFromServer({ commit, dispatch }, roleUuid) {
|
getOrganizationsListFromServer({ commit, dispatch }, roleUuid) {
|
||||||
if (isEmptyValue(roleUuid)) {
|
if (isEmptyValue(roleUuid)) {
|
||||||
roleUuid = getCurrentRole()
|
roleUuid = getCurrentRole()
|
||||||
@ -369,6 +368,7 @@ const actions = {
|
|||||||
console.warn(`Error ${error.code} getting Organizations list: ${error.message}.`)
|
console.warn(`Error ${error.code} getting Organizations list: ${error.message}.`)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
changeOrganization({ commit, dispatch, getters }, {
|
changeOrganization({ commit, dispatch, getters }, {
|
||||||
organizationUuid,
|
organizationUuid,
|
||||||
organizationId,
|
organizationId,
|
||||||
@ -436,6 +436,7 @@ const actions = {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
getWarehousesList({ commit }, organizationUuid) {
|
getWarehousesList({ commit }, organizationUuid) {
|
||||||
if (isEmptyValue(organizationUuid)) {
|
if (isEmptyValue(organizationUuid)) {
|
||||||
organizationUuid = getCurrentOrganization()
|
organizationUuid = getCurrentOrganization()
|
||||||
@ -469,6 +470,7 @@ const actions = {
|
|||||||
console.warn(`Error ${error.code} getting Warehouses list: ${error.message}.`)
|
console.warn(`Error ${error.code} getting Warehouses list: ${error.message}.`)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
changeWarehouse({ commit, state }, {
|
changeWarehouse({ commit, state }, {
|
||||||
warehouseUuid
|
warehouseUuid
|
||||||
}) {
|
}) {
|
||||||
@ -484,6 +486,7 @@ const actions = {
|
|||||||
root: true
|
root: true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// dynamically modify permissions
|
// dynamically modify permissions
|
||||||
changeRole({ commit, dispatch }, {
|
changeRole({ commit, dispatch }, {
|
||||||
roleUuid,
|
roleUuid,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user