mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2025-12-14 19:22:50 +00:00
新增urlTag
This commit is contained in:
parent
880c3ff0de
commit
206151a016
@ -4,7 +4,7 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cool-midway/core": "^5.0.6",
|
"@cool-midway/core": "^5.0.7",
|
||||||
"@cool-midway/es": "^5.0.2",
|
"@cool-midway/es": "^5.0.2",
|
||||||
"@cool-midway/file": "^5.0.3",
|
"@cool-midway/file": "^5.0.3",
|
||||||
"@cool-midway/pay": "^5.0.0",
|
"@cool-midway/pay": "^5.0.0",
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
import { Provide } from '@midwayjs/decorator';
|
import { Get, Inject, Provide } from '@midwayjs/decorator';
|
||||||
import {
|
import {
|
||||||
CoolController,
|
CoolController,
|
||||||
BaseController,
|
BaseController,
|
||||||
CoolUrlTag,
|
CoolUrlTag,
|
||||||
TagTypes,
|
TagTypes,
|
||||||
|
CoolUrlTagData,
|
||||||
} from '@cool-midway/core';
|
} from '@cool-midway/core';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -16,7 +17,19 @@ import {
|
|||||||
pageQueryOp: () => {},
|
pageQueryOp: () => {},
|
||||||
})
|
})
|
||||||
@CoolUrlTag({
|
@CoolUrlTag({
|
||||||
key: TagTypes.ignoreToken,
|
key: TagTypes.IGNORE_TOKEN,
|
||||||
value: [],
|
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