|
@@ -14,7 +14,6 @@ class PatentService extends CrudService {
|
|
constructor(ctx) {
|
|
constructor(ctx) {
|
|
super(ctx, 'patent');
|
|
super(ctx, 'patent');
|
|
this.model = this.ctx.model.Patent;
|
|
this.model = this.ctx.model.Patent;
|
|
-
|
|
|
|
this.root_path = _.get(this.ctx.app.config.export, 'root_path');
|
|
this.root_path = _.get(this.ctx.app.config.export, 'root_path');
|
|
this.file_type = '';
|
|
this.file_type = '';
|
|
if (!fs.existsSync(`${this.root_path}${this.file_type}`)) {
|
|
if (!fs.existsSync(`${this.root_path}${this.file_type}`)) {
|
|
@@ -28,6 +27,7 @@ class PatentService extends CrudService {
|
|
|
|
|
|
async toImport({ uri, origin }) {
|
|
async toImport({ uri, origin }) {
|
|
assert(uri, '未获取到文件地址');
|
|
assert(uri, '未获取到文件地址');
|
|
|
|
+ console.log(`${this.domain}${uri}`);
|
|
const file = await this.ctx.curl(`${this.domain}${uri}`);
|
|
const file = await this.ctx.curl(`${this.domain}${uri}`);
|
|
if (!(file && file.data)) {
|
|
if (!(file && file.data)) {
|
|
throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到指定文件');
|
|
throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到指定文件');
|