refactor: remove unneeded variable and unify the way send token in header (#763)

This commit is contained in:
Monirzadeh 2023-10-17 16:36:55 +00:00 committed by GitHub
parent c05d617fbd
commit 106bf163ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -83,7 +83,6 @@ export default {
},
methods: {
saveSetting() {
var authToken = JSON.parse(localStorage.getItem("shiori-token"));
let options = {
ShowId: this.appOptions.ShowId,
ListMode: this.appOptions.ListMode,
@ -108,9 +107,10 @@ export default {
body: JSON.stringify({
config: this.appOptions
}),
headers: { "Content-Type": "application/json",
Authorization: `Bearer ${authToken}`,
},
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + localStorage.getItem("shiori-token"),
}
}).then(response => {
if (!response.ok) throw response;
return response.json();