user.ets
6.0 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
import { QueryParams } from './recordsType'
import https from './request'
import { loginType, userForm, personTest, personCertificateTest, CertificateTest, personCertificateRow, personData, companyWalletTest, InfoTest, companyTest,
companyData, headerTest, formType, headerRow,comBoTest, addType
} from './userType'
// 用户登录
export const login = (data: userForm) => {
return https<loginType>({
url: '/login',
method: 'post',
data,
headers: {
unToken: true
}
})
}
// 退出登录
export const loginOut = () => {
return https({
url: '/logout',
method: 'post',
headers: {
unToken: true
}
})
}
export interface updateStateParams {
relateId: number
state: string
}
// 离职申请
export const updateState = (data: updateStateParams) => {
return https({
url: '/system/companyPerson/updateState',
method: 'post',
data
})
}
// 获取账号信息
export const getInfo = () => {
return https<InfoTest>({
url: '/getInfo',
method: 'get'
})
}
// 获取个人信息
export const getPersonInfo = () => {
return https<personTest>({
url: '/system/person/currentPerson',
method: 'get'
})
}
// 获取公司管理员信息
export const getCompanyInfo = () => {
return https<companyTest>({
url: '/system/company/currentCompany',
method: 'get'
})
}
// 更新个人信息
export const updateCompanyInfo = (data: companyData) => {
return https({
url: '/system/company',
method: 'put',
data
})
}
// 获取公司管理员获取员工信息
export const getPersonDetail = (personId: number) => {
return https<personTest>({
url: `/system/person/${personId}`,
method: 'get'
})
}
// 更新个人信息
export const updatePersonInfo = (data: personData) => {
return https({
url: '/system/person',
method: 'put',
data
})
}
export interface emailType {
code: number
msg: string
data: string
}
// 获取邮箱验证码
export const getEmailCode = (email: string) => {
return https<emailType>({
url: '/system/forgetPwd/registValidEmail',
method: 'post',
data: email
})
}
export interface certificateParams {
pageNum: number
pageSize: number
personId?: number
companyId?: number
}
// 获取个人证书信息
export const getPersonalCertificate = (data: certificateParams) => {
return https<personCertificateTest>({
url: '/system/personalCertificate/list',
method: 'get',
params: data
})
}
// 修改个人证书信息
export const updatePersonalCertificate = (data: personCertificateRow) => {
return https({
url: '/system/personalCertificate',
method: 'put',
data
})
}
// 添加个人证书信息
export const addPersonalCertificate = (data: personCertificateRow) => {
return https({
url: '/system/personalCertificate',
method: 'post',
data
})
}
// 获取证书列表
export const getCertificateList = (data: certificateParams) => {
return https<CertificateTest>({
url: '/system/certificate/list',
method: 'get',
params: data
})
}
// 获取公司余额信息
export const getCompanyWallet = (data: certificateParams) => {
return https<companyWalletTest>({
url: '/system/wallet/list',
method: 'get',
params: data
})
}
// 用户修改密码
export const updatePassword = (oldPassword: string, newPassword: string) => {
return https<companyWalletTest>({
url: '/system/user/profile/updatePwd',
method: 'put',
params: {
oldPassword,
newPassword
}
})
}
// 用户重置密码
export const resetPassword = (data: formType) => {
return https({
url: '/system/forgetPwd/resetPwd',
method: 'post',
data
})
}
// 获取公司开票信息
export const getHeaderInfo = (data: QueryParams) => {
return https<headerTest>({
url: '/system/header/list',
method: 'get',
params: data
})
}
// 修改新增开票信息
export const addHeaderInfo = (data: headerRow) => {
return https({
url: '/system/header',
method: 'post',
data
})
}
// 修改开票信息
export const updateHeaderInfo = (data: headerRow) => {
return https({
url: '/system/header',
method: 'put',
data
})
}
// 获取充值套餐
export const getComboList = (data: QueryParams) => {
return https<comBoTest>({
url: '/system/combo/list',
method: 'get',
params: data
})
}
export interface beanType {
code: number
msg: string
}
// 获取报告豆比例
export const getBean = () => {
return https<beanType>({
url: '/system/config/configKey/bean.config.proportion',
method: 'get',
})
}
// 获取是否可以上传云存储
export const getCloudDown = () => {
return https<beanType>({
url: '/system/config/configKey/permission.uploadVedio',
method: 'get',
})
}
// 获取是否收费
export const getPay = () => {
return https<beanType>({
url: '/system/config/configKey/permission.charge',
method: 'get',
})
}
export interface queryUserNameType {
code: number
msg: string
data: number
}
// 检查用户名是否被使用
export const queryUsername = (userName: string) => {
return https<queryUserNameType>({
url: '/system/user/checkUserName',
method: 'get',
params: {
userName
}
})
}
export interface queryIdNoType {
code: number
msg: string
row: [],
total: number
}
// 检查身份证号是否被使用
export const queryIdNo = (idNo: string) => {
return https<queryIdNoType>({
url: '/system/person/list',
method: 'get',
params: {
pageNum: 1,
pageSize: 1,
idNo
}
})
}
// 注册个人用户
export const userRegister = (data: personData) => {
return https({
url: '/system/person/register',
method: 'post',
data
})
}
// 注册企业用户
export const companyRegister = (data: companyData) => {
return https({
url: '/system/company/register',
method: 'post',
data
})
}
// 公司新增员工
export const companyAdd = (data: addType) => {
return https<beanType>({
url: '/system/companyPerson',
method: 'post',
data
})
}