perf: ucloud支持部署到alb

This commit is contained in:
xiaojunnuo
2026-01-27 19:25:50 +08:00
parent 640950d4c8
commit 78004bdfb5
6 changed files with 434 additions and 73 deletions
@@ -74,14 +74,14 @@ export class UCloudAccess extends BaseAccess {
}
async getClient() {
async getClient(region?:string) {
if (this.client) {
return this.client;
}
const { Client } = await import('@ucloud-sdks/ucloud-sdk-js');
const client = new Client({
config: {
region: 'cn-bj2',
region: region || 'cn-bj2',
projectId: this.projectId || "",
baseUrl: "https://api.ucloud.cn"
},
@@ -108,7 +108,7 @@ export class UCloudAccess extends BaseAccess {
const res = await client.uaccount().getRegion({
"Action": "GetRegion"
});
this.ctx.logger.info(`获取到区域列表:${JSON.stringify(res)}`);
// this.ctx.logger.info(`获取到区域列表:${JSON.stringify(res)}`);
return res;
}
@@ -212,7 +212,7 @@ export class UCloudAccess extends BaseAccess {
const resp = await client.invoke(new Request({
...req
}));
this.ctx.logger.info(`请求UCloud API:${JSON.stringify(resp)}`);
// this.ctx.logger.info(`请求UCloud API:${JSON.stringify(resp)}`);
const res = resp.data || {}
if (res.RetCode !== 0) {
throw new Error(res.Message)