Commit e930017a by 宋毅

tj

parent 0a38ebd3
......@@ -91,8 +91,8 @@ class TmQueryAPI extends WEBBase {
case "icheming"://商标智能分析 -----
opResult = await this.toolSve.icheming(action_body, req);
break;
case "tmreport"://商标报告
opResult=await this.tmquerySve.tmreport(action_body,req);
case "tmreport"://商标报告--TODO:后期将要迁移到center-service
opResult = await this.tmquerySve.tmreport(action_body, req);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
......
......@@ -34,7 +34,7 @@ class TmToolsAPI extends WEBBase {
case "decryptStr"://
opResult = await this.toolSve.decryptStr(req.app, action_body.opStr);
break;
case "getOssConfig"://
case "getOssConfig"://获取oss信息
opResult = await this.toolSve.getOssConfig();
break;
case "getNcl"://尼斯查询(一)
......
const system = require("../../../system");
var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
const crypto = require('crypto');
const cryptoJS = require("crypto-js");
var fs = require("fs");
var accesskey = 'DHmRtFlw2Zr3KaRwUFeiu7FWATnmla';
var accessKeyId = 'LTAIyAUK8AD04P5S';
var url = "https://gsb-zc.oss-cn-beijing.aliyuncs.com";
class ToolService {
class ToolService extends AppServiceBase {
constructor() {
super();
this.zcApiUrl = settings.reqZcApi();
this.execClient = system.getObject("util.execClient");
// this.execClient = system.getObject("util.execClient");
}
async getCropperPic(obj, req) {
var url = this.zcApiUrl + "api/tool/toolApi/getCropperPic";
......@@ -79,29 +78,11 @@ class ToolService {
return data;
}
async getOssConfig(queryobj, req) {
var policyText = {
"expiration": "2119-12-31T16:00:00.000Z",
"conditions": [
["content-length-range", 0, 1048576000],
["starts-with", "$key", "zc"]
]
};
var b = new Buffer(JSON.stringify(policyText));
var policyBase64 = b.toString('base64');
var signature = crypto.createHmac('sha1', accesskey).update(policyBase64).digest().toString('base64'); //base64
var data = {
OSSAccessKeyId: accessKeyId,
policy: policyBase64,
Signature: signature,
Bucket: 'gsb-zc',
success_action_status: 201,
url: url
};
return system.getResultSuccess(data);
};
async getOssConfig(pobj, req) {//获取oss信息
var reqUrl = settings.centerAppUrl() + "auth/accessAuth/getOssInfo";
var result = await this.restPostUrl(pobj, reqUrl);
return result;
}
//加密信息
async encryptStr(app, opStr) {
if (!opStr) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment