token.data.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { reactive } from 'vue'
  2. import { useI18n } from '@/hooks/web/useI18n'
  3. import { DICT_TYPE } from '@/utils/dict'
  4. import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
  5. const { t } = useI18n() // 国际化
  6. // CrudSchema
  7. const crudSchemas = reactive<VxeCrudSchema>({
  8. primaryKey: 'id',
  9. primaryType: null,
  10. action: true,
  11. columns: [
  12. {
  13. title: '用户编号',
  14. field: 'userId',
  15. isSearch: true
  16. },
  17. {
  18. title: '访问令牌',
  19. field: 'accessToken'
  20. },
  21. {
  22. title: '刷新令牌',
  23. field: 'refreshToken'
  24. },
  25. {
  26. title: '客户端编号',
  27. field: 'clientId',
  28. isSearch: true
  29. },
  30. {
  31. title: '用户类型',
  32. field: 'userType',
  33. dictType: DICT_TYPE.USER_TYPE,
  34. dictClass: 'number',
  35. isSearch: true
  36. },
  37. {
  38. title: t('common.createTime'),
  39. field: 'createTime',
  40. formatter: 'formatDate',
  41. isForm: false
  42. },
  43. {
  44. title: '过期时间',
  45. field: 'expiresTime',
  46. formatter: 'formatDate',
  47. isForm: false
  48. }
  49. ]
  50. })
  51. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)