优化
This commit is contained in:
parent
0917d7f5f8
commit
fcd14680f0
@ -79,6 +79,7 @@ export default {
|
|||||||
console.log('获取用户信息res: ', res)
|
console.log('获取用户信息res: ', res)
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.SET_USER_INFO(res.user)
|
this.SET_USER_INFO(res.user)
|
||||||
|
this.SET_USER_AUTH(res.data)
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.msg0)
|
this.$message.error(res.msg0)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
:class="{active:title.includes(i.name)}"
|
:class="{active:title.includes(i.name)}"
|
||||||
@click="handleToRouter(i.name)"
|
@click="handleToRouter(i.name)"
|
||||||
>
|
>
|
||||||
{{i.meta.title}}</li>
|
<span v-if="auth[i.name]">{{i.meta.title}}</span></li>
|
||||||
</ul>
|
</ul>
|
||||||
<nav-header v-if="!isNav"/>
|
<nav-header v-if="!isNav"/>
|
||||||
</transition>
|
</transition>
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
import { getDepList } from '@/api/report'
|
import { getDepList } from '@/api/report'
|
||||||
|
import * as dd from 'dingtalk-jsapi'
|
||||||
|
import { apiDingtalkLogin, apiUserInfo } from '@/api/login'
|
||||||
const user = {
|
const user = {
|
||||||
state: {
|
state: {
|
||||||
deplist: [],
|
deplist: [],
|
||||||
@ -18,8 +20,26 @@ const user = {
|
|||||||
SET_DEPLIST: (state, list = []) => {
|
SET_DEPLIST: (state, list = []) => {
|
||||||
state.deplist = list
|
state.deplist = list
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
GET_USERINFO: async ({ commit }) => {
|
||||||
|
let res = await apiUserInfo()
|
||||||
|
console.log('获取用户信息res: ', res)
|
||||||
|
if (res.code === 200) {
|
||||||
|
commit('SET_USER_INFO', res.user)
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg0)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
GET_PERMISSIONS: ({ commit }) => {
|
||||||
|
getDepList({type: 1}).then(response => {
|
||||||
|
const data = response.code === 200 ? response.data : []
|
||||||
|
commit('SET_USER_AUTH', data)
|
||||||
|
}).catch(error => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
},
|
||||||
GET_DEPLIST: ({ commit }) => {
|
GET_DEPLIST: ({ commit }) => {
|
||||||
getDepList({type: 1}).then(response => {
|
getDepList({type: 1}).then(response => {
|
||||||
const data = response.code === 200 ? response.data : []
|
const data = response.code === 200 ? response.data : []
|
||||||
|
|||||||
@ -574,6 +574,7 @@ export default {
|
|||||||
console.log('编辑-----=====', row)
|
console.log('编辑-----=====', row)
|
||||||
apiSetPermissionsRoleDetail({ id: row.id }).then(res => {
|
apiSetPermissionsRoleDetail({ id: row.id }).then(res => {
|
||||||
if (res.code !== 200) {
|
if (res.code !== 200) {
|
||||||
|
this.$message.error(res.msg)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.showPopupAddSub = true
|
this.showPopupAddSub = true
|
||||||
@ -630,6 +631,8 @@ export default {
|
|||||||
}) // 刷新页面信息
|
}) // 刷新页面信息
|
||||||
this.rqInfoParameter.currPage = 1
|
this.rqInfoParameter.currPage = 1
|
||||||
this.handleGetSetPageInfo()
|
this.handleGetSetPageInfo()
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}).catch(_ => {
|
}).catch(_ => {
|
||||||
@ -673,6 +676,8 @@ export default {
|
|||||||
this.showPopupAddSub = false
|
this.showPopupAddSub = false
|
||||||
// 管理员权限 修改成功
|
// 管理员权限 修改成功
|
||||||
this.handleGetSetPageInfo()
|
this.handleGetSetPageInfo()
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,12 +48,12 @@ export default {
|
|||||||
let res = await apiLogin(params)
|
let res = await apiLogin(params)
|
||||||
console.log('res: ', res)
|
console.log('res: ', res)
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.SET_USER_AUTH(res.data)
|
|
||||||
this.token = res.token
|
this.token = res.token
|
||||||
this.$cookies.set('token', res.token, res.expire)
|
this.$cookies.set('token', res.token, res.expire)
|
||||||
let ress = await apiUserInfo()
|
let ress = await apiUserInfo()
|
||||||
if (ress.code === 200) {
|
if (ress.code === 200) {
|
||||||
this.SET_USER_INFO(ress.user)
|
this.SET_USER_INFO(ress.user)
|
||||||
|
this.SET_USER_AUTH(ress.data)
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(ress.msg0)
|
this.$message.error(ress.msg0)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user