Browse Source

fix(users): 修复用户锁定显示不正确的问题

pull/768/head
cKey 3 years ago
parent
commit
257318c0fd
  1. 2
      apps/vue/src/views/identity/user/components/UserTable.vue
  2. 15
      apps/vue/src/views/identity/user/hooks/useUserTable.ts

2
apps/vue/src/views/identity/user/components/UserTable.vue

@ -12,7 +12,7 @@
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'userName'">
<span>{{ record.userName }}</span>
<Tag v-if="!lockEnable(record)" style="margin-left: 5px" color="orange">{{ L('Lockout') }}</Tag>
<Tag v-if="lockEnable(record)" style="margin-left: 5px" color="orange">{{ L('Lockout') }}</Tag>
<Tag v-if="!record.isActive" style="margin-left: 5px" color="red">{{ L('UnActived') }}</Tag>
</template>
<template v-if="column.key === 'phoneNumber'">

15
apps/vue/src/views/identity/user/hooks/useUserTable.ts

@ -36,18 +36,15 @@ export function useUserTable() {
const lockEnable = computed(() => {
return (record) => {
// 未启用锁定不显示
if (!record.lockoutEnabled) {
return false;
}
if (record.lockoutEnd) {
// 锁定时间高于当前时间不显示
if (record.lockoutEnabled === true) {
const lockTime = new Date(record.lockoutEnd);
const nowTime = new Date();
if (lockTime > nowTime) {
return false;
if (lockTime) {
// 锁定时间高于当前时间不显示
const nowTime = new Date();
return lockTime > nowTime;
}
}
return true;
return false;
};
});

Loading…
Cancel
Save