Web: Common: add session lifetime
This commit is contained in:
parent
46b98bc243
commit
883cc628ea
@ -93,6 +93,13 @@ export function setCookieSettings(lifeTime) {
|
||||
});
|
||||
}
|
||||
|
||||
export function getCookieSettings() {
|
||||
return request({
|
||||
method: "get",
|
||||
url: "/settings/cookiesettings.json",
|
||||
});
|
||||
}
|
||||
|
||||
export function setLifetimeAuditSettings(data) {
|
||||
return request({
|
||||
method: "post",
|
||||
|
@ -56,6 +56,7 @@ class AuthStore {
|
||||
this.settingsStore.getPortalPasswordSettings();
|
||||
this.tfaStore.getTfaType();
|
||||
this.settingsStore.getIpRestrictions();
|
||||
this.settingsStore.getSessionLifetime();
|
||||
}
|
||||
|
||||
return Promise.all(requests);
|
||||
|
@ -33,6 +33,7 @@ class SettingsStore {
|
||||
trustedDomainsType = 0;
|
||||
ipRestrictionEnable = false;
|
||||
ipRestrictions = [];
|
||||
sessionLifetime = "1440";
|
||||
timezone = "UTC";
|
||||
timezones = [];
|
||||
utcOffset = "00:00:00";
|
||||
@ -480,6 +481,16 @@ class SettingsStore {
|
||||
await api.settings.setMessageSettings(turnOn);
|
||||
this.enableAdmMess = turnOn;
|
||||
};
|
||||
|
||||
getSessionLifetime = async () => {
|
||||
const res = await api.settings.getSessionLifetime();
|
||||
this.sessionLifetime = res;
|
||||
};
|
||||
|
||||
setSessionLifetimeSettings = async (lifeTime) => {
|
||||
const res = await api.settings.setCookieSettings(lifeTime);
|
||||
this.sessionLifetime = lifeTime;
|
||||
};
|
||||
}
|
||||
|
||||
export default SettingsStore;
|
||||
|
Loading…
Reference in New Issue
Block a user