重构代码, 移除一些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} min
* @param {number} max * @param {number} max
* @returns {boolean} * @returns {boolean}
* @memberof Number
*/ */
between?(min: number, max: number): boolean; between?(min: number, max: number): boolean;
} }
@ -207,7 +206,6 @@ interface String {
/** /**
* {0}{1}{2}{a} {b}obj对应key替换key的数据替换 * {0}{1}{2}{a} {b}obj对应key替换key的数据替换
*/ */
substitute?(...args: any): string;
substitute?(args: any[]): string; substitute?(args: any[]): string;
/** /**
* 0 * 0

View File

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

View File

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

View File

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

View File

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