perf: 优化权限分配问题

This commit is contained in:
jmal 2024-03-11 11:50:12 +08:00
parent a92330f7d1
commit 5cae241ccc
4 changed files with 12 additions and 10 deletions

View File

@ -47,6 +47,14 @@ export function testLdapConfig(data) {
}
export function getInfo(params) {
return request({
url: 'user/info',
method: 'get',
params
})
}
export function getUserInfo(params) {
return request({
url: 'user/userInfo',
method: 'get',

View File

@ -141,10 +141,7 @@ const actions = {
// get user info
getInfo({ commit, state }) {
return new Promise((resolve, reject) => {
getInfo({
id: state.userId,
token: state.token
}).then(response => {
getInfo().then(response => {
const { data } = response
if (!data) {
// reject('Verification failed, please Login again.')

View File

@ -172,10 +172,7 @@
}
},
getInfo(){
getInfo({
id: this.$store.state.user.userId,
takeUpSpace: true,
}).then(async res => {
getInfo().then(async res => {
this.userInfo = res.data
if (this.userInfo.roles && this.userInfo.roles.includes('admin')) {
this.$emit('isAdmin', true)

View File

@ -82,7 +82,7 @@
</template>
<script>
import {addUser, delUser, getInfo, resetPass, userList, userUpdate} from '@/api/user'
import {addUser, delUser, getUserInfo, resetPass, userList, userUpdate} from '@/api/user'
import roleApi from '@/api/role'
import CropperDialog from '@/components/Cropper/dialog'
import TableList from "@/components/table/TableList";
@ -269,7 +269,7 @@ export default {
this.editMove = 2
this.dialogVisible = true
this.dialogTitle = '修改用户'
getInfo({
getUserInfo({
id: id,
}).then(res => {
this.form = res.data