Fix WebUI

This commit is contained in:
Yukino Song
2025-05-28 03:47:29 +08:00
parent 03194a6fa3
commit b2ec048333
3 changed files with 16 additions and 4 deletions

View File

@@ -1387,7 +1387,7 @@ namespace confighttp {
sessionCookie = util::hex(crypto::hash(sessionCookieRaw + config::sunshine.salt)).to_string();
cookie_creation_time = std::chrono::steady_clock::now();
const SimpleWeb::CaseInsensitiveMultimap headers {
{ "Set-Cookie", "auth=" + sessionCookieRaw + "; Secure; Max-Age=2592000; Path=/" }
{ "Set-Cookie", "auth=" + sessionCookieRaw + "; Secure; SameSite=Strict; Max-Age=2592000; Path=/" }
};
response->write(headers);
fg.disable();

View File

@@ -379,8 +379,20 @@
});
});
this.global_prep_cmd = this.config.global_prep_cmd;
this.server_cmd = this.config.server_cmd;
if (this.platform === 'windows') {
this.global_prep_cmd = this.config.global_prep_cmd.map((i) => {
i.elevated = !!i.elevated
return i
});
this.server_cmd = this.config.server_cmd.map((i) => {
i.elevated = !!i.elevated
return i
});
} else {
this.global_prep_cmd = this.config.global_prep_cmd;
this.server_cmd = this.config.server_cmd;
}
});
},
methods: {

View File

@@ -101,7 +101,7 @@
const url = new URL(window.location);
const redirectUrl = url.searchParams.get('redir');
const hash = url.hash;
if (redirectUrl) {
if (redirectUrl && redirectUrl.startsWith('.')) {
location.href = redirectUrl + hash;
} else {
location.href = './' + hash;