mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2024-11-01 22:20:30 +08:00
防止一些比较极端的情况下导致的类型错误
This commit is contained in:
parent
1654cc3c52
commit
868564e7c2
@ -1,13 +1,14 @@
|
|||||||
import { App, Provide } from '@midwayjs/decorator';
|
|
||||||
import { BaseService } from '@cool-midway/core';
|
import { BaseService } from '@cool-midway/core';
|
||||||
import * as ts from 'typescript';
|
import { IMidwayApplication, Inject } from '@midwayjs/core';
|
||||||
import { IMidwayApplication } from '@midwayjs/core';
|
import { App, Provide } from '@midwayjs/decorator';
|
||||||
import * as path from 'path';
|
|
||||||
import * as fs from 'fs';
|
|
||||||
import { InjectEntityModel } from '@midwayjs/typeorm';
|
import { InjectEntityModel } from '@midwayjs/typeorm';
|
||||||
import { Repository } from 'typeorm';
|
import * as fs from 'fs';
|
||||||
import { PluginInfoEntity } from '../entity/info';
|
import * as path from 'path';
|
||||||
import * as prettier from 'prettier';
|
import * as prettier from 'prettier';
|
||||||
|
import { Repository } from 'typeorm';
|
||||||
|
import * as ts from 'typescript';
|
||||||
|
import { Utils } from '../../../comm/utils';
|
||||||
|
import { PluginInfoEntity } from '../entity/info';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 插件类型服务
|
* 插件类型服务
|
||||||
@ -20,6 +21,9 @@ export class PluginTypesService extends BaseService {
|
|||||||
@InjectEntityModel(PluginInfoEntity)
|
@InjectEntityModel(PluginInfoEntity)
|
||||||
pluginInfoEntity: Repository<PluginInfoEntity>;
|
pluginInfoEntity: Repository<PluginInfoEntity>;
|
||||||
|
|
||||||
|
@Inject()
|
||||||
|
utils: Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成d.ts文件
|
* 生成d.ts文件
|
||||||
* @param tsContent
|
* @param tsContent
|
||||||
@ -238,6 +242,7 @@ export class PluginTypesService extends BaseService {
|
|||||||
const tsContent = pluginInfo.tsContent?.data;
|
const tsContent = pluginInfo.tsContent?.data;
|
||||||
if (tsContent) {
|
if (tsContent) {
|
||||||
await this.generateDtsFile(pluginInfo.keyName, tsContent);
|
await this.generateDtsFile(pluginInfo.keyName, tsContent);
|
||||||
|
await this.utils.sleep(200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user