create-pubinfo-pr 0.189.2 → 0.203.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.d.mts +1 -0
- package/dist/{cli.js → cli.mjs} +6 -6
- package/dist/{helper.js → helper.mjs} +13 -13
- package/dist/{index.js → index.mjs} +1 -1
- package/package.json +19 -19
- package/templates/pubinfo-app/src/api/modules/auth/renzhengfuwu.ts +186 -1
- package/templates/pubinfo-app/src/api/modules/auth/typings.d.ts +100 -2
- package/templates/pubinfo-monorepo/apps/basic/src/api/modules/auth/renzhengfuwu.ts +186 -1
- package/templates/pubinfo-monorepo/apps/basic/src/api/modules/auth/typings.d.ts +100 -2
- package/dist/cli.d.ts +0 -2
- /package/dist/{index.d.ts → index.d.mts} +0 -0
package/dist/cli.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/{cli.js → cli.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as validateInput, n as readPackageJSON, r as run, t as bootstrop } from "./helper.
|
|
2
|
+
import { a as validateInput, n as readPackageJSON, r as run, t as bootstrop } from "./helper.mjs";
|
|
3
3
|
import { checkbox, confirm, input, select } from "@inquirer/prompts";
|
|
4
4
|
import { logger } from "@pubinfo-pr/shared";
|
|
5
5
|
import { Command } from "commander";
|
|
@@ -31,11 +31,11 @@ const META_FILENAME = "pubinfo.json";
|
|
|
31
31
|
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/v1/download.ts
|
|
34
|
-
const pubinfo = async (input
|
|
35
|
-
const semver = coerce(input
|
|
34
|
+
const pubinfo = async (input, { auth }) => {
|
|
35
|
+
const semver = coerce(input);
|
|
36
36
|
return {
|
|
37
37
|
name: "pubinfo-pr",
|
|
38
|
-
version: input
|
|
38
|
+
version: input,
|
|
39
39
|
headers: { Authorization: `token ${auth}` },
|
|
40
40
|
tar: `${REMOTE_URL}/${PKG_NAME}-${semver?.version}.tar.gz`
|
|
41
41
|
};
|
|
@@ -219,8 +219,8 @@ async function runV1() {
|
|
|
219
219
|
optionsV1.apps = await checkbox({
|
|
220
220
|
message: "选择应用模块(apps)",
|
|
221
221
|
choices: APPS,
|
|
222
|
-
validate: (input
|
|
223
|
-
if (input
|
|
222
|
+
validate: (input) => {
|
|
223
|
+
if (input.length === 0) return "请至少选择一个应用";
|
|
224
224
|
return true;
|
|
225
225
|
}
|
|
226
226
|
});
|
|
@@ -23,10 +23,10 @@ async function copyTemplate(options) {
|
|
|
23
23
|
|
|
24
24
|
//#endregion
|
|
25
25
|
//#region src/git.ts
|
|
26
|
-
function runGitCommand(args, cwd
|
|
26
|
+
function runGitCommand(args, cwd) {
|
|
27
27
|
return new Promise((resolvePromise, rejectPromise) => {
|
|
28
28
|
const child = spawn("git", args, {
|
|
29
|
-
cwd
|
|
29
|
+
cwd,
|
|
30
30
|
stdio: "ignore"
|
|
31
31
|
});
|
|
32
32
|
child.on("error", rejectPromise);
|
|
@@ -122,8 +122,8 @@ async function generate(options) {
|
|
|
122
122
|
|
|
123
123
|
//#endregion
|
|
124
124
|
//#region src/utils.ts
|
|
125
|
-
function validateInput(input
|
|
126
|
-
if (/[<>:"/\\|?*\s]/.test(input
|
|
125
|
+
function validateInput(input) {
|
|
126
|
+
if (/[<>:"/\\|?*\s]/.test(input)) return "错误提示: 该值不能包含空格或者非法字符 (例如, <>:\"/\\|?*).";
|
|
127
127
|
return true;
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -184,10 +184,10 @@ async function interaction() {
|
|
|
184
184
|
|
|
185
185
|
//#endregion
|
|
186
186
|
//#region src/core/index.ts
|
|
187
|
-
async function run(version
|
|
187
|
+
async function run(version) {
|
|
188
188
|
generate({
|
|
189
189
|
...await interaction(),
|
|
190
|
-
version
|
|
190
|
+
version
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
193
|
|
|
@@ -196,21 +196,21 @@ async function run(version$1) {
|
|
|
196
196
|
var package_default = {
|
|
197
197
|
name: "create-pubinfo-pr",
|
|
198
198
|
type: "module",
|
|
199
|
-
version: "2.1.
|
|
199
|
+
version: "2.1.10-beta.2",
|
|
200
200
|
description: "初始化项目框架",
|
|
201
201
|
author: "Werheng <werheng.zhang@gmail.com>",
|
|
202
202
|
license: "MIT",
|
|
203
203
|
exports: {
|
|
204
204
|
".": {
|
|
205
|
-
"types": "./dist/index.d.
|
|
206
|
-
"default": "./dist/index.
|
|
205
|
+
"types": "./dist/index.d.mts",
|
|
206
|
+
"default": "./dist/index.mjs"
|
|
207
207
|
},
|
|
208
208
|
"./package.json": "./package.json"
|
|
209
209
|
},
|
|
210
|
-
main: "./dist/index.
|
|
211
|
-
module: "./dist/index.
|
|
212
|
-
types: "./dist/index.d.
|
|
213
|
-
bin: { "pubinfo-pr": "./dist/cli.
|
|
210
|
+
main: "./dist/index.mjs",
|
|
211
|
+
module: "./dist/index.mjs",
|
|
212
|
+
types: "./dist/index.d.mts",
|
|
213
|
+
bin: { "pubinfo-pr": "./dist/cli.mjs" },
|
|
214
214
|
files: ["dist", "templates"],
|
|
215
215
|
engines: { "node": "^20.19.0 || >=22.12.0" },
|
|
216
216
|
scripts: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as interaction, n as readPackageJSON, o as generate, r as run, s as copyTemplate } from "./helper.
|
|
1
|
+
import { i as interaction, n as readPackageJSON, o as generate, r as run, s as copyTemplate } from "./helper.mjs";
|
|
2
2
|
|
|
3
3
|
export { copyTemplate, generate, interaction, readPackageJSON, run };
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pubinfo-pr",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.203.2",
|
|
5
5
|
"description": "初始化项目框架",
|
|
6
6
|
"author": "Werheng <werheng.zhang@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"types": "./dist/index.d.
|
|
11
|
-
"default": "./dist/index.
|
|
10
|
+
"types": "./dist/index.d.mts",
|
|
11
|
+
"default": "./dist/index.mjs"
|
|
12
12
|
},
|
|
13
13
|
"./package.json": "./package.json"
|
|
14
14
|
},
|
|
15
|
-
"main": "./dist/index.
|
|
16
|
-
"module": "./dist/index.
|
|
17
|
-
"types": "./dist/index.d.
|
|
15
|
+
"main": "./dist/index.mjs",
|
|
16
|
+
"module": "./dist/index.mjs",
|
|
17
|
+
"types": "./dist/index.d.mts",
|
|
18
18
|
"bin": {
|
|
19
|
-
"pubinfo": "./dist/cli.
|
|
19
|
+
"pubinfo": "./dist/cli.mjs"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
22
|
"dist",
|
|
@@ -26,22 +26,22 @@
|
|
|
26
26
|
"node": "^20.19.0 || >=22.12.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@inquirer/prompts": "^
|
|
30
|
-
"@pubinfo-pr/shared": "0.
|
|
29
|
+
"@inquirer/prompts": "^8.2.0",
|
|
30
|
+
"@pubinfo-pr/shared": "0.203.2",
|
|
31
31
|
"ansi-colors": "^4.1.3",
|
|
32
|
-
"cfonts": "^3.3.
|
|
33
|
-
"commander": "^14.0.
|
|
34
|
-
"confbox": "^0.2.
|
|
35
|
-
"fs-extra": "^11.3.
|
|
36
|
-
"giget": "^
|
|
32
|
+
"cfonts": "^3.3.1",
|
|
33
|
+
"commander": "^14.0.3",
|
|
34
|
+
"confbox": "^0.2.4",
|
|
35
|
+
"fs-extra": "^11.3.3",
|
|
36
|
+
"giget": "^3.1.2",
|
|
37
37
|
"node-plop": "0.32.2",
|
|
38
|
-
"ofetch": "^1.
|
|
39
|
-
"ora": "^
|
|
40
|
-
"rimraf": "^6.
|
|
41
|
-
"semver": "^7.7.
|
|
38
|
+
"ofetch": "^1.5.1",
|
|
39
|
+
"ora": "^9.3.0",
|
|
40
|
+
"rimraf": "^6.1.2",
|
|
41
|
+
"semver": "^7.7.4"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@types/node": "^
|
|
44
|
+
"@types/node": "^25.2.2"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"dev": "tsdown --watch src",
|
|
@@ -1,5 +1,80 @@
|
|
|
1
1
|
import { auth as request } from '@/api/request';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @description 双因素认证-二次认证准备
|
|
5
|
+
* @url /auth/2fa/prepare
|
|
6
|
+
* @method POST
|
|
7
|
+
* @author @pubinfo/openapi
|
|
8
|
+
*/
|
|
9
|
+
export function postAuth2FaPrepare<
|
|
10
|
+
R = API.ResponseDataString,
|
|
11
|
+
T = API.ResponseDataString,
|
|
12
|
+
>(body: API.Prepare2faDto, options?: Parameters<typeof request.Post<R, T>>[2]) {
|
|
13
|
+
return request.Post<R, T>('/auth/2fa/prepare', body, {
|
|
14
|
+
headers: {
|
|
15
|
+
'Content-Type': 'application/json',
|
|
16
|
+
},
|
|
17
|
+
...(options || {}),
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @description 双因素认证-二次认证验证
|
|
23
|
+
* @url /auth/2fa/verify
|
|
24
|
+
* @method POST
|
|
25
|
+
* @author @pubinfo/openapi
|
|
26
|
+
*/
|
|
27
|
+
export function postAuth2FaVerify<
|
|
28
|
+
R = API.ResponseDataLoginTokenVo,
|
|
29
|
+
T = API.ResponseDataLoginTokenVo,
|
|
30
|
+
>(body: API.Verify2faDto, options?: Parameters<typeof request.Post<R, T>>[2]) {
|
|
31
|
+
return request.Post<R, T>('/auth/2fa/verify', body, {
|
|
32
|
+
headers: {
|
|
33
|
+
'Content-Type': 'application/json',
|
|
34
|
+
},
|
|
35
|
+
...(options || {}),
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @description 验证码-前端校验 需要校验的验证码类型:blockPuzzle、clickWord
|
|
41
|
+
* @url /auth/captcha/check
|
|
42
|
+
* @method POST
|
|
43
|
+
* @author @pubinfo/openapi
|
|
44
|
+
*/
|
|
45
|
+
export function postAuthCaptchaCheck<
|
|
46
|
+
R = API.ResponseDataValidCodeVo,
|
|
47
|
+
T = API.ResponseDataValidCodeVo,
|
|
48
|
+
>(
|
|
49
|
+
body: API.CaptchaCheckDto,
|
|
50
|
+
options?: Parameters<typeof request.Post<R, T>>[2],
|
|
51
|
+
) {
|
|
52
|
+
return request.Post<R, T>('/auth/captcha/check', body, {
|
|
53
|
+
headers: {
|
|
54
|
+
'Content-Type': 'application/json',
|
|
55
|
+
},
|
|
56
|
+
...(options || {}),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @description 验证码-获取验证码图片
|
|
62
|
+
* @url /auth/captcha/get
|
|
63
|
+
* @method POST
|
|
64
|
+
* @author @pubinfo/openapi
|
|
65
|
+
*/
|
|
66
|
+
export function postAuthCaptchaGet<
|
|
67
|
+
R = API.ResponseDataValidCodeVo,
|
|
68
|
+
T = API.ResponseDataValidCodeVo,
|
|
69
|
+
>(body: API.CaptchaGetDto, options?: Parameters<typeof request.Post<R, T>>[2]) {
|
|
70
|
+
return request.Post<R, T>('/auth/captcha/get', body, {
|
|
71
|
+
headers: {
|
|
72
|
+
'Content-Type': 'application/json',
|
|
73
|
+
},
|
|
74
|
+
...(options || {}),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
3
78
|
/**
|
|
4
79
|
* @description 切换登录组织
|
|
5
80
|
* @url /auth/changeLoginOrg
|
|
@@ -46,6 +121,27 @@ export function getAuthCheckCacheToken<
|
|
|
46
121
|
});
|
|
47
122
|
}
|
|
48
123
|
|
|
124
|
+
/**
|
|
125
|
+
* @description 根据用户id获取用户token列表
|
|
126
|
+
* @url /auth/getTokenListByUserId
|
|
127
|
+
* @method GET
|
|
128
|
+
* @author @pubinfo/openapi
|
|
129
|
+
*/
|
|
130
|
+
export function getAuthGetTokenListByUserId<
|
|
131
|
+
R = API.ResponseDataListPubLoginTokenVo,
|
|
132
|
+
T = API.ResponseDataListPubLoginTokenVo,
|
|
133
|
+
>(
|
|
134
|
+
params: API.getAuthGetTokenListByUserIdParams,
|
|
135
|
+
options?: Parameters<typeof request.Get<R, T>>[1],
|
|
136
|
+
) {
|
|
137
|
+
return request.Get<R, T>('/auth/getTokenListByUserId', {
|
|
138
|
+
params: {
|
|
139
|
+
...params,
|
|
140
|
+
},
|
|
141
|
+
...(options || {}),
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
49
145
|
/**
|
|
50
146
|
* @description 密码登录
|
|
51
147
|
* @url /auth/login
|
|
@@ -101,7 +197,28 @@ export function getAuthLoginValidCode<
|
|
|
101
197
|
}
|
|
102
198
|
|
|
103
199
|
/**
|
|
104
|
-
* @description
|
|
200
|
+
* @description 验证码-密码登录
|
|
201
|
+
* @url /auth/loginNew
|
|
202
|
+
* @method POST
|
|
203
|
+
* @author @pubinfo/openapi
|
|
204
|
+
*/
|
|
205
|
+
export function postAuthLoginNew<
|
|
206
|
+
R = API.ResponseDataLoginTokenVo,
|
|
207
|
+
T = API.ResponseDataLoginTokenVo,
|
|
208
|
+
>(
|
|
209
|
+
body: API.LoginByPwdCaptchaDto,
|
|
210
|
+
options?: Parameters<typeof request.Post<R, T>>[2],
|
|
211
|
+
) {
|
|
212
|
+
return request.Post<R, T>('/auth/loginNew', body, {
|
|
213
|
+
headers: {
|
|
214
|
+
'Content-Type': 'application/json',
|
|
215
|
+
},
|
|
216
|
+
...(options || {}),
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* @description 当前用户登出
|
|
105
222
|
* @url /auth/loginOut
|
|
106
223
|
* @method POST
|
|
107
224
|
* @author @pubinfo/openapi
|
|
@@ -119,6 +236,74 @@ export function postAuthLoginOut<
|
|
|
119
236
|
);
|
|
120
237
|
}
|
|
121
238
|
|
|
239
|
+
/**
|
|
240
|
+
* @description 用户id登出
|
|
241
|
+
* @url /auth/loginOutByUserId
|
|
242
|
+
* @method POST
|
|
243
|
+
* @author @pubinfo/openapi
|
|
244
|
+
*/
|
|
245
|
+
export function postAuthLoginOutByUserId<
|
|
246
|
+
R = API.ResponseDataVoid,
|
|
247
|
+
T = API.ResponseDataVoid,
|
|
248
|
+
>(
|
|
249
|
+
params: API.postAuthLoginOutByUserIdParams,
|
|
250
|
+
options?: Parameters<typeof request.Post<R, T>>[2],
|
|
251
|
+
) {
|
|
252
|
+
return request.Post<R, T>(
|
|
253
|
+
'/auth/loginOutByUserId',
|
|
254
|
+
{},
|
|
255
|
+
{
|
|
256
|
+
params: {
|
|
257
|
+
...params,
|
|
258
|
+
},
|
|
259
|
+
...(options || {}),
|
|
260
|
+
},
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* @description 用户id和设备类型登出
|
|
266
|
+
* @url /auth/loginOutByUserIdAndDevType
|
|
267
|
+
* @method POST
|
|
268
|
+
* @author @pubinfo/openapi
|
|
269
|
+
*/
|
|
270
|
+
export function postAuthLoginOutByUserIdAndDevType<
|
|
271
|
+
R = API.ResponseDataVoid,
|
|
272
|
+
T = API.ResponseDataVoid,
|
|
273
|
+
>(
|
|
274
|
+
params: API.postAuthLoginOutByUserIdAndDevTypeParams,
|
|
275
|
+
options?: Parameters<typeof request.Post<R, T>>[2],
|
|
276
|
+
) {
|
|
277
|
+
return request.Post<R, T>(
|
|
278
|
+
'/auth/loginOutByUserIdAndDevType',
|
|
279
|
+
{},
|
|
280
|
+
{
|
|
281
|
+
params: {
|
|
282
|
+
...params,
|
|
283
|
+
},
|
|
284
|
+
...(options || {}),
|
|
285
|
+
},
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* @description 单点免密登录接口
|
|
291
|
+
* @url /auth/ssoLogin
|
|
292
|
+
* @method POST
|
|
293
|
+
* @author @pubinfo/openapi
|
|
294
|
+
*/
|
|
295
|
+
export function postAuthSsoLogin<
|
|
296
|
+
R = API.ResponseDataLoginTokenVo,
|
|
297
|
+
T = API.ResponseDataLoginTokenVo,
|
|
298
|
+
>(body: API.SsoLoginDto, options?: Parameters<typeof request.Post<R, T>>[2]) {
|
|
299
|
+
return request.Post<R, T>('/auth/ssoLogin', body, {
|
|
300
|
+
headers: {
|
|
301
|
+
'Content-Type': 'application/json',
|
|
302
|
+
},
|
|
303
|
+
...(options || {}),
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
|
|
122
307
|
/**
|
|
123
308
|
* @description 刷新访问令牌
|
|
124
309
|
* @url /auth/token/refresh
|
|
@@ -1,13 +1,39 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
declare namespace API {
|
|
4
|
+
type CaptchaCheckDto = {
|
|
5
|
+
/** 类型 clickWord:文字、blockPuzzle:滑块 */
|
|
6
|
+
captchaType: string;
|
|
7
|
+
/** 加密坐标 */
|
|
8
|
+
pointJson: string;
|
|
9
|
+
/** token */
|
|
10
|
+
token: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type CaptchaGetDto = {
|
|
14
|
+
/** 类型 clickWord:文字、blockPuzzle:滑块、imageCode:图片 */
|
|
15
|
+
captchaType?: string;
|
|
16
|
+
/** 客户端UI组件id */
|
|
17
|
+
clientUid?: string;
|
|
18
|
+
/** 时间戳 1751542686180 */
|
|
19
|
+
ts?: string;
|
|
20
|
+
/** 尺寸(长x宽),例:150x50表示长为150宽为50,不填默认150x50,最大尺寸:长500,宽200 */
|
|
21
|
+
size?: string;
|
|
22
|
+
/** 验证码长度,不填默认4位 */
|
|
23
|
+
length?: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
4
26
|
type getAuthCheckCacheTokenParams = {
|
|
5
27
|
accessToken: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
type getAuthGetTokenListByUserIdParams = {
|
|
31
|
+
/** 用户id */
|
|
6
32
|
userId: string;
|
|
7
33
|
};
|
|
8
34
|
|
|
9
35
|
type getAuthLoginValidCodeParams = {
|
|
10
|
-
/** 尺寸(长x宽),例:150x50表示长为150宽为50,不填默认150x50 */
|
|
36
|
+
/** 尺寸(长x宽),例:150x50表示长为150宽为50,不填默认150x50,最大尺寸:长500,宽200 */
|
|
11
37
|
size?: string;
|
|
12
38
|
/** 验证码长度,不填默认4位 */
|
|
13
39
|
length?: number;
|
|
@@ -15,8 +41,23 @@ declare namespace API {
|
|
|
15
41
|
|
|
16
42
|
type IResponseCode = {
|
|
17
43
|
code?: number;
|
|
18
|
-
msg?: string;
|
|
19
44
|
hint?: string;
|
|
45
|
+
msg?: string;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
type LoginByPwdCaptchaDto = {
|
|
49
|
+
/** 登录类型 */
|
|
50
|
+
loginType: string;
|
|
51
|
+
/** 登录名 */
|
|
52
|
+
loginName: string;
|
|
53
|
+
/** 密码 */
|
|
54
|
+
loginPwd: string;
|
|
55
|
+
/** imageCode:验证码hash/其他:加密后的token,AES.encode(token+"---"+pointListStr, key) */
|
|
56
|
+
codeHash: string;
|
|
57
|
+
/** 验证码 imageCode类型必填 */
|
|
58
|
+
code?: string;
|
|
59
|
+
/** 验证码类型,clickWord:文字、blockPuzzle:滑块、imageCode(默认):图片 */
|
|
60
|
+
captchaType?: string;
|
|
20
61
|
};
|
|
21
62
|
|
|
22
63
|
type LoginByPwdDto = {
|
|
@@ -38,6 +79,8 @@ declare namespace API {
|
|
|
38
79
|
/** 访问令牌 */
|
|
39
80
|
accessToken?: string;
|
|
40
81
|
loginResponse?: IResponseCode;
|
|
82
|
+
/** 2FA登录码 不为空表示开启了2FA登录 */
|
|
83
|
+
login2faCode?: string;
|
|
41
84
|
};
|
|
42
85
|
|
|
43
86
|
type postAuthChangeLoginOrgParams = {
|
|
@@ -45,11 +88,43 @@ declare namespace API {
|
|
|
45
88
|
orgId: string;
|
|
46
89
|
};
|
|
47
90
|
|
|
91
|
+
type postAuthLoginOutByUserIdAndDevTypeParams = {
|
|
92
|
+
/** 用户id */
|
|
93
|
+
userId: string;
|
|
94
|
+
/** 设备类型 */
|
|
95
|
+
devType: string;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
type postAuthLoginOutByUserIdParams = {
|
|
99
|
+
/** 用户id */
|
|
100
|
+
userId: string;
|
|
101
|
+
};
|
|
102
|
+
|
|
48
103
|
type postAuthTokenRefreshParams = {
|
|
49
104
|
/** 刷新令牌 */
|
|
50
105
|
refreshToken: string;
|
|
51
106
|
};
|
|
52
107
|
|
|
108
|
+
type Prepare2faDto = {
|
|
109
|
+
/** login2faCode */
|
|
110
|
+
login2faCode: string;
|
|
111
|
+
/** 二次认证方式 默认支持sms */
|
|
112
|
+
fa2Type: string;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
type PubLoginTokenVo = {
|
|
116
|
+
/** id */
|
|
117
|
+
id?: string;
|
|
118
|
+
/** 服务名称 */
|
|
119
|
+
appName?: string;
|
|
120
|
+
/** 用户id */
|
|
121
|
+
userId?: string;
|
|
122
|
+
/** 创建时间 */
|
|
123
|
+
createTime?: string;
|
|
124
|
+
/** 设备dev */
|
|
125
|
+
devType?: string;
|
|
126
|
+
};
|
|
127
|
+
|
|
53
128
|
type ResponseDataBoolean = {
|
|
54
129
|
code?: number;
|
|
55
130
|
msg?: string;
|
|
@@ -58,6 +133,14 @@ declare namespace API {
|
|
|
58
133
|
success?: boolean;
|
|
59
134
|
};
|
|
60
135
|
|
|
136
|
+
type ResponseDataListPubLoginTokenVo = {
|
|
137
|
+
code?: number;
|
|
138
|
+
msg?: string;
|
|
139
|
+
hint?: string;
|
|
140
|
+
data?: PubLoginTokenVo[];
|
|
141
|
+
success?: boolean;
|
|
142
|
+
};
|
|
143
|
+
|
|
61
144
|
type ResponseDataLoginTokenVo = {
|
|
62
145
|
code?: number;
|
|
63
146
|
msg?: string;
|
|
@@ -90,8 +173,23 @@ declare namespace API {
|
|
|
90
173
|
success?: boolean;
|
|
91
174
|
};
|
|
92
175
|
|
|
176
|
+
type SsoLoginDto = {
|
|
177
|
+
/** 登录类型 */
|
|
178
|
+
loginType: string;
|
|
179
|
+
code?: string;
|
|
180
|
+
};
|
|
181
|
+
|
|
93
182
|
type ValidCodeVo = {
|
|
94
183
|
key?: string;
|
|
95
184
|
plaintext?: string;
|
|
96
185
|
};
|
|
186
|
+
|
|
187
|
+
type Verify2faDto = {
|
|
188
|
+
/** login2faCode */
|
|
189
|
+
login2faCode: string;
|
|
190
|
+
/** 二次认证方式 默认支持sms */
|
|
191
|
+
fa2Type: string;
|
|
192
|
+
/** 认证码 */
|
|
193
|
+
verifyCode: string;
|
|
194
|
+
};
|
|
97
195
|
}
|
|
@@ -1,5 +1,80 @@
|
|
|
1
1
|
import { auth as request } from '@/api/request';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @description 双因素认证-二次认证准备
|
|
5
|
+
* @url /auth/2fa/prepare
|
|
6
|
+
* @method POST
|
|
7
|
+
* @author @pubinfo/openapi
|
|
8
|
+
*/
|
|
9
|
+
export function postAuth2FaPrepare<
|
|
10
|
+
R = API.ResponseDataString,
|
|
11
|
+
T = API.ResponseDataString,
|
|
12
|
+
>(body: API.Prepare2faDto, options?: Parameters<typeof request.Post<R, T>>[2]) {
|
|
13
|
+
return request.Post<R, T>('/auth/2fa/prepare', body, {
|
|
14
|
+
headers: {
|
|
15
|
+
'Content-Type': 'application/json',
|
|
16
|
+
},
|
|
17
|
+
...(options || {}),
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @description 双因素认证-二次认证验证
|
|
23
|
+
* @url /auth/2fa/verify
|
|
24
|
+
* @method POST
|
|
25
|
+
* @author @pubinfo/openapi
|
|
26
|
+
*/
|
|
27
|
+
export function postAuth2FaVerify<
|
|
28
|
+
R = API.ResponseDataLoginTokenVo,
|
|
29
|
+
T = API.ResponseDataLoginTokenVo,
|
|
30
|
+
>(body: API.Verify2faDto, options?: Parameters<typeof request.Post<R, T>>[2]) {
|
|
31
|
+
return request.Post<R, T>('/auth/2fa/verify', body, {
|
|
32
|
+
headers: {
|
|
33
|
+
'Content-Type': 'application/json',
|
|
34
|
+
},
|
|
35
|
+
...(options || {}),
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @description 验证码-前端校验 需要校验的验证码类型:blockPuzzle、clickWord
|
|
41
|
+
* @url /auth/captcha/check
|
|
42
|
+
* @method POST
|
|
43
|
+
* @author @pubinfo/openapi
|
|
44
|
+
*/
|
|
45
|
+
export function postAuthCaptchaCheck<
|
|
46
|
+
R = API.ResponseDataValidCodeVo,
|
|
47
|
+
T = API.ResponseDataValidCodeVo,
|
|
48
|
+
>(
|
|
49
|
+
body: API.CaptchaCheckDto,
|
|
50
|
+
options?: Parameters<typeof request.Post<R, T>>[2],
|
|
51
|
+
) {
|
|
52
|
+
return request.Post<R, T>('/auth/captcha/check', body, {
|
|
53
|
+
headers: {
|
|
54
|
+
'Content-Type': 'application/json',
|
|
55
|
+
},
|
|
56
|
+
...(options || {}),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @description 验证码-获取验证码图片
|
|
62
|
+
* @url /auth/captcha/get
|
|
63
|
+
* @method POST
|
|
64
|
+
* @author @pubinfo/openapi
|
|
65
|
+
*/
|
|
66
|
+
export function postAuthCaptchaGet<
|
|
67
|
+
R = API.ResponseDataValidCodeVo,
|
|
68
|
+
T = API.ResponseDataValidCodeVo,
|
|
69
|
+
>(body: API.CaptchaGetDto, options?: Parameters<typeof request.Post<R, T>>[2]) {
|
|
70
|
+
return request.Post<R, T>('/auth/captcha/get', body, {
|
|
71
|
+
headers: {
|
|
72
|
+
'Content-Type': 'application/json',
|
|
73
|
+
},
|
|
74
|
+
...(options || {}),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
3
78
|
/**
|
|
4
79
|
* @description 切换登录组织
|
|
5
80
|
* @url /auth/changeLoginOrg
|
|
@@ -46,6 +121,27 @@ export function getAuthCheckCacheToken<
|
|
|
46
121
|
});
|
|
47
122
|
}
|
|
48
123
|
|
|
124
|
+
/**
|
|
125
|
+
* @description 根据用户id获取用户token列表
|
|
126
|
+
* @url /auth/getTokenListByUserId
|
|
127
|
+
* @method GET
|
|
128
|
+
* @author @pubinfo/openapi
|
|
129
|
+
*/
|
|
130
|
+
export function getAuthGetTokenListByUserId<
|
|
131
|
+
R = API.ResponseDataListPubLoginTokenVo,
|
|
132
|
+
T = API.ResponseDataListPubLoginTokenVo,
|
|
133
|
+
>(
|
|
134
|
+
params: API.getAuthGetTokenListByUserIdParams,
|
|
135
|
+
options?: Parameters<typeof request.Get<R, T>>[1],
|
|
136
|
+
) {
|
|
137
|
+
return request.Get<R, T>('/auth/getTokenListByUserId', {
|
|
138
|
+
params: {
|
|
139
|
+
...params,
|
|
140
|
+
},
|
|
141
|
+
...(options || {}),
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
49
145
|
/**
|
|
50
146
|
* @description 密码登录
|
|
51
147
|
* @url /auth/login
|
|
@@ -101,7 +197,28 @@ export function getAuthLoginValidCode<
|
|
|
101
197
|
}
|
|
102
198
|
|
|
103
199
|
/**
|
|
104
|
-
* @description
|
|
200
|
+
* @description 验证码-密码登录
|
|
201
|
+
* @url /auth/loginNew
|
|
202
|
+
* @method POST
|
|
203
|
+
* @author @pubinfo/openapi
|
|
204
|
+
*/
|
|
205
|
+
export function postAuthLoginNew<
|
|
206
|
+
R = API.ResponseDataLoginTokenVo,
|
|
207
|
+
T = API.ResponseDataLoginTokenVo,
|
|
208
|
+
>(
|
|
209
|
+
body: API.LoginByPwdCaptchaDto,
|
|
210
|
+
options?: Parameters<typeof request.Post<R, T>>[2],
|
|
211
|
+
) {
|
|
212
|
+
return request.Post<R, T>('/auth/loginNew', body, {
|
|
213
|
+
headers: {
|
|
214
|
+
'Content-Type': 'application/json',
|
|
215
|
+
},
|
|
216
|
+
...(options || {}),
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* @description 当前用户登出
|
|
105
222
|
* @url /auth/loginOut
|
|
106
223
|
* @method POST
|
|
107
224
|
* @author @pubinfo/openapi
|
|
@@ -119,6 +236,74 @@ export function postAuthLoginOut<
|
|
|
119
236
|
);
|
|
120
237
|
}
|
|
121
238
|
|
|
239
|
+
/**
|
|
240
|
+
* @description 用户id登出
|
|
241
|
+
* @url /auth/loginOutByUserId
|
|
242
|
+
* @method POST
|
|
243
|
+
* @author @pubinfo/openapi
|
|
244
|
+
*/
|
|
245
|
+
export function postAuthLoginOutByUserId<
|
|
246
|
+
R = API.ResponseDataVoid,
|
|
247
|
+
T = API.ResponseDataVoid,
|
|
248
|
+
>(
|
|
249
|
+
params: API.postAuthLoginOutByUserIdParams,
|
|
250
|
+
options?: Parameters<typeof request.Post<R, T>>[2],
|
|
251
|
+
) {
|
|
252
|
+
return request.Post<R, T>(
|
|
253
|
+
'/auth/loginOutByUserId',
|
|
254
|
+
{},
|
|
255
|
+
{
|
|
256
|
+
params: {
|
|
257
|
+
...params,
|
|
258
|
+
},
|
|
259
|
+
...(options || {}),
|
|
260
|
+
},
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* @description 用户id和设备类型登出
|
|
266
|
+
* @url /auth/loginOutByUserIdAndDevType
|
|
267
|
+
* @method POST
|
|
268
|
+
* @author @pubinfo/openapi
|
|
269
|
+
*/
|
|
270
|
+
export function postAuthLoginOutByUserIdAndDevType<
|
|
271
|
+
R = API.ResponseDataVoid,
|
|
272
|
+
T = API.ResponseDataVoid,
|
|
273
|
+
>(
|
|
274
|
+
params: API.postAuthLoginOutByUserIdAndDevTypeParams,
|
|
275
|
+
options?: Parameters<typeof request.Post<R, T>>[2],
|
|
276
|
+
) {
|
|
277
|
+
return request.Post<R, T>(
|
|
278
|
+
'/auth/loginOutByUserIdAndDevType',
|
|
279
|
+
{},
|
|
280
|
+
{
|
|
281
|
+
params: {
|
|
282
|
+
...params,
|
|
283
|
+
},
|
|
284
|
+
...(options || {}),
|
|
285
|
+
},
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* @description 单点免密登录接口
|
|
291
|
+
* @url /auth/ssoLogin
|
|
292
|
+
* @method POST
|
|
293
|
+
* @author @pubinfo/openapi
|
|
294
|
+
*/
|
|
295
|
+
export function postAuthSsoLogin<
|
|
296
|
+
R = API.ResponseDataLoginTokenVo,
|
|
297
|
+
T = API.ResponseDataLoginTokenVo,
|
|
298
|
+
>(body: API.SsoLoginDto, options?: Parameters<typeof request.Post<R, T>>[2]) {
|
|
299
|
+
return request.Post<R, T>('/auth/ssoLogin', body, {
|
|
300
|
+
headers: {
|
|
301
|
+
'Content-Type': 'application/json',
|
|
302
|
+
},
|
|
303
|
+
...(options || {}),
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
|
|
122
307
|
/**
|
|
123
308
|
* @description 刷新访问令牌
|
|
124
309
|
* @url /auth/token/refresh
|
|
@@ -1,13 +1,39 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
declare namespace API {
|
|
4
|
+
type CaptchaCheckDto = {
|
|
5
|
+
/** 类型 clickWord:文字、blockPuzzle:滑块 */
|
|
6
|
+
captchaType: string;
|
|
7
|
+
/** 加密坐标 */
|
|
8
|
+
pointJson: string;
|
|
9
|
+
/** token */
|
|
10
|
+
token: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type CaptchaGetDto = {
|
|
14
|
+
/** 类型 clickWord:文字、blockPuzzle:滑块、imageCode:图片 */
|
|
15
|
+
captchaType?: string;
|
|
16
|
+
/** 客户端UI组件id */
|
|
17
|
+
clientUid?: string;
|
|
18
|
+
/** 时间戳 1751542686180 */
|
|
19
|
+
ts?: string;
|
|
20
|
+
/** 尺寸(长x宽),例:150x50表示长为150宽为50,不填默认150x50,最大尺寸:长500,宽200 */
|
|
21
|
+
size?: string;
|
|
22
|
+
/** 验证码长度,不填默认4位 */
|
|
23
|
+
length?: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
4
26
|
type getAuthCheckCacheTokenParams = {
|
|
5
27
|
accessToken: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
type getAuthGetTokenListByUserIdParams = {
|
|
31
|
+
/** 用户id */
|
|
6
32
|
userId: string;
|
|
7
33
|
};
|
|
8
34
|
|
|
9
35
|
type getAuthLoginValidCodeParams = {
|
|
10
|
-
/** 尺寸(长x宽),例:150x50表示长为150宽为50,不填默认150x50 */
|
|
36
|
+
/** 尺寸(长x宽),例:150x50表示长为150宽为50,不填默认150x50,最大尺寸:长500,宽200 */
|
|
11
37
|
size?: string;
|
|
12
38
|
/** 验证码长度,不填默认4位 */
|
|
13
39
|
length?: number;
|
|
@@ -15,8 +41,23 @@ declare namespace API {
|
|
|
15
41
|
|
|
16
42
|
type IResponseCode = {
|
|
17
43
|
code?: number;
|
|
18
|
-
msg?: string;
|
|
19
44
|
hint?: string;
|
|
45
|
+
msg?: string;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
type LoginByPwdCaptchaDto = {
|
|
49
|
+
/** 登录类型 */
|
|
50
|
+
loginType: string;
|
|
51
|
+
/** 登录名 */
|
|
52
|
+
loginName: string;
|
|
53
|
+
/** 密码 */
|
|
54
|
+
loginPwd: string;
|
|
55
|
+
/** imageCode:验证码hash/其他:加密后的token,AES.encode(token+"---"+pointListStr, key) */
|
|
56
|
+
codeHash: string;
|
|
57
|
+
/** 验证码 imageCode类型必填 */
|
|
58
|
+
code?: string;
|
|
59
|
+
/** 验证码类型,clickWord:文字、blockPuzzle:滑块、imageCode(默认):图片 */
|
|
60
|
+
captchaType?: string;
|
|
20
61
|
};
|
|
21
62
|
|
|
22
63
|
type LoginByPwdDto = {
|
|
@@ -38,6 +79,8 @@ declare namespace API {
|
|
|
38
79
|
/** 访问令牌 */
|
|
39
80
|
accessToken?: string;
|
|
40
81
|
loginResponse?: IResponseCode;
|
|
82
|
+
/** 2FA登录码 不为空表示开启了2FA登录 */
|
|
83
|
+
login2faCode?: string;
|
|
41
84
|
};
|
|
42
85
|
|
|
43
86
|
type postAuthChangeLoginOrgParams = {
|
|
@@ -45,11 +88,43 @@ declare namespace API {
|
|
|
45
88
|
orgId: string;
|
|
46
89
|
};
|
|
47
90
|
|
|
91
|
+
type postAuthLoginOutByUserIdAndDevTypeParams = {
|
|
92
|
+
/** 用户id */
|
|
93
|
+
userId: string;
|
|
94
|
+
/** 设备类型 */
|
|
95
|
+
devType: string;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
type postAuthLoginOutByUserIdParams = {
|
|
99
|
+
/** 用户id */
|
|
100
|
+
userId: string;
|
|
101
|
+
};
|
|
102
|
+
|
|
48
103
|
type postAuthTokenRefreshParams = {
|
|
49
104
|
/** 刷新令牌 */
|
|
50
105
|
refreshToken: string;
|
|
51
106
|
};
|
|
52
107
|
|
|
108
|
+
type Prepare2faDto = {
|
|
109
|
+
/** login2faCode */
|
|
110
|
+
login2faCode: string;
|
|
111
|
+
/** 二次认证方式 默认支持sms */
|
|
112
|
+
fa2Type: string;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
type PubLoginTokenVo = {
|
|
116
|
+
/** id */
|
|
117
|
+
id?: string;
|
|
118
|
+
/** 服务名称 */
|
|
119
|
+
appName?: string;
|
|
120
|
+
/** 用户id */
|
|
121
|
+
userId?: string;
|
|
122
|
+
/** 创建时间 */
|
|
123
|
+
createTime?: string;
|
|
124
|
+
/** 设备dev */
|
|
125
|
+
devType?: string;
|
|
126
|
+
};
|
|
127
|
+
|
|
53
128
|
type ResponseDataBoolean = {
|
|
54
129
|
code?: number;
|
|
55
130
|
msg?: string;
|
|
@@ -58,6 +133,14 @@ declare namespace API {
|
|
|
58
133
|
success?: boolean;
|
|
59
134
|
};
|
|
60
135
|
|
|
136
|
+
type ResponseDataListPubLoginTokenVo = {
|
|
137
|
+
code?: number;
|
|
138
|
+
msg?: string;
|
|
139
|
+
hint?: string;
|
|
140
|
+
data?: PubLoginTokenVo[];
|
|
141
|
+
success?: boolean;
|
|
142
|
+
};
|
|
143
|
+
|
|
61
144
|
type ResponseDataLoginTokenVo = {
|
|
62
145
|
code?: number;
|
|
63
146
|
msg?: string;
|
|
@@ -90,8 +173,23 @@ declare namespace API {
|
|
|
90
173
|
success?: boolean;
|
|
91
174
|
};
|
|
92
175
|
|
|
176
|
+
type SsoLoginDto = {
|
|
177
|
+
/** 登录类型 */
|
|
178
|
+
loginType: string;
|
|
179
|
+
code?: string;
|
|
180
|
+
};
|
|
181
|
+
|
|
93
182
|
type ValidCodeVo = {
|
|
94
183
|
key?: string;
|
|
95
184
|
plaintext?: string;
|
|
96
185
|
};
|
|
186
|
+
|
|
187
|
+
type Verify2faDto = {
|
|
188
|
+
/** login2faCode */
|
|
189
|
+
login2faCode: string;
|
|
190
|
+
/** 二次认证方式 默认支持sms */
|
|
191
|
+
fa2Type: string;
|
|
192
|
+
/** 认证码 */
|
|
193
|
+
verifyCode: string;
|
|
194
|
+
};
|
|
97
195
|
}
|
package/dist/cli.d.ts
DELETED
|
File without changes
|