export const GRANT_TYPE_DIC = [
  { label: '密码登录', value: 'password' },
  { label: '验证码登录', value: 'captcha' },
  { label: '短信登录', value: 'sms' },
  { label: '社交登录', value: 'social' },
  { label: '客户端凭证', value: 'client_credentials' },
  { label: '刷新令牌', value: 'refresh_token' },
];

export const authLogOption = {
  tip: false,
  searchShow: true,
  searchMenuSpan: 24,
  searchIcon: true,
  searchIndex: 8,
  searchMenuPosition: 'right',
  border: true,
  index: true,
  addBtn: false,
  viewBtn: false,
  editBtn: false,
  delBtn: false,
  menu: true,
  menuWidth: 180,
  dialogType: 'drawer',
  dialogWidth: 800,
  dialogClickModal: false,
  column: [
    {
      label: '授权账号',
      prop: 'account',
      slot: true,
      search: true,
      searchPlaceholder: '请输入账号',
    },
    {
      label: '用户姓名',
      prop: 'realName',
    },
    {
      label: '授权类型',
      prop: 'grantType',
      type: 'select',
      search: true,
      dicData: GRANT_TYPE_DIC,
      width: 110,
      align: 'center',
    },
    {
      label: '请求IP',
      prop: 'remoteIp',
      slot: true,
      search: true,
      searchPlaceholder: '请输入IP地址',
      width: 160,
    },
    {
      label: '服务ID',
      prop: 'serviceId',
      hide: true,
      width: 120,
    },
    {
      label: '服务器IP',
      prop: 'serverIp',
      hide: true,
      width: 160,
    },
    {
      label: '环境',
      prop: 'env',
      slot: true,
      width: 80,
      align: 'center',
    },
    {
      label: '服务器名',
      prop: 'serverHost',
      hide: true,
      width: 120,
    },
    {
      label: '登录时间',
      prop: 'loginTime',
      sortable: true,
      span: 24,
      width: 180,
    },
    {
      label: '用户代理',
      prop: 'userAgent',
      type: 'textarea',
      span: 24,
      hide: true,
      overHidden: true,
    },
  ],
};
