重构代码, 移除一些warning

This commit is contained in:
zhl 2021-05-12 10:08:12 +08:00
parent f51fcc00d4
commit 5c4cecd820
5 changed files with 9 additions and 11 deletions

View File

@ -186,7 +186,6 @@ interface Number {
* @param {number} min
* @param {number} max
* @returns {boolean}
* @memberof Number
*/
between?(min: number, max: number): boolean;
}
@ -207,7 +206,6 @@ interface String {
/**
* {0}{1}{2}{a} {b}obj对应key替换key的数据替换
*/
substitute?(...args: any): string;
substitute?(args: any[]): string;
/**
* 0

View File

@ -39,11 +39,11 @@ export class FileServer {
}
private registerRouter() {
logger.log('register api routers');
logger.log('register file routers');
let self = this;
for (let [controller, config] of RouterMap.decoratedRouters) {
for(let data of config.data) {
logger.info('find api router', data.method || 'all',
logger.info('find file router', data.method || 'all',
data.path, controller.name);
// @ts-ignore
self.server[data.method || 'all'](data.path, {

View File

@ -14,6 +14,9 @@ declare module 'fastify' {
user?: any,
token?: string
}
interface FastifyInstance {
apiAuth: (request: FastifyRequest, reply: FastifyReply) => {};
}
}
export interface ApiAuthOptions {

View File

@ -15,6 +15,9 @@ declare module 'fastify' {
interface FastifyRequest {
jwtVerify: Function;
}
interface FastifyInstance {
zAuth: (request: FastifyRequest, reply: FastifyReply) => {};
}
}
const zAuthPlugin: FastifyPluginAsync = async function (

View File

@ -11,16 +11,10 @@ import { BaseConst } from '../constants/BaseConst'
import { QCategoryCache } from './QCategoryCache'
import { PuzzleSession } from '../models/match/PuzzleSession'
import { GameEnv } from '../config/GameEnv'
import { PuzzleRank } from '../models/match/PuzzleRank'
import { Shop } from '../models/shop/Shop'
import { mission_vo } from '../config/parsers/mission_vo'
import { ShopActivity } from '../models/shop/ShopActivity'
import {
getAccountRank,
getAccountScore,
getRankList,
updateRank
} from './Rank'
import { getAccountRank, getRankList, updateRank } from './Rank'
export function transformRecord(records: any[]) {