diff --git a/src/apis/system/type.ts b/src/apis/system/type.ts
index 3c0f665b9bf43c7818360f366f84d0180b04c277..fc7c65214f2f5abdcd9d7edfa829e894f5e5917e 100644
--- a/src/apis/system/type.ts
+++ b/src/apis/system/type.ts
@@ -295,12 +295,17 @@ export interface ClientResp {
activeTimeout: string
timeout: string
status: string
+ isConcurrent: boolean
+ maxLoginCount: number
+ replacedRange: string
+ overflowLogoutMode: string
createUser: string
createTime: string
updateUser: string
updateTime: string
createUserString: string
updateUserString: string
+ disabled: boolean
}
export interface ClientDetailResp {
id: string
@@ -309,7 +314,11 @@ export interface ClientDetailResp {
authType: string
activeTimeout: string
timeout: string
- status: string
+ status: number
+ isConcurrent: boolean
+ maxLoginCount: number
+ replacedRange: string
+ overflowLogoutMode: string
createUser: string
createTime: string
updateUser: string
diff --git a/src/layout/LayoutMix.vue b/src/layout/LayoutMix.vue
index 357f439cb373e6ca9a35a83bd90b04f91fdb0ff7..f5d32b7cb985c52ce5f4f49b6102eb9fa1a4c85c 100644
--- a/src/layout/LayoutMix.vue
+++ b/src/layout/LayoutMix.vue
@@ -10,7 +10,7 @@
:style="appStore.menuDark ? appStore.themeCSSVar : undefined"
>
-
+
@@ -83,7 +83,6 @@ const checkAndShowNotices = () => {
// 如果有token,检查未读公告
if (token) {
setTimeout(() => {
- console.log(noticePopupRef.value)
noticePopupRef.value?.open()
}, 1000) // 延迟1秒显示,让页面先加载完成
}
diff --git a/src/views/system/config/client/AddModal.vue b/src/views/system/config/client/AddModal.vue
index 901c6ce6db60c9a57b07df0a2ba24d900c9098cb..23bf5a41d7a9ea8253f64aeae83675bfd1f53e4d 100644
--- a/src/views/system/config/client/AddModal.vue
+++ b/src/views/system/config/client/AddModal.vue
@@ -32,16 +32,32 @@ const visible = ref(false)
const isUpdate = computed(() => !!dataId.value)
const title = computed(() => (isUpdate.value ? '修改客户端' : '新增客户端'))
const formRef = ref>()
-const { client_type, auth_type_enum } = useDict('auth_type_enum', 'client_type')
+const { client_type, auth_type_enum, replaced_range_enum, logout_mode_enum } = useDict('auth_type_enum', 'client_type', 'replaced_range_enum', 'logout_mode_enum')
const [form, resetForm] = useResetReactive({
activeTimeout: 1800,
timeout: 86400,
- isConcurrent: 1,
- isShare: 1,
+ isConcurrent: true,
+ maxLoginCount: -1,
+ replacedRange: 'ALL_DEVICE_TYPE',
+ overflowLogoutMode: 'KICKOUT',
status: 1,
})
+// 监听 isConcurrent 的变化,处理字段互斥逻辑
+watch(
+ () => form.isConcurrent,
+ (newVal) => {
+ if (!newVal) {
+ form.maxLoginCount = -1
+ // replacedRange 只有在 isConcurrent=false 时才有意义
+ } else if (newVal) {
+ // 当 isConcurrent=true 时,清空 maxLoginCount
+ form.maxLoginCount = -1
+ }
+ },
+)
+
const columns: ColumnItem[] = reactive([
{
label: '客户端类型',
@@ -87,7 +103,7 @@ const columns: ColumnItem[] = reactive([
{
label: () => (
- Token 有效期
+ Token 有效期
),
@@ -104,6 +120,75 @@ const columns: ColumnItem[] = reactive([
},
rules: [{ required: true, message: '请输入 Token 有效期' }],
},
+ {
+ label: '是否允许同一账号多地同时登录',
+ field: 'isConcurrent',
+ type: 'switch',
+ span: 12,
+ props: {
+ type: 'round',
+ checkedValue: true,
+ uncheckedValue: false,
+ checkedText: '允许',
+ uncheckedText: '不允许',
+ },
+ },
+ {
+ label: () => (
+
+ 最大登录数量
+
+
+ ),
+ field: 'maxLoginCount',
+ type: 'input-number',
+ span: 12,
+ slots: {
+ append: () => (
+ 个
+ ),
+ },
+ props: {
+ placeholder: '请输入最大登录数量',
+ min: -1,
+ },
+ disabled: () => {
+ return !form.isConcurrent
+ },
+ rules: [
+ {
+ validator: (value: number, callback: (errorMessage?: string) => void) => {
+ if (value === 0) {
+ callback('最大登录数量不能为0,请输入-1或正整数')
+ }
+ callback()
+ },
+ },
+ ],
+ },
+ {
+ label: '顶人下线的范围',
+ field: 'replacedRange',
+ type: 'select',
+ span: 12,
+ props: {
+ options: replaced_range_enum,
+ placeholder: '请选择顶人下线的范围',
+ },
+ disabled: () => {
+ return form.isConcurrent
+ },
+ },
+ {
+ label: '溢出人数的注销方式',
+ field: 'overflowLogoutMode',
+ type: 'select',
+ span: 12,
+ props: {
+ options: logout_mode_enum,
+ placeholder: '请选择溢出人数的注销方式',
+ },
+ },
{
label: '状态',
field: 'status',
diff --git a/src/views/system/config/client/DetailDrawer.vue b/src/views/system/config/client/DetailDrawer.vue
index f915e50f3e4a5781b343573a001076038154ca55..889ded9af4d2ac4835c48ececd2591886529f82d 100644
--- a/src/views/system/config/client/DetailDrawer.vue
+++ b/src/views/system/config/client/DetailDrawer.vue
@@ -17,6 +17,19 @@
启用
禁用
+
+ 允许
+ 不允许
+
+
+ {{ dataDetail?.maxLoginCount === -1 ? '不限' : dataDetail?.maxLoginCount }}
+
+
+
+
+
+
+
{{ dataDetail?.createUserString }}
{{ dataDetail?.createTime }}
{{ dataDetail?.updateUserString }}
@@ -29,11 +42,14 @@
import { useWindowSize } from '@vueuse/core'
import { type ClientDetailResp, getClient as getDetail } from '@/apis/system/client'
import { useDict } from '@/hooks/app'
+import GiCellTag from '@/components/GiCell/GiCellTag.vue'
const {
client_type,
auth_type_enum,
-} = useDict('client_type', 'auth_type_enum')
+ replaced_range_enum,
+ logout_mode_enum,
+} = useDict('client_type', 'auth_type_enum', 'replaced_range_enum', 'logout_mode_enum')
const { width } = useWindowSize()
diff --git a/src/views/system/config/client/index.vue b/src/views/system/config/client/index.vue
index e37db582511c807c5cbf7a182550fb684b8f1626..0e2b59fc7aa20ba263e2c675e221d9effccfbff1 100644
--- a/src/views/system/config/client/index.vue
+++ b/src/views/system/config/client/index.vue
@@ -60,7 +60,7 @@