8000 Dev by github-learning · Pull Request #10 · github-learning/vue3-admin · GitHub
[go: up one dir, main page]

Skip to content

Dev #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 16, 2024
Merged

Dev #10

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/apis/roleAccess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { Api } from './type'

export interface IRoleAccess {
id: number
access_id: number
role_id: number
accessId: number
roleId: number
}

export type IRoleAccessList = IRoleAccess[]
Expand Down
11 changes: 8 additions & 3 deletions src/views/system/role/components/roleMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const handleSubmit = async () => {
const selectKeys = [...keys, ...halfKeys]

const res = await allocRoleAccess(role.id, selectKeys as number[])
if (res.code === 0) {
if (res.code === 200) {
proxy?.$message.success('权限分配成功')
reloadPage()
}
Expand Down Expand Up @@ -86,8 +86,13 @@ watch(
const getRoleAccessList = async () => {
checkStrictly.value = true // 先解除关系
const res = await getRoleAccess(role.id)
if (res.code === 0) {
const access = res.data.map((item) => item.access_id)
if (res.code === 200) {
console.log(
'%c [ ]-91',
'font-size:13px; background:pink; color:#bf2c9f;',
res
)
const access = res.data.map((item) => item.accessId)
menuTree.value?.setCheckedKeys(access)
setTimeout(() => {
checkStrictly.value = false
Expand Down
0