befly-admin 3.15.6 → 3.15.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/plugins/config.js +1 -0
- package/src/plugins/http.js +2 -2
- package/src/plugins/router.js +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "befly-admin",
|
|
3
|
-
"version": "3.15.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "3.15.7",
|
|
4
|
+
"gitHead": "3c088ebee92793df7641217a4566cca7875134f2",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Befly Admin - 基于 Vue3 + TDesign Vue Next 的后台管理系统",
|
|
7
7
|
"files": [
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"preview": "bunx --bun befly-vite preview"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"befly-admin-ui": "^1.9.
|
|
31
|
+
"befly-admin-ui": "^1.9.5",
|
|
32
32
|
"befly-shared": "^2.0.6",
|
|
33
33
|
"befly-vite": "^1.5.31",
|
|
34
34
|
"pinia": "^3.0.4",
|
package/src/plugins/config.js
CHANGED
package/src/plugins/http.js
CHANGED
|
@@ -9,7 +9,7 @@ async function redirectToLogin() {
|
|
|
9
9
|
|
|
10
10
|
redirecting = true;
|
|
11
11
|
try {
|
|
12
|
-
localStorage.removeItem(
|
|
12
|
+
localStorage.removeItem($Config.tokenName);
|
|
13
13
|
|
|
14
14
|
const current = (window.location.hash || "").replace(/^#/, "");
|
|
15
15
|
const currentPath = current.split("?")[0] || "/";
|
|
@@ -30,7 +30,7 @@ async function redirectToLogin() {
|
|
|
30
30
|
|
|
31
31
|
export const $Http = createHttp({
|
|
32
32
|
apiPath: $Config.apiPath,
|
|
33
|
-
getToken: () => localStorage.getItem(
|
|
33
|
+
getToken: () => localStorage.getItem($Config.tokenName) ?? "",
|
|
34
34
|
onReturn: async (payload) => {
|
|
35
35
|
if (payload?.reason === "auth") {
|
|
36
36
|
await redirectToLogin();
|
package/src/plugins/router.js
CHANGED
|
@@ -42,7 +42,7 @@ export const $Router = createRouter({
|
|
|
42
42
|
|
|
43
43
|
// 路由守卫 - 基础鉴权(最小实现:public 放行;未登录跳登录;已登录访问登录页跳首页)
|
|
44
44
|
$Router.beforeEach((to, _from) => {
|
|
45
|
-
const token = localStorage.getItem(
|
|
45
|
+
const token = localStorage.getItem($Config.tokenName);
|
|
46
46
|
const toPath = to.path;
|
|
47
47
|
|
|
48
48
|
// 根路径:按是否登录分流(兜底,避免 / 永远重定向到首页)
|