oak-external-sdk/lib/ALiYunSDK.js

24 lines
744 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ALiYunInstance = void 0;
const Ali_1 = require("./service/ali/Ali");
Object.defineProperty(exports, "ALiYunInstance", { enumerable: true, get: function () { return Ali_1.ALiYunInstance; } });
class ALiYunSDK {
aliMap; //oss
constructor() {
this.aliMap = {};
}
getInstance(accessKey, accessSecret) {
if (this.aliMap[accessKey]) {
return this.aliMap[accessKey];
}
const instance = new Ali_1.ALiYunInstance(accessKey, accessSecret);
Object.assign(this.aliMap, {
[accessKey]: instance,
});
return instance;
}
}
const SDK = new ALiYunSDK();
exports.default = SDK;