Issue #140: Done.

This commit is contained in:
chiayin
2023-10-13 17:58:47 +08:00
parent 1cfbddf510
commit cf3d799ed7
4 changed files with 191 additions and 39 deletions

View File

@@ -50,14 +50,11 @@ export default {
leaveFilter
},
created() {
/**
* Save token in Headers.
*/
// Save token in Headers.
const token = document.cookie.replace(/(?:(?:^|.*;\s*)luciaToken\s*\=\s*([^;]*).*$)|^.*$/, "$1");
this.$http.defaults.headers.common['Authorization'] = `Bearer ${token}`;
/**
* check login for 'my-account' api
*/
// check login for 'my-account' api
this.checkLogin();
},
beforeRouteUpdate(to, from, next) {