fix:总部文件控权
This commit is contained in:
parent
9bd2887580
commit
b7bcd04a12
File diff suppressed because one or more lines are too long
|
@ -42,3 +42,9 @@ export function deleteOrg(id) {
|
|||
method: 'delete'
|
||||
})
|
||||
}
|
||||
export function getOrgItem(id) {
|
||||
return request({
|
||||
url: `/system/organization/${id}/`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { login, logout, getInfo, login2, fulllogin } from '@/api/user'
|
||||
import { getToken, setToken, removeToken } from '@/utils/auth'
|
||||
import { getOrgItem} from "@/api/org";
|
||||
import { resetRouter } from '@/router'
|
||||
|
||||
const getDefaultState = () => {
|
||||
|
@ -68,7 +69,6 @@ const actions = {
|
|||
}
|
||||
|
||||
const { perms, name, avatar } = data.user
|
||||
|
||||
// perms must be a non-empty array
|
||||
if (!perms || perms.length <= 0) {
|
||||
reject('没有任何权限!')
|
||||
|
@ -104,23 +104,26 @@ const actions = {
|
|||
return new Promise((resolve, reject) => {
|
||||
getInfo(state.token).then(response => {
|
||||
const { data } = response
|
||||
|
||||
if (!data) {
|
||||
reject('验证失败,重新登陆.')
|
||||
}
|
||||
|
||||
const { perms, name, avatar, dept, dept_name} = data
|
||||
|
||||
const { perms, name, avatar, dept, dept_name} = data;
|
||||
// perms must be a non-empty array
|
||||
if (!perms || perms.length <= 0) {
|
||||
reject('没有任何权限!')
|
||||
}
|
||||
|
||||
commit('SET_PERMS', perms)
|
||||
commit('SET_NAME', name)
|
||||
commit('SET_AVATAR', avatar)
|
||||
commit('SET_DEPT', dept)
|
||||
commit('SET_DEPTNAME', dept_name)
|
||||
if (!perms || perms.length <= 0) {
|
||||
reject('没有任何权限!')
|
||||
}else{
|
||||
if(dept==5||dept==33||dept==34||dept==55||dept==36||dept==37||dept==38
|
||||
||dept==39||dept==40||dept==41||dept==42||dept==67||dept==97){
|
||||
perms.push('test')
|
||||
commit('SET_PERMS', perms);
|
||||
}else{
|
||||
commit('SET_PERMS', perms);
|
||||
}
|
||||
}
|
||||
resolve(data)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
|
|
Loading…
Reference in New Issue