refactor: oauth2 vxe

pull/2/head
xingyu4j 2022-11-13 14:40:51 +08:00
parent bdc988e5b7
commit 7250e23df3
9 changed files with 348 additions and 436 deletions

View File

@ -1,5 +1,24 @@
import request from '@/config/axios' import request from '@/config/axios'
import { OAuth2ClientVo } from './client.types' export interface OAuth2ClientVO {
id: number
clientId: string
secret: string
name: string
logo: string
description: string
status: number
accessTokenValiditySeconds: number
refreshTokenValiditySeconds: number
redirectUris: string[]
autoApprove: boolean
authorizedGrantTypes: string[]
scopes: string[]
authorities: string[]
resourceIds: string[]
additionalInformation: string
isAdditionalInformationJson: boolean
createTime: string
}
// 查询 OAuth2列表 // 查询 OAuth2列表
export const getOAuth2ClientPageApi = (params) => { export const getOAuth2ClientPageApi = (params) => {
@ -12,12 +31,12 @@ export const getOAuth2ClientApi = (id: number) => {
} }
// 新增 OAuth2 // 新增 OAuth2
export const createOAuth2ClientApi = (data: OAuth2ClientVo) => { export const createOAuth2ClientApi = (data: OAuth2ClientVO) => {
return request.post({ url: '/system/oauth2-client/create', data }) return request.post({ url: '/system/oauth2-client/create', data })
} }
// 修改 OAuth2 // 修改 OAuth2
export const updateOAuth2ClientApi = (data: OAuth2ClientVo) => { export const updateOAuth2ClientApi = (data: OAuth2ClientVO) => {
return request.put({ url: '/system/oauth2-client/update', data }) return request.put({ url: '/system/oauth2-client/update', data })
} }

View File

@ -1,20 +0,0 @@
export type OAuth2ClientVo = {
id: number
clientId: string
secret: string
name: string
logo: string
description: string
status: number
accessTokenValiditySeconds: number
refreshTokenValiditySeconds: number
redirectUris: string[]
autoApprove: boolean
authorizedGrantTypes: string[]
scopes: string[]
authorities: string[]
resourceIds: string[]
additionalInformation: string
isAdditionalInformationJson: boolean
createTime: string
}

View File

@ -1,7 +1,24 @@
import request from '@/config/axios' import request from '@/config/axios'
export interface OAuth2TokenVO {
id: number
accessToken: string
refreshToken: string
userId: number
userType: number
clientId: string
createTime: string
expiresTime: string
}
export interface OAuth2TokenPageReqVO extends BasePage {
code?: string
name?: string
status?: number
}
// 查询 token列表 // 查询 token列表
export const getAccessTokenPageApi = (params) => { export const getAccessTokenPageApi = (params: OAuth2TokenPageReqVO) => {
return request.get({ url: '/system/oauth2-token/page', params }) return request.get({ url: '/system/oauth2-token/page', params })
} }

View File

@ -1,10 +0,0 @@
export type OAuth2TokenVo = {
id: number
accessToken: string
refreshToken: string
userId: number
userType: number
clientId: string
createTime: string
expiresTime: string
}

View File

@ -45,13 +45,13 @@ export const useVxeGrid = <T = any>(config?: UseVxeGridConfig<T>) => {
isHover: true // 当鼠标移到行时,是否要高亮当前行 isHover: true // 当鼠标移到行时,是否要高亮当前行
}, },
toolbarConfig: { toolbarConfig: {
custom: true,
slots: { buttons: 'toolbar_buttons' } slots: { buttons: 'toolbar_buttons' }
}, },
printConfig: { printConfig: {
columns: config?.allSchemas.printSchema columns: config?.allSchemas.printSchema
}, },
formConfig: { formConfig: {
enabled: true,
titleWidth: 100, titleWidth: 100,
titleAlign: 'right', titleAlign: 'right',
items: config?.allSchemas.searchSchema items: config?.allSchemas.searchSchema
@ -120,6 +120,7 @@ export const useVxeGrid = <T = any>(config?: UseVxeGridConfig<T>) => {
}) })
}) })
} }
return { return {
gridOptions, gridOptions,
delList delList

View File

@ -1,10 +1,9 @@
import { reactive } from 'vue' import { reactive } from 'vue'
import { useI18n } from '@/hooks/web/useI18n' import { useI18n } from '@/hooks/web/useI18n'
import { required } from '@/utils/formRules' import { required } from '@/utils/formRules'
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
import { DICT_TYPE } from '@/utils/dict' import { DICT_TYPE } from '@/utils/dict'
const { t } = useI18n() import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
// 国际化 const { t } = useI18n() // 国际化
// 表单校验 // 表单校验
export const rules = reactive({ export const rules = reactive({
@ -20,122 +19,92 @@ export const rules = reactive({
}) })
// CrudSchema // CrudSchema
const crudSchemas = reactive<CrudSchema[]>([ const crudSchemas = reactive<VxeCrudSchema>({
{ primaryKey: 'clientId',
label: '客户端编号', primaryType: 'seq',
field: 'clientId', action: true,
form: { columns: [
show: false {
title: '客户端密钥',
field: 'secret'
}, },
detail: { {
show: false title: '应用名',
} field: 'name',
}, isSearch: true
{
label: '客户端密钥',
field: 'secret'
},
{
label: '应用名',
field: 'name',
search: {
show: true
}
},
{
label: '应用图标',
field: 'logo'
},
{
label: t('common.status'),
field: 'status',
dictType: DICT_TYPE.COMMON_STATUS,
search: {
show: true
}
},
{
label: '访问令牌的有效期',
field: 'accessTokenValiditySeconds'
},
{
label: '刷新令牌的有效期',
field: 'refreshTokenValiditySeconds'
},
{
label: '授权类型',
field: 'authorizedGrantTypes',
dictType: DICT_TYPE.SYSTEM_OAUTH2_GRANT_TYPE
},
{
label: '授权范围',
field: 'scopes',
table: {
show: false
}
},
{
label: '自动授权范围',
field: 'autoApproveScopes',
table: {
show: false
}
},
{
label: '可重定向的 URI 地址',
field: 'redirectUris',
table: {
show: false
}
},
{
label: '权限',
field: 'authorities',
table: {
show: false
}
},
{
label: '资源',
field: 'resourceIds',
table: {
show: false
}
},
{
label: '附加信息',
field: 'additionalInformation',
table: {
show: false
}, },
form: { {
component: 'Input', title: '应用图标',
componentProps: { field: 'logo'
type: 'textarea', },
rows: 4 {
}, title: t('common.status'),
colProps: { field: 'status',
span: 24 dictType: DICT_TYPE.COMMON_STATUS,
isSearch: true
},
{
title: '访问令牌的有效期',
field: 'accessTokenValiditySeconds'
},
{
title: '刷新令牌的有效期',
field: 'refreshTokenValiditySeconds'
},
{
title: '授权类型',
field: 'authorizedGrantTypes',
dictType: DICT_TYPE.SYSTEM_OAUTH2_GRANT_TYPE,
form: {
component: 'Select'
} }
}
},
{
label: t('common.createTime'),
field: 'createTime',
form: {
show: false
}
},
{
label: t('table.action'),
field: 'action',
width: '240px',
form: {
show: false
}, },
detail: { {
show: false title: '授权范围',
field: 'scopes',
isTable: false
},
{
title: '自动授权范围',
field: 'autoApproveScopes',
isTable: false
},
{
title: '可重定向的 URI 地址',
field: 'redirectUris',
isTable: false
},
{
title: '权限',
field: 'authorities',
isTable: false
},
{
title: '资源',
field: 'resourceIds',
isTable: false
},
{
title: '附加信息',
field: 'additionalInformation',
isTable: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
rows: 4
},
colProps: {
span: 24
}
}
},
{
title: t('common.createTime'),
field: 'createTime',
formatter: 'formatDate',
isForm: false
} }
} ]
]) })
export const { allSchemas } = useCrudSchemas(crudSchemas) export const { allSchemas } = useVxeCrudSchemas(crudSchemas)

View File

@ -1,29 +1,112 @@
<template>
<ContentWrap>
<!-- 列表 -->
<vxe-grid ref="xGrid" v-bind="gridOptions" class="xtable-scrollbar">
<!-- 操作新增 -->
<template #toolbar_buttons>
<XButton
type="primary"
preIcon="ep:zoom-in"
:title="t('action.add')"
v-hasPermi="['system:oauth2-client:create']"
@click="handleCreate()"
/>
</template>
<template #authorizedGrantTypes="{ row }">
<el-tag
:disable-transitions="true"
:key="index"
v-for="(authorizedGrantType, index) in row.authorizedGrantTypes"
:index="index"
>
{{ authorizedGrantType }}
</el-tag>
</template>
<template #actionbtns_default="{ row }">
<!-- 操作修改 -->
<XTextButton
preIcon="ep:edit"
:title="t('action.edit')"
v-hasPermi="['system:oauth2-client:update']"
@click="handleUpdate(row.id)"
/>
<!-- 操作详情 -->
<XTextButton
preIcon="ep:view"
:title="t('action.detail')"
v-hasPermi="['system:oauth2-client:update']"
@click="handleDetail(row.id)"
/>
<!-- 操作删除 -->
<XTextButton
preIcon="ep:delete"
:title="t('action.del')"
v-hasPermi="['system:oauth2-client:delete']"
@click="handleDelete(row.id)"
/>
</template>
</vxe-grid>
</ContentWrap>
<!-- 弹窗 -->
<XModal id="postModel" v-model="dialogVisible" :title="dialogTitle">
<template #default>
<!-- 表单添加/修改 -->
<Form
ref="formRef"
v-if="['create', 'update'].includes(actionType)"
:schema="allSchemas.formSchema"
:rules="rules"
/>
<!-- 表单详情 -->
<Descriptions
v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema"
:data="detailRef"
/>
</template>
<template #footer>
<!-- 按钮保存 -->
<XButton
v-if="['create', 'update'].includes(actionType)"
type="primary"
:title="t('action.save')"
:loading="actionLoading"
@click="submitForm"
/>
<!-- 按钮关闭 -->
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
</template>
</XModal>
</template>
<script setup lang="ts"> <script setup lang="ts">
// import
import { ref, unref } from 'vue' import { ref, unref } from 'vue'
import dayjs from 'dayjs' import { ElTag } from 'element-plus'
import { ElMessage, ElImage, ElTag } from 'element-plus'
import { DICT_TYPE } from '@/utils/dict'
import { useTable } from '@/hooks/web/useTable'
import { useI18n } from '@/hooks/web/useI18n' import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useVxeGrid } from '@/hooks/web/useVxeGrid'
import { VxeGridInstance } from 'vxe-table'
import { FormExpose } from '@/components/Form' import { FormExpose } from '@/components/Form'
import type { OAuth2ClientVo } from '@/api/system/oauth2/client.types' // import
import { rules, allSchemas } from './client.data'
import * as ClientApi from '@/api/system/oauth2/client' import * as ClientApi from '@/api/system/oauth2/client'
import { rules, allSchemas } from './client.data'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() //
// ========== ========== //
const { register, tableObject, methods } = useTable<OAuth2ClientVo>({ const xGrid = ref<VxeGridInstance>() // Grid Ref
getListApi: ClientApi.getOAuth2ClientPageApi, const { gridOptions } = useVxeGrid<ClientApi.OAuth2ClientVO>({
delListApi: ClientApi.deleteOAuth2ClientApi allSchemas: allSchemas,
getListApi: ClientApi.getOAuth2ClientPageApi
}) })
const { getList, setSearchParams, delList } = methods //
// ========== CRUD ==========
const actionLoading = ref(false) //
const actionType = ref('') //
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref('edit') // const dialogTitle = ref('edit') //
const actionType = ref('') //
const actionLoading = ref(false) // Loading
const formRef = ref<FormExpose>() // Ref const formRef = ref<FormExpose>() // Ref
const detailRef = ref() // Ref
// //
const setDialogTile = (type: string) => { const setDialogTile = (type: string) => {
@ -40,14 +123,35 @@ const handleCreate = () => {
} }
// //
const handleUpdate = async (row: OAuth2ClientVo) => { const handleUpdate = async (rowId: number) => {
setDialogTile('update') setDialogTile('update')
// //
const res = await ClientApi.getOAuth2ClientApi(row.id) const res = await ClientApi.getOAuth2ClientApi(rowId)
unref(formRef)?.setValues(res) unref(formRef)?.setValues(res)
} }
// //
const handleDetail = async (rowId: number) => {
setDialogTile('detail')
const res = await ClientApi.getOAuth2ClientApi(rowId)
detailRef.value = res
}
//
const handleDelete = async (rowId: number) => {
message
.delConfirm()
.then(async () => {
await ClientApi.deleteOAuth2ClientApi(rowId)
message.success(t('common.delSuccess'))
})
.finally(() => {
//
xGrid.value?.commitProxy('query')
})
}
// /
const submitForm = async () => { const submitForm = async () => {
const elForm = unref(formRef)?.getElFormRef() const elForm = unref(formRef)?.getElFormRef()
if (!elForm) return if (!elForm) return
@ -56,143 +160,21 @@ const submitForm = async () => {
actionLoading.value = true actionLoading.value = true
// //
try { try {
const data = unref(formRef)?.formModel as OAuth2ClientVo const data = unref(formRef)?.formModel as ClientApi.OAuth2ClientVO
if (actionType.value === 'create') { if (actionType.value === 'create') {
await ClientApi.createOAuth2ClientApi(data) await ClientApi.createOAuth2ClientApi(data)
ElMessage.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await ClientApi.updateOAuth2ClientApi(data) await ClientApi.updateOAuth2ClientApi(data)
ElMessage.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
//
dialogVisible.value = false dialogVisible.value = false
await getList()
} finally { } finally {
actionLoading.value = false actionLoading.value = false
//
xGrid.value?.commitProxy('query')
} }
} }
}) })
} }
// ========== ==========
const detailRef = ref() // Ref
//
const handleDetail = async (row: OAuth2ClientVo) => {
//
detailRef.value = row
setDialogTile('detail')
}
// ========== ==========
getList()
</script> </script>
<template>
<!-- 搜索工作区 -->
<ContentWrap>
<Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<ContentWrap>
<!-- 操作工具栏 -->
<div class="mb-10px">
<el-button type="primary" v-hasPermi="['system:oauth2-client:create']" @click="handleCreate">
<Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }}
</el-button>
</div>
<!-- 列表 -->
<Table
:columns="allSchemas.tableColumns"
:selection="false"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
@register="register"
>
<template #logo="{ row }">
<el-image :src="row.logo" :preview-src-list="[row.logo]" />
</template>
<template #status="{ row }">
<DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
</template>
<template #authorizedGrantTypes="{ row }">
<el-tag
:disable-transitions="true"
:key="index"
v-for="(authorizedGrantType, index) in row.authorizedGrantTypes"
:index="index"
>
{{ authorizedGrantType }}
</el-tag>
</template>
<template #createTime="{ row }">
<span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
</template>
<template #action="{ row }">
<el-button
link
type="primary"
v-hasPermi="['system:oauth2-client:update']"
@click="handleUpdate(row)"
>
<Icon icon="ep:edit" class="mr-1px" /> {{ t('action.edit') }}
</el-button>
<el-button
link
type="primary"
v-hasPermi="['system:oauth2-client:update']"
@click="handleDetail(row)"
>
<Icon icon="ep:view" class="mr-1px" /> {{ t('action.detail') }}
</el-button>
<el-button
link
type="primary"
v-hasPermi="['system:oauth2-client:delete']"
@click="delList(row.id, false)"
>
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
</el-button>
</template>
</Table>
</ContentWrap>
<Dialog v-model="dialogVisible" :title="dialogTitle" width="60%" maxHeight="420px">
<!-- 对话框(添加 / 修改) -->
<Form
v-if="['create', 'update'].includes(actionType)"
:schema="allSchemas.formSchema"
:rules="rules"
ref="formRef"
/>
<!-- 对话框(详情) -->
<Descriptions
v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema"
:data="detailRef"
>
<template #status="{ row }">
<DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
</template>
<template #createTime="{ row }">
<span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
</template>
</Descriptions>
<!-- 操作按钮 -->
<template #footer>
<el-button
v-if="['create', 'update'].includes(actionType)"
type="primary"
:loading="actionLoading"
@click="submitForm"
>
{{ t('action.save') }}
</el-button>
<el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
</template>
</Dialog>
</template>

View File

@ -1,92 +1,69 @@
<script setup lang="ts">
import dayjs from 'dayjs'
import { useTable } from '@/hooks/web/useTable'
import { allSchemas } from './token.data'
import { DICT_TYPE } from '@/utils/dict'
import { useI18n } from '@/hooks/web/useI18n'
import type { OAuth2TokenVo } from '@/api/system/oauth2/token.types'
import * as TokenApi from '@/api/system/oauth2/token'
import { ref } from 'vue'
const { t } = useI18n() //
// ========== ==========
const { register, tableObject, methods } = useTable<OAuth2TokenVo>({
getListApi: TokenApi.getAccessTokenPageApi,
delListApi: TokenApi.deleteAccessTokenApi
})
// ========== ==========
const detailRef = ref() // Ref
const dialogVisible = ref(false) //
const dialogTitle = ref(t('action.detail')) //
const { getList, setSearchParams, delList } = methods
//
const handleDetail = (row: OAuth2TokenVo) => {
//
detailRef.value = row
dialogVisible.value = true
}
// 退
const handleForceLogout = (row: OAuth2TokenVo) => {
delList(row.id, false)
}
getList()
</script>
<template> <template>
<ContentWrap> <ContentWrap>
<Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> <!-- 列表 -->
</ContentWrap> <vxe-grid ref="xGrid" v-bind="gridOptions" class="xtable-scrollbar">
<ContentWrap> <template #actionbtns_default="{ row }">
<Table <!-- 操作详情 -->
:columns="allSchemas.tableColumns" <XTextButton preIcon="ep:view" :title="t('action.detail')" @click="handleDetail(row)" />
:selection="false" <!-- 操作删除 -->
:data="tableObject.tableList" <XTextButton
:loading="tableObject.loading" preIcon="ep:delete"
:pagination="{ :title="t('action.logout')"
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
@register="register"
>
<template #userType="{ row }">
<DictTag :type="DICT_TYPE.USER_TYPE" :value="row.userType" />
</template>
<template #createTime="{ row }">
<span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
</template>
<template #expiresTime="{ row }">
<span>{{ dayjs(row.expiresTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
</template>
<template #action="{ row }">
<el-button link type="primary" @click="handleDetail(row)">
<Icon icon="ep:view" class="mr-1px" /> {{ t('action.detail') }}
</el-button>
<el-button
link
type="primary"
v-hasPermi="['system:oauth2-token:delete']" v-hasPermi="['system:oauth2-token:delete']"
@click="handleForceLogout(row)" @click="handleForceLogout(row.id)"
> />
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.logout') }}
</el-button>
</template> </template>
</Table> </vxe-grid>
</ContentWrap> </ContentWrap>
<Dialog v-model="dialogVisible" :title="dialogTitle"> <Dialog v-model="dialogVisible" :title="dialogTitle">
<!-- 对话框(详情) --> <!-- 对话框(详情) -->
<Descriptions :schema="allSchemas.detailSchema" :data="detailRef"> <Descriptions :schema="allSchemas.detailSchema" :data="detailRef" />
<template #userType="{ row }">
<DictTag :type="DICT_TYPE.USER_TYPE" :value="row.userType" />
</template>
<template #createTime="{ row }">
<span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
</template>
<template #expiresTime="{ row }">
<span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
</template>
</Descriptions>
<!-- 操作按钮 --> <!-- 操作按钮 -->
<template #footer> <template #footer>
<el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button> <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
</template> </template>
</Dialog> </Dialog>
</template> </template>
<script setup lang="ts">
import { ref } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useVxeGrid } from '@/hooks/web/useVxeGrid'
import { VxeGridInstance } from 'vxe-table'
import { allSchemas } from './token.data'
import * as TokenApi from '@/api/system/oauth2/token'
const { t } = useI18n() //
const message = useMessage() //
//
const xGrid = ref<VxeGridInstance>() // Grid Ref
const { gridOptions } = useVxeGrid<TokenApi.OAuth2TokenVO>({
allSchemas: allSchemas,
getListApi: TokenApi.getAccessTokenPageApi
})
// ========== ==========
const detailRef = ref() // Ref
const dialogVisible = ref(false) //
const dialogTitle = ref(t('action.detail')) //
//
const handleDetail = async (row: TokenApi.OAuth2TokenVO) => {
//
detailRef.value = row
dialogVisible.value = true
}
// 退
const handleForceLogout = (rowId: number) => {
message
.delConfirm()
.then(async () => {
await TokenApi.deleteAccessTokenApi(rowId)
message.success(t('common.delSuccess'))
})
.finally(() => {
//
xGrid.value?.commitProxy('query')
})
}
</script>

View File

@ -1,68 +1,45 @@
import { reactive } from 'vue' import { reactive } from 'vue'
import { useI18n } from '@/hooks/web/useI18n' import { useI18n } from '@/hooks/web/useI18n'
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
import { DICT_TYPE } from '@/utils/dict' import { DICT_TYPE } from '@/utils/dict'
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
// CrudSchema // CrudSchema
const crudSchemas = reactive<CrudSchema[]>([ const crudSchemas = reactive<VxeCrudSchema>({
{ primaryKey: 'id',
label: t('common.index'), primaryType: 'seq',
field: 'id', action: true,
type: 'index', columns: [
form: { {
show: false title: '用户编号',
field: 'userId',
isSearch: true
}, },
detail: { {
show: false title: '访问令牌',
} field: 'accessToken'
},
{
label: '用户编号',
field: 'userId',
search: {
show: true
}
},
{
label: '访问令牌',
field: 'accessToken'
},
{
label: '刷新令牌',
field: 'refreshToken'
},
{
label: '用户类型',
field: 'userType',
dictType: DICT_TYPE.USER_TYPE,
search: {
show: true
}
},
{
label: t('common.createTime'),
field: 'createTime',
form: {
show: false
}
},
{
label: '过期时间',
field: 'expiresTime',
form: {
show: false
}
},
{
label: t('table.action'),
field: 'action',
width: '200px',
form: {
show: false
}, },
detail: { {
show: false title: '刷新令牌',
field: 'refreshToken'
},
{
title: '用户类型',
field: 'userType',
dictType: DICT_TYPE.USER_TYPE,
isSearch: true
},
{
title: t('common.createTime'),
field: 'createTime',
formatter: 'formatDate',
isForm: false
},
{
title: '过期时间',
field: 'expiresTime',
formatter: 'formatDate',
isForm: false
} }
} ]
]) })
export const { allSchemas } = useCrudSchemas(crudSchemas) export const { allSchemas } = useVxeCrudSchemas(crudSchemas)