vona-module-test-captcha 5.1.1
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/LICENSE +21 -0
- package/dist/.metadata/index.d.ts +72 -0
- package/dist/.metadata/index.d.ts.map +1 -0
- package/dist/.metadata/this.d.ts +3 -0
- package/dist/.metadata/this.d.ts.map +1 -0
- package/dist/controller/captcha.d.ts +9 -0
- package/dist/controller/captcha.d.ts.map +1 -0
- package/dist/dto/signin.d.ts +10 -0
- package/dist/dto/signin.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/package.json +40 -0
- package/src/.metadata/index.ts +99 -0
- package/src/.metadata/this.ts +2 -0
- package/src/controller/captcha.ts +18 -0
- package/src/dto/signin.ts +19 -0
- package/src/index.ts +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016-present Vona
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { TypeSymbolKeyFieldsMore } from 'vona-module-a-orm';
|
|
2
|
+
import type { TypeEntityOptionsFields, TypeControllerOptionsActions } from 'vona-module-a-openapi';
|
|
3
|
+
/** dto: begin */
|
|
4
|
+
export * from '../dto/signin.ts';
|
|
5
|
+
import type { IDtoOptionsSignin } from '../dto/signin.ts';
|
|
6
|
+
import 'vona-module-a-web';
|
|
7
|
+
declare module 'vona-module-a-web' {
|
|
8
|
+
interface IDtoRecord {
|
|
9
|
+
'test-captcha:signin': IDtoOptionsSignin;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
declare module 'vona-module-test-captcha' {
|
|
13
|
+
}
|
|
14
|
+
/** dto: end */
|
|
15
|
+
/** dto: begin */
|
|
16
|
+
import type { DtoSignin } from '../dto/signin.ts';
|
|
17
|
+
declare module 'vona-module-test-captcha' {
|
|
18
|
+
interface IDtoOptionsSignin {
|
|
19
|
+
fields?: TypeEntityOptionsFields<DtoSignin, IDtoOptionsSignin[TypeSymbolKeyFieldsMore]>;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** dto: end */
|
|
23
|
+
/** controller: begin */
|
|
24
|
+
export * from '../controller/captcha.ts';
|
|
25
|
+
import type { IControllerOptionsCaptcha } from '../controller/captcha.ts';
|
|
26
|
+
import 'vona-module-a-web';
|
|
27
|
+
declare module 'vona-module-a-web' {
|
|
28
|
+
interface IControllerRecord {
|
|
29
|
+
'test-captcha:captcha': IControllerOptionsCaptcha;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
declare module 'vona-module-test-captcha' {
|
|
33
|
+
interface ControllerCaptcha {
|
|
34
|
+
}
|
|
35
|
+
interface ControllerCaptcha {
|
|
36
|
+
get $beanFullName(): 'test-captcha.controller.captcha';
|
|
37
|
+
get $onionName(): 'test-captcha:captcha';
|
|
38
|
+
get $onionOptions(): IControllerOptionsCaptcha;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** controller: end */
|
|
42
|
+
/** controller: begin */
|
|
43
|
+
import '../controller/captcha.ts';
|
|
44
|
+
declare module 'vona-module-test-captcha' {
|
|
45
|
+
interface IControllerOptionsCaptcha {
|
|
46
|
+
actions?: TypeControllerOptionsActions<ControllerCaptcha>;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
declare module 'vona-module-a-web' {
|
|
50
|
+
interface IApiPathPostRecord {
|
|
51
|
+
'/test/captcha/signin': undefined;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** controller: end */
|
|
55
|
+
/** scope: begin */
|
|
56
|
+
import { BeanScopeBase, type BeanScopeUtil } from 'vona';
|
|
57
|
+
export declare class ScopeModuleTestCaptcha extends BeanScopeBase {
|
|
58
|
+
}
|
|
59
|
+
export interface ScopeModuleTestCaptcha {
|
|
60
|
+
util: BeanScopeUtil;
|
|
61
|
+
}
|
|
62
|
+
import 'vona';
|
|
63
|
+
declare module 'vona' {
|
|
64
|
+
interface IBeanScopeRecord {
|
|
65
|
+
'test-captcha': ScopeModuleTestCaptcha;
|
|
66
|
+
}
|
|
67
|
+
interface IBeanScopeContainer {
|
|
68
|
+
testCaptcha: ScopeModuleTestCaptcha;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/** scope: end */
|
|
72
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/.metadata/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAm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ACD,OAAO,QAAQ,mBAAmB,CAAC;IACjC,UAAiB,kBAAkB;QAC7B,sBAAsB,EAAE,SAAS,CAAC;KACrC;CAEJ;AAED,sBAAsB;AACtB,mBAAmB;AACnB,OAAO,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,MAAM,CAAC;AAGzD,qBACa,sBAAuB,SAAQ,aAAa;CAAG;AAE5D,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,OAAO,MAAM,CAAC;AACd,OAAO,QAAQ,MAAM,CAAC;IACpB,UAAiB,gBAAgB;QAC/B,cAAc,EAAE,sBAAsB,CAAC;KACxC;IAED,UAAiB,mBAAmB;QAClC,WAAW,EAAE,sBAAsB,CAAC;KACrC;CAOF;AACD,iBAAiB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"this.d.ts","sourceRoot":"","sources":["../../src/.metadata/this.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,IAAI,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IDecoratorControllerOptions } from 'vona-module-a-web';
|
|
2
|
+
import { BeanBase } from 'vona';
|
|
3
|
+
import { DtoSignin } from '../dto/signin.ts';
|
|
4
|
+
export interface IControllerOptionsCaptcha extends IDecoratorControllerOptions {
|
|
5
|
+
}
|
|
6
|
+
export declare class ControllerCaptcha extends BeanBase {
|
|
7
|
+
signin(_user: DtoSignin): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=captcha.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captcha.d.ts","sourceRoot":"","sources":["../../src/controller/captcha.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAErE,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAKhC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,WAAW,yBAA0B,SAAQ,2BAA2B;CAAG;AAEjF,qBACa,iBAAkB,SAAQ,QAAQ;IAIvC,MAAM,CAAa,KAAK,EAAE,SAAS;CAC1C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DtoCaptchaVerify } from 'vona-module-a-captcha';
|
|
2
|
+
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
3
|
+
export interface IDtoOptionsSignin extends IDecoratorDtoOptions {
|
|
4
|
+
}
|
|
5
|
+
export declare class DtoSignin {
|
|
6
|
+
username: string;
|
|
7
|
+
password: string;
|
|
8
|
+
captcha: DtoCaptchaVerify;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=signin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signin.d.ts","sourceRoot":"","sources":["../../src/dto/signin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAK9D,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB;CAAG;AAElE,qBACa,SAAS;IAEpB,QAAQ,EAAE,MAAM,CAAC;IAGjB,QAAQ,EAAE,MAAM,CAAC;IAGjB,OAAO,EAAE,gBAAgB,CAAC;CAC3B"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { BeanInfo, BeanBase, BeanScopeBase } from 'vona';
|
|
2
|
+
import { __decorate, __metadata, __param } from 'tslib';
|
|
3
|
+
import { Api, v } from 'vona-module-a-openapiutils';
|
|
4
|
+
import { Dto, Web, Arg, Controller } from 'vona-module-a-web';
|
|
5
|
+
import { Core } from 'vona-module-a-core';
|
|
6
|
+
import { Passport } from 'vona-module-a-user';
|
|
7
|
+
import { Scope } from 'vona-module-a-bean';
|
|
8
|
+
|
|
9
|
+
let DtoSignin = class DtoSignin {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.username = void 0;
|
|
12
|
+
this.password = void 0;
|
|
13
|
+
this.captcha = void 0;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
__decorate([Api.field(), __metadata("design:type", String)], DtoSignin.prototype, "username", void 0);
|
|
17
|
+
__decorate([Api.field(v.min(3)), __metadata("design:type", String)], DtoSignin.prototype, "password", void 0);
|
|
18
|
+
__decorate([Api.field(v.component('captcha')), __metadata("design:type", Function)], DtoSignin.prototype, "captcha", void 0);
|
|
19
|
+
DtoSignin = __decorate([Dto(), BeanInfo({
|
|
20
|
+
module: "test-captcha"
|
|
21
|
+
})], DtoSignin);
|
|
22
|
+
|
|
23
|
+
let ControllerCaptcha = class ControllerCaptcha extends BeanBase {
|
|
24
|
+
async signin(_user) {}
|
|
25
|
+
};
|
|
26
|
+
__decorate([Web.post('signin'), Passport.public(), Core.captchaVerify({
|
|
27
|
+
scene: 'captcha-simple:simple'
|
|
28
|
+
}), __param(0, Arg.body()), __metadata("design:type", Function), __metadata("design:paramtypes", [DtoSignin]), __metadata("design:returntype", Promise)], ControllerCaptcha.prototype, "signin", null);
|
|
29
|
+
ControllerCaptcha = __decorate([Controller({
|
|
30
|
+
path: 'captcha',
|
|
31
|
+
meta: {
|
|
32
|
+
mode: ['test', 'dev']
|
|
33
|
+
}
|
|
34
|
+
}), BeanInfo({
|
|
35
|
+
module: "test-captcha"
|
|
36
|
+
})], ControllerCaptcha);
|
|
37
|
+
|
|
38
|
+
let ScopeModuleTestCaptcha = class ScopeModuleTestCaptcha extends BeanScopeBase {};
|
|
39
|
+
ScopeModuleTestCaptcha = __decorate([Scope(), BeanInfo({
|
|
40
|
+
module: "test-captcha"
|
|
41
|
+
})], ScopeModuleTestCaptcha);
|
|
42
|
+
/** scope: end */
|
|
43
|
+
|
|
44
|
+
export { ControllerCaptcha, DtoSignin, ScopeModuleTestCaptcha };
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/dto/signin.ts","../src/controller/captcha.ts","../src/.metadata/index.ts"],"sourcesContent":[null,null,null],"names":["DtoSignin","constructor","username","password","captcha","__decorate","Api","field","prototype","v","min","component","Dto","__z_BeanInfo","module","ControllerCaptcha","BeanBase","signin","_user","Web","post","Passport","public","Core","captchaVerify","scene","__param","Arg","body","Controller","path","meta","mode","ScopeModuleTestCaptcha","BeanScopeBase","Scope"],"mappings":";;;;;;;;AASO,IAAMA,SAAS,GAAf,MAAMA,SAAS,CAAA;EAAAC,WAAAA,GAAA;AAAA,IAAA,IAAA,CAEpBC,QAAQ,GAAA,MAAA;AAAA,IAAA,IAAA,CAGRC,QAAQ,GAAA,MAAA;AAAA,IAAA,IAAA,CAGRC,OAAO,GAAA,MAAA;AAAA,EAAA;;AANPC,UAAA,CAAA,CADCC,GAAG,CAACC,KAAK,EAAE,oCACK,EAAAP,SAAA,CAAAQ,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAGjBH,UAAA,CAAA,CADCC,GAAG,CAACC,KAAK,CAACE,CAAC,CAACC,GAAG,CAAC,CAAC,CAAC,CAAC,oCACH,EAAAV,SAAA,CAAAQ,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAGjBH,UAAA,CAAA,CADCC,GAAG,CAACC,KAAK,CAACE,CAAC,CAACE,SAAS,CAAC,SAAS,CAAC,CAAC,sCACR,EAAAX,SAAA,CAAAQ,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AARfR,SAAS,GAAAK,UAAA,CAAA,CADrBO,GAAG,EAAqB,EAAAC,QAAA,CAAA;EA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
|
+
"assets",
|
|
11
|
+
"dist",
|
|
12
|
+
"src"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": [
|
|
18
|
+
"./src/index.ts",
|
|
19
|
+
"./dist/index.d.ts"
|
|
20
|
+
],
|
|
21
|
+
"default": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./package.json": "./package.json"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"clean": "rimraf dist tsconfig.build.tsbuildinfo",
|
|
27
|
+
"tsc:publish": "npm run clean && vona :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
28
|
+
"prepublishOnly": "npm run tsc:publish",
|
|
29
|
+
"prepack": "clean-package",
|
|
30
|
+
"postpack": "clean-package restore && npm run clean"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {},
|
|
33
|
+
"title": "test-captcha",
|
|
34
|
+
"vonaModule": {
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"a-vona": "5.0.0"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"gitHead": "991189da4443b789fcf77872990b901ccf43bccb"
|
|
40
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// eslint-disable
|
|
2
|
+
import type { TypeSymbolKeyFieldsMore } from 'vona-module-a-orm';
|
|
3
|
+
import type { TypeEntityOptionsFields,TypeControllerOptionsActions } from 'vona-module-a-openapi';
|
|
4
|
+
/** dto: begin */
|
|
5
|
+
export * from '../dto/signin.ts';
|
|
6
|
+
import type { IDtoOptionsSignin } from '../dto/signin.ts';
|
|
7
|
+
import 'vona-module-a-web';
|
|
8
|
+
declare module 'vona-module-a-web' {
|
|
9
|
+
|
|
10
|
+
export interface IDtoRecord {
|
|
11
|
+
'test-captcha:signin': IDtoOptionsSignin;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
declare module 'vona-module-test-captcha' {
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
/** dto: end */
|
|
20
|
+
/** dto: begin */
|
|
21
|
+
import type { DtoSignin } from '../dto/signin.ts';
|
|
22
|
+
declare module 'vona-module-test-captcha' {
|
|
23
|
+
|
|
24
|
+
export interface IDtoOptionsSignin {
|
|
25
|
+
fields?: TypeEntityOptionsFields<DtoSignin, IDtoOptionsSignin[TypeSymbolKeyFieldsMore]>;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/** dto: end */
|
|
29
|
+
/** controller: begin */
|
|
30
|
+
export * from '../controller/captcha.ts';
|
|
31
|
+
import type { IControllerOptionsCaptcha } from '../controller/captcha.ts';
|
|
32
|
+
import 'vona-module-a-web';
|
|
33
|
+
declare module 'vona-module-a-web' {
|
|
34
|
+
|
|
35
|
+
export interface IControllerRecord {
|
|
36
|
+
'test-captcha:captcha': IControllerOptionsCaptcha;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
declare module 'vona-module-test-captcha' {
|
|
42
|
+
|
|
43
|
+
export interface ControllerCaptcha {
|
|
44
|
+
/** @internal */
|
|
45
|
+
get scope(): ScopeModuleTestCaptcha;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface ControllerCaptcha {
|
|
49
|
+
get $beanFullName(): 'test-captcha.controller.captcha';
|
|
50
|
+
get $onionName(): 'test-captcha:captcha';
|
|
51
|
+
get $onionOptions(): IControllerOptionsCaptcha;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** controller: end */
|
|
55
|
+
/** controller: begin */
|
|
56
|
+
// @ts-ignore ignore
|
|
57
|
+
import type { ControllerCaptcha } from '../controller/captcha.ts';
|
|
58
|
+
declare module 'vona-module-test-captcha' {
|
|
59
|
+
|
|
60
|
+
export interface IControllerOptionsCaptcha {
|
|
61
|
+
actions?: TypeControllerOptionsActions<ControllerCaptcha>;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
declare module 'vona-module-a-web' {
|
|
65
|
+
export interface IApiPathPostRecord{
|
|
66
|
+
'/test/captcha/signin': undefined;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** controller: end */
|
|
72
|
+
/** scope: begin */
|
|
73
|
+
import { BeanScopeBase, type BeanScopeUtil } from 'vona';
|
|
74
|
+
import { Scope } from 'vona-module-a-bean';
|
|
75
|
+
|
|
76
|
+
@Scope()
|
|
77
|
+
export class ScopeModuleTestCaptcha extends BeanScopeBase {}
|
|
78
|
+
|
|
79
|
+
export interface ScopeModuleTestCaptcha {
|
|
80
|
+
util: BeanScopeUtil;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
import 'vona';
|
|
84
|
+
declare module 'vona' {
|
|
85
|
+
export interface IBeanScopeRecord {
|
|
86
|
+
'test-captcha': ScopeModuleTestCaptcha;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface IBeanScopeContainer {
|
|
90
|
+
testCaptcha: ScopeModuleTestCaptcha;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
}
|
|
99
|
+
/** scope: end */
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IDecoratorControllerOptions } from 'vona-module-a-web';
|
|
2
|
+
|
|
3
|
+
import { BeanBase } from 'vona';
|
|
4
|
+
import { Core } from 'vona-module-a-core';
|
|
5
|
+
import { Passport } from 'vona-module-a-user';
|
|
6
|
+
import { Arg, Controller, Web } from 'vona-module-a-web';
|
|
7
|
+
|
|
8
|
+
import { DtoSignin } from '../dto/signin.ts';
|
|
9
|
+
|
|
10
|
+
export interface IControllerOptionsCaptcha extends IDecoratorControllerOptions {}
|
|
11
|
+
|
|
12
|
+
@Controller<IControllerOptionsCaptcha>({ path: 'captcha', meta: { mode: ['test', 'dev'] } })
|
|
13
|
+
export class ControllerCaptcha extends BeanBase {
|
|
14
|
+
@Web.post('signin')
|
|
15
|
+
@Passport.public()
|
|
16
|
+
@Core.captchaVerify({ scene: 'captcha-simple:simple' })
|
|
17
|
+
async signin(@Arg.body() _user: DtoSignin) {}
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DtoCaptchaVerify } from 'vona-module-a-captcha';
|
|
2
|
+
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
3
|
+
|
|
4
|
+
import { Api, v } from 'vona-module-a-openapiutils';
|
|
5
|
+
import { Dto } from 'vona-module-a-web';
|
|
6
|
+
|
|
7
|
+
export interface IDtoOptionsSignin extends IDecoratorDtoOptions {}
|
|
8
|
+
|
|
9
|
+
@Dto<IDtoOptionsSignin>()
|
|
10
|
+
export class DtoSignin {
|
|
11
|
+
@Api.field()
|
|
12
|
+
username: string;
|
|
13
|
+
|
|
14
|
+
@Api.field(v.min(3))
|
|
15
|
+
password: string;
|
|
16
|
+
|
|
17
|
+
@Api.field(v.component('captcha'))
|
|
18
|
+
captcha: DtoCaptchaVerify;
|
|
19
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './.metadata/index.ts';
|