sonar 4 left. cookie regex

This commit is contained in:
Cindy Chang
2024-08-13 13:37:11 +08:00
parent 471d8273c1
commit db8f8eefd6
4 changed files with 8 additions and 5 deletions

View File

@@ -152,6 +152,7 @@ import { simpleTimeLabel, followTimeLabel,
} from '@/module/timeLabel.js';
import FreqChart from './FreqChart.vue';
import { PRIME_VUE_TICKS_LIMIT } from '../../../constants/constants.js';
import { getCookie } from "@/utils/cookieUtil.js";
const primeVueTicksLimit = PRIME_VUE_TICKS_LIMIT;
@@ -928,7 +929,7 @@ export default {
if (isCheckPage) {
const conformanceStore = ConformanceStore();
// Save token in Headers.
const token = document.cookie.replace(/(?:(?:^|.*;\s*)luciaToken\s*=\s*([^;]*).*$)|^.*$/, "$1");
const token = getCookie('luciaToken');
axios.defaults.headers.common['Authorization'] = `Bearer ${token}`;
switch (to.params.type) {