refactor: oauth2 vxe

This commit is contained in:
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,68 +1,45 @@
import { reactive } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
import { DICT_TYPE } from '@/utils/dict'
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
const { t } = useI18n() // 国际化
// CrudSchema
const crudSchemas = reactive<CrudSchema[]>([
{
label: t('common.index'),
field: 'id',
type: 'index',
form: {
show: false
const crudSchemas = reactive<VxeCrudSchema>({
primaryKey: 'id',
primaryType: 'seq',
action: true,
columns: [
{
title: '用户编号',
field: 'userId',
isSearch: true
},
detail: {
show: false
}
},
{
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
{
title: '访问令牌',
field: 'accessToken'
},
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)