user.ts 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. import { IProCptItem } from './compilation';
  2. // 实体类型
  3. export enum EntityType {
  4. // 个人
  5. PERSON = 1,
  6. // 企业
  7. ENTERPRISE = 2,
  8. }
  9. // 登录类型(与实体类型有语义上的区别)
  10. export enum LoginType {
  11. PERSON = 'person',
  12. ENTERPRISE = 'enterprise',
  13. }
  14. // 登录方式(使用密码还是短信进行登录,与登录类型是不同概念)
  15. export enum LoginMode {
  16. PASSWORD = 'password',
  17. SMS = 'sms',
  18. }
  19. export enum UserType {
  20. NORMAL = 'normal',
  21. PROFESSIONAL = 'professional',
  22. }
  23. export interface IUsedCptItem {
  24. // 编办 ID
  25. compilationID: string;
  26. // 第一次使用的时间
  27. firstUseTime: number;
  28. }
  29. export interface IContactItem {
  30. // 用户 ID
  31. userID: string;
  32. // 第一成为联系人的时间
  33. firstContactTime: number;
  34. }
  35. export interface IEverydayOnlineTimeItem {
  36. // 日期
  37. date: number;
  38. // 在线时长
  39. onlineTime: number;
  40. }
  41. export interface ISummary {
  42. // 最后登录时间
  43. lastLoginTime: number;
  44. // 上次使用的编办
  45. lastUsedCpt: string;
  46. // 总共在线时长
  47. totalOnlineTime: number;
  48. // 今天目前的在线时长
  49. todayOnlineTime: number;
  50. // 每天的在线时长
  51. everydayOnlineTime: IEverydayOnlineTimeItem[];
  52. }
  53. export interface IUserArea {
  54. province: string; // 省份
  55. municipality: string; // 城市
  56. }
  57. export interface IUser {
  58. ID: string;
  59. ssoID: string;
  60. mobile: string;
  61. realName: string;
  62. createTime: number;
  63. proCptList: IProCptItem[];
  64. usedCptList: IUsedCptItem[];
  65. specifyCpt: string;
  66. contacts: IContactItem[];
  67. onlySMSLogin: boolean;
  68. abnormalLoginAlert: boolean;
  69. defaultEnterprise: string;
  70. summaryInfo: ISummary;
  71. institutionName: string; // 用户输入的机构名称
  72. area: IUserArea; // 用户选择的省份、城市、地区
  73. }
  74. export interface IAPInstitution {
  75. ID: string;
  76. name: string;
  77. }
  78. export interface IAPOrganizationalStructure {
  79. ID: string;
  80. name: string;
  81. }
  82. export interface IAPUser {
  83. ID: string;
  84. createdTime: number;
  85. gender: string;
  86. accountType: string;
  87. account: string;
  88. name: string;
  89. phone: string;
  90. contactMobile: string;
  91. officePhone: string;
  92. email: string;
  93. institution: IAPInstitution;
  94. organizationalStructure: IAPOrganizationalStructure;
  95. dataID: string;
  96. created: string;
  97. createdID: string; // 创建人ID
  98. isCreated?: boolean; // 是否可创建,字段由后台定义
  99. roleIDs?: string[]; // 角色ID列表
  100. enable?: boolean;
  101. projectLimit?: number; // 创建项目数量的限制
  102. failLoginCount?: number; // 登陆失败的次数
  103. lastTryLoginTime?: number; // 上次尝试登陆的时间
  104. passwordModifyTime?: number; // 密码修改时间
  105. phrases: string[]; // 常用语
  106. idCode: String, // 身份证号码
  107. isIdAuth: Boolean, // 身份证是否经过实名认证
  108. }
  109. // 最近联系人
  110. export interface IRecentUser extends IUser {
  111. recentDate: number;
  112. }
  113. // 正在查看项目的用户
  114. export interface IViewingProjectUser {
  115. projectID: string;
  116. userID: string;
  117. userName: string;
  118. mobile: string;
  119. enterpriseID: string;
  120. enterpriseName: string;
  121. }
  122. // 安全策略配置
  123. export interface ISecurityConfiguration {
  124. ID: string;
  125. loginTimes: number;
  126. accountLockTimes: number;
  127. passwordVerification: number;
  128. passwordValidity: number;
  129. logReserveDay: number;
  130. }