sonar 4 left. cookie regex
This commit is contained in:
@@ -23,7 +23,7 @@ import Loading from '@/components/Loading.vue';
|
||||
import { leaveFilter, leaveConformance } from '@/module/alertModal.js';
|
||||
import PageAdminStore from '@/stores/pageAdmin.js';
|
||||
import LoginStore from "@/stores/login.ts";
|
||||
import { getCookie } from "../utils/cookieUtil.js";
|
||||
import { getCookie } from "@/utils/cookieUtil.js";
|
||||
import ModalContainer from './AccountManagement/ModalContainer.vue';
|
||||
|
||||
export default {
|
||||
@@ -87,7 +87,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
// Save token in Headers.
|
||||
const token = document.cookie.replace(/(?:(?:^|.*;\s*)luciaToken\s*=\s*([^;]*).*$)|^.*$/, "$1");
|
||||
const token = getCookie('luciaToken');
|
||||
this.$http.defaults.headers.common['Authorization'] = `Bearer ${token}`;
|
||||
},
|
||||
// 重新整理畫面以及第一次進入網頁時,beforeRouteEnter這個hook會被執行,然而beforeRouteUpdate不會被執行
|
||||
|
||||
Reference in New Issue
Block a user