sonar 41 left

This commit is contained in:
Cindy Chang
2024-08-02 11:15:15 +08:00
parent a33eaa3a41
commit 86cfb409c3
7 changed files with 33 additions and 21 deletions

View File

@@ -99,7 +99,7 @@ export default {
// .*$:匹配剩餘的字符,確保完整的提取。
// |^.*$:在找不到 "luciaToken" 的情況下,匹配整個字符串。
// 實際應用
const token = document.cookie.replace(/(?:(?:^|.*;\s*)luciaToken\s*\=\s*([^;]*).*$)|^.*$/, "$1");
const token = document.cookie.replace(/(?:(?:^|.*;\s*)luciaToken\s*=\s*([^;]*).*$)|^.*$/, "$1");
axios.defaults.headers.common['Authorization'] = `Bearer ${token}`;
switch (to.params.type) {