fix(all): Minor changes in PROD.

This commit is contained in:
Rodrigo Rodriguez 2023-07-13 14:13:48 -03:00
parent b7f78d936f
commit 671fe0cc3e
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,5 @@
/*****************************************************************************\
| ( )_ _ |
| _ _ _ __ _ _ __ ___ ___ _ _ | ,_)(_) ___ ___ _ |
@ -88,6 +90,7 @@ export class GBAdminService implements IGBAdminService {
}
public static async getADALCredentialsFromUsername(username: string, password: string) {
return await msRestAzure.loginWithUsernamePassword(username, password);
}

View file

@ -311,7 +311,8 @@ export class GBSSR {
if (!Fs.existsSync(path)) {
path = DialogKeywords.getGBAIPath(minBoot.botId, `gbui`);
}
const url = req.url.replace(`/${botId}`, '');
let parts = req.url.replace(`/${botId}`, '').split('?');
let url = parts[0];
if (min && req.originalUrl && prerender && exclude) {
@ -335,12 +336,13 @@ export class GBSSR {
if (GBServer.globals.wwwroot && url === '/') {
path = GBServer.globals.wwwroot + "/index.html"; // TODO.
}
if (!min) {
if (!min && !url.startsWith("/static")) {
path = Path.join(GBServer.globals.wwwroot, url);
}
if (Fs.existsSync(path)) {
if (min) {
let html = Fs.readFileSync(path, 'utf8');
html = html.replace(/\{p\}/gi, min.botId);
html = html.replace(/\{botId\}/gi, min.botId);
html = html.replace(/\{theme\}/gi, min.instance.theme ? min.instance.theme :
'default.gbtheme');