Skip to content

Commit 774ada3

Browse files
committed
fix auto domain
1 parent 01da2af commit 774ada3

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/impl/custom_domain.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ export class CustomDomain {
4949
if (!this.isAutoDomain()) {
5050
return;
5151
}
52-
const autoDomainName = this.getAutoDomainName();
53-
let functionName = this.getProps()['routeConfig']['routes'][0]['functionName'];
52+
const { autoDomainName, functionName } = this.getAutoDomainName();
5453
const userId = this.credentials.AccountID;
5554
const isResolve = await resolveCname(
5655
autoDomainName,
@@ -78,12 +77,14 @@ export class CustomDomain {
7877
}
7978

8079
private getAutoDomainName() {
80+
const logger = GLogger.getLogger();
8181
// 取第一个 path 中的 functionName
8282
let functionName = this.getProps()['routeConfig']['routes'][0]['functionName'];
8383
const userId = this.credentials.AccountID;
8484
functionName = functionName.replace(/_/g, '-').toLowerCase();
8585
let autoDomainName = `${functionName}.fcv3.${userId}.${this.region}.fc.devsapp.net`;
86-
return autoDomainName;
86+
logger.debug(`getAutoDomainName = ${autoDomainName}`);
87+
return { autoDomainName, functionName };
8788
}
8889

8990
public async cnameCheck(): Promise<boolean> {

0 commit comments

Comments
 (0)