mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2025-12-11 00:22:49 +00:00
新增urlTag
This commit is contained in:
parent
880c3ff0de
commit
206151a016
@ -4,7 +4,7 @@
|
||||
"description": "",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@cool-midway/core": "^5.0.6",
|
||||
"@cool-midway/core": "^5.0.7",
|
||||
"@cool-midway/es": "^5.0.2",
|
||||
"@cool-midway/file": "^5.0.3",
|
||||
"@cool-midway/pay": "^5.0.0",
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import { Provide } from '@midwayjs/decorator';
|
||||
import { Get, Inject, Provide } from '@midwayjs/decorator';
|
||||
import {
|
||||
CoolController,
|
||||
BaseController,
|
||||
CoolUrlTag,
|
||||
TagTypes,
|
||||
CoolUrlTagData,
|
||||
} from '@cool-midway/core';
|
||||
|
||||
/**
|
||||
@ -16,7 +17,19 @@ import {
|
||||
pageQueryOp: () => {},
|
||||
})
|
||||
@CoolUrlTag({
|
||||
key: TagTypes.ignoreToken,
|
||||
value: [],
|
||||
key: TagTypes.IGNORE_TOKEN,
|
||||
value: ['add'],
|
||||
})
|
||||
export class DemoAppTagController extends BaseController {}
|
||||
export class DemoAppTagController extends BaseController {
|
||||
@Inject()
|
||||
tag: CoolUrlTagData;
|
||||
|
||||
/**
|
||||
* 获得标签数据, 如可以标记忽略token的url,然后在中间件判断
|
||||
* @returns
|
||||
*/
|
||||
@Get('/data')
|
||||
async data() {
|
||||
return this.ok(this.tag.byKey(TagTypes.IGNORE_TOKEN));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user