mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-25 22:36:23 +00:00
fix: 修复组织名称更新列表未刷新的问题
This commit is contained in:
@@ -37,6 +37,16 @@ const mutations = {
|
|||||||
SET_ORGS: (state, orgs) => {
|
SET_ORGS: (state, orgs) => {
|
||||||
state.orgs = orgs
|
state.orgs = orgs
|
||||||
},
|
},
|
||||||
|
MODIFY_ORG: (state, org) => {
|
||||||
|
console.log(state.orgs)
|
||||||
|
state.orgs = state.orgs.map(oldOrg => {
|
||||||
|
if (oldOrg.id === org.id) {
|
||||||
|
oldOrg.name = org.name
|
||||||
|
}
|
||||||
|
return oldOrg
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
ADD_ORG: (state, org) => {
|
ADD_ORG: (state, org) => {
|
||||||
state.orgs.push(org)
|
state.orgs.push(org)
|
||||||
},
|
},
|
||||||
@@ -125,6 +135,9 @@ const actions = {
|
|||||||
addAdminOrg({ commit, state }, org) {
|
addAdminOrg({ commit, state }, org) {
|
||||||
commit('ADD_ORG', org)
|
commit('ADD_ORG', org)
|
||||||
},
|
},
|
||||||
|
modifyOrg({ commit, state }, org) {
|
||||||
|
commit('MODIFY_ORG', org)
|
||||||
|
},
|
||||||
// user logout
|
// user logout
|
||||||
logout({ commit, state }) {
|
logout({ commit, state }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
Reference in New Issue
Block a user