21 lines
585 B
JavaScript
21 lines
585 B
JavaScript
import { TencentYunInstance } from './service/tencent/Tencent';
|
|
class TencentYunSDK {
|
|
tencentMap; //oss
|
|
constructor() {
|
|
this.tencentMap = {};
|
|
}
|
|
getInstance(accessKey, accessSecret) {
|
|
if (this.tencentMap[accessKey]) {
|
|
return this.tencentMap[accessKey];
|
|
}
|
|
const instance = new TencentYunInstance(accessKey, accessSecret);
|
|
Object.assign(this.tencentMap, {
|
|
[accessKey]: instance,
|
|
});
|
|
return instance;
|
|
}
|
|
}
|
|
const SDK = new TencentYunSDK();
|
|
export default SDK;
|
|
export { TencentYunInstance };
|