фича: автообновление сессии
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
}
|
||||
|
||||
this.submitStatus.{{ g['group'] }} = true
|
||||
fetch('/api/set/{{ g["group"] }}', {method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify(query) })
|
||||
fetch('/api/set/{{ g["group"] }}', {method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify(query), credentials: 'same-origin' })
|
||||
.then(async (resp) => { let vals = await resp.json(); if (vals['status'] !== 'ok') { throw new Error(vals['error'] ? vals['error'] : "Server returns undefined error") } this.update{{ g['group'] | title }}Settings(vals) })
|
||||
.catch((reason) => { alert(`Ошибка при применении настроек: ${reason}`) })
|
||||
.finally(() => { this.submitStatus.{{ g['group'] }} = false })
|
||||
|
@@ -93,7 +93,7 @@
|
||||
|
||||
resetPacketsStatistics() {
|
||||
fetch('/api/resetPacketStatistics', {
|
||||
method: 'POST'
|
||||
method: 'POST', credentials: 'same-origin'
|
||||
}).then(() => {
|
||||
this.statRx.packetsOk = 0
|
||||
this.statRx.packetsBad = 0
|
||||
|
@@ -60,7 +60,7 @@
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(query)
|
||||
body: JSON.stringify(query), credentials: 'same-origin'
|
||||
}).then(async (resp) => {
|
||||
this.submitStatusQos = false
|
||||
if (resp['error']) { throw new Error(resp['error']) }
|
||||
|
@@ -191,7 +191,7 @@
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
let d = await fetch("/api/get/statistics")
|
||||
let d = await fetch("/api/get/statistics", { credentials: 'same-origin' })
|
||||
this.updateStatistics(await d.json())
|
||||
} catch (e) {
|
||||
this.initState = "Ошибка обновления статистики"
|
||||
|
Reference in New Issue
Block a user