mirror of
https://github.com/certd/certd.git
synced 2025-11-25 09:10:11 +08:00
chore: 新网dns完善
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { Inject, Provide, Scope, ScopeEnum } from "@midwayjs/core";
|
||||
import { PlusService } from "./plus-service.js";
|
||||
import { IOcrService } from "@certd/plugin-lib";
|
||||
|
||||
/**
|
||||
*/
|
||||
@Provide("ocrService")
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
export class OcrService implements IOcrService {
|
||||
@Inject()
|
||||
plusService: PlusService;
|
||||
|
||||
async doOcrFromImage(opts: { image: string }): Promise<{ texts: string[] }> {
|
||||
const res = await this.plusService.requestWithToken({
|
||||
url: "/activation/certd/ocr",
|
||||
method: "post",
|
||||
data: {
|
||||
image: opts.image
|
||||
}
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import { cache, http, HttpRequestConfig, logger } from '@certd/basic';
|
||||
import { SysInstallInfo, SysLicenseInfo, SysSettingsService } from '../../settings/index.js';
|
||||
import { merge } from 'lodash-es';
|
||||
|
||||
@Provide()
|
||||
@Provide("plusService")
|
||||
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
||||
export class PlusService {
|
||||
@Inject()
|
||||
|
||||
Reference in New Issue
Block a user