zhangwei
2025-08-20 115769e9ad3ddc64e21ad7285450c4c563c745ed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
export type Result = {
  success: boolean;
  result: Array<any>;
  code: string | number;
  message: string;
};
type page = {
  items: Array<any>;
  total: number;
  pageSize: number;
  page: number;
};
export type PageResult = {
  success: boolean;
  result: page;
  code: string | number;
  message: string;
};
 
type captchaImg = {
  expirySeconds: number;
  message: string;
  img: string;
  id: string;
};
 
type getUploadToken = {
  policy: string;
  message: string;
  DirPath: string;
  id: string;
  x_oss_signature_version: string;
  x_oss_credential: string;
  x_oss_date: string;
  signature: string;
  security_token: string;
  url: string;
};
 
export type getUploadTokenResult = {
  success: boolean;
  result: getUploadToken;
  code: string | number;
};
 
export type CaptchaResult = {
  success: boolean;
  result: captchaImg;
  code: string | number;
};
 
export type UserResult = {
  success: boolean;
  data: {
    /** 头像 */
    avatar: string;
    /** 用户名 */
    username: string;
    /** 昵称 */
    nickname: string;
    /** 当前登录用户的角色 */
    roles: Array<string>;
    /** 按钮级别权限 */
    permissions: Array<string>;
    /** `token` */
    accessToken: string;
    /** 用于调用刷新`accessToken`的接口时所需的`token` */
    refreshToken: string;
    /** `accessToken`的过期时间(格式'xxxx/xx/xx xx:xx:xx') */
    expires: Date;
  };
};
// 企业信息项类型
interface CustomerEx {
  customerUserID: number;
  enterpriseName: string;
  isManger: boolean; // 注意:原数据中可能存在拼写错误(应为isManager),此处保持与原数据一致
  unifiedSocialCreditCode: string;
}
 
// 整体结果类型
export interface LoginResult {
  theLastLogo: boolean;
  accessToken: string | null;
  refreshToken: string | null;
  exRoles: any | null; // exRoles为null,具体类型可根据实际业务场景细化
  code: string;
  isManager: boolean;
  customerExs: CustomerEx[];
  expires: string;
  roles: [];
  username: string;
  avatar: string;
  nickname: string;
  permissions: [];
}
 
export type LoginData = {
  message: string;
  success: boolean;
  code: string | number;
  result: LoginResult;
};
export interface RoleItem {
  id: number;
  name: string;
  code: string;
  orderNo: number;
  dataScope: number;
  remark: string | null; // 可能为null或字符串
  status: number;
}
// 角色列表
export type RoleData = {
  message: string;
  success: boolean;
  code: string | number;
  result: RoleItem[];
};