fix(system-admin): 统一 isAdmin 类型为布尔值
- 修复 admin/index.vue 中 isAdmin 的类型不一致问题 - 修改模板中判断逻辑,将 record.isAdmin == 1 改为 record.isAdmin - 调整 updateIsAdmin 函数,改为取反布尔值方式赋值 - 使用 vue-tsc --noEmit 验证确认无新增类型错误 - 清理了自引入未使用变量的 TS6133 警告
This commit is contained in:
@@ -75,7 +75,7 @@
|
||||
</template>
|
||||
<template v-if="column.key === 'isAdmin'">
|
||||
<a-switch
|
||||
:checked="record.isAdmin == 1"
|
||||
:checked="record.isAdmin"
|
||||
@change="updateIsAdmin(record)"
|
||||
/>
|
||||
</template>
|
||||
@@ -389,7 +389,7 @@
|
||||
|
||||
/* 修改用户状态 */
|
||||
const updateIsAdmin = (row: User) => {
|
||||
row.isAdmin = row.isAdmin ? 0 : 1;
|
||||
row.isAdmin = !row.isAdmin;
|
||||
updateUser(row)
|
||||
.then((msg) => {
|
||||
message.success(msg);
|
||||
|
||||
Reference in New Issue
Block a user