refactor: oauth2 vxe
parent
bdc988e5b7
commit
7250e23df3
@ -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
|
|
||||||
}
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
export type OAuth2TokenVo = {
|
|
||||||
id: number
|
|
||||||
accessToken: string
|
|
||||||
refreshToken: string
|
|
||||||
userId: number
|
|
||||||
userType: number
|
|
||||||
clientId: string
|
|
||||||
createTime: string
|
|
||||||
expiresTime: string
|
|
||||||
}
|
|
||||||
@ -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: '用户编号',
|
title: '刷新令牌',
|
||||||
field: 'userId',
|
field: 'refreshToken'
|
||||||
search: {
|
},
|
||||||
show: true
|
{
|
||||||
}
|
title: '用户类型',
|
||||||
},
|
field: 'userType',
|
||||||
{
|
dictType: DICT_TYPE.USER_TYPE,
|
||||||
label: '访问令牌',
|
isSearch: true
|
||||||
field: 'accessToken'
|
},
|
||||||
},
|
{
|
||||||
{
|
title: t('common.createTime'),
|
||||||
label: '刷新令牌',
|
field: 'createTime',
|
||||||
field: 'refreshToken'
|
formatter: 'formatDate',
|
||||||
},
|
isForm: false
|
||||||
{
|
|
||||||
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: 'expiresTime',
|
||||||
|
formatter: 'formatDate',
|
||||||
|
isForm: false
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
])
|
})
|
||||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
|
||||||
|
|||||||
Loading…
Reference in New Issue