(config: { app_id: string; api_key: string; secret_key: string })
| 40 | } |
| 41 | |
| 42 | setUp(config: { app_id: string; api_key: string; secret_key: string }) { |
| 43 | if (!examToken(config)) { |
| 44 | //修复config无效时依然client不为undefined |
| 45 | this.client = undefined; |
| 46 | } else { |
| 47 | const { app_id, api_key, secret_key } = config; |
| 48 | const AipOcrClient = require("baidu-aip-sdk").ocr; |
| 49 | this.client = new AipOcrClient(app_id, api_key, secret_key); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | capture() { |
| 54 | this.getShortcutCapture().shortcutCapture(); |