mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
修复类型检查
This commit is contained in:
parent
5655591215
commit
2068ef7053
|
@ -45,11 +45,10 @@ export default ({ app }: { app: Application }) => {
|
|||
if (req.path.startsWith('/open/')) {
|
||||
const openService = Container.get(OpenService);
|
||||
const doc = await openService.findTokenByValue(headerToken);
|
||||
if (doc && doc.tokens.length > 0) {
|
||||
if (doc && doc.tokens && doc.tokens.length > 0) {
|
||||
const currentToken = doc.tokens.find((x) => x.value === headerToken);
|
||||
const key =
|
||||
req.path.match(/\/open\/([a-z]+)\/*/) &&
|
||||
req.path.match(/\/open\/([a-z]+)\/*/)[1];
|
||||
const keyMatch = req.path.match(/\/open\/([a-z]+)\/*/);
|
||||
const key = keyMatch && keyMatch[1];
|
||||
if (
|
||||
doc.scopes.includes(key as any) &&
|
||||
currentToken &&
|
||||
|
|
|
@ -169,7 +169,7 @@ run_designated() {
|
|||
local env_param="$2"
|
||||
local num_param=$(echo "$3" | perl -pe "s|.*$2 (.*)|\1|")
|
||||
if [[ ! $env_param ]] || [[ ! $num_param ]]; then
|
||||
echo -e "\n 缺少单独运行的参数 task xxx.js single Test 1"
|
||||
echo -e "\n 缺少单独运行的参数 task xxx.js desi Test 1 3"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user