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