befly-admin-ui 1.9.5 → 1.9.6

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.
@@ -83,10 +83,11 @@ import { reactive, watch } from "vue";
83
83
  import { useRoute, useRouter } from "vue-router";
84
84
  import { $Http } from "@/plugins/http.js";
85
85
  import { $Config } from "@/plugins/config.js";
86
+ import { $Store } from "@/plugins/store.js";
86
87
 
87
88
  const router = useRouter();
88
89
  const route = useRoute();
89
- const uploadHeaders = { Authorization: `Bearer ${localStorage.getItem($Config.tokenName) || ""}` };
90
+ const uploadHeaders = { Authorization: `Bearer ${$Store.local.get($Config.tokenName, "")}` };
90
91
 
91
92
  function isString(value) {
92
93
  return typeof value === "string";
@@ -243,7 +244,7 @@ async function handleLogout() {
243
244
  }
244
245
 
245
246
  try {
246
- localStorage.removeItem($Config.tokenName);
247
+ $Store.local.remove($Config.tokenName);
247
248
  await router.push($Config.loginPath);
248
249
  MessagePlugin.success("退出成功");
249
250
  destroy();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "befly-admin-ui",
3
- "version": "1.9.5",
4
- "gitHead": "3c088ebee92793df7641217a4566cca7875134f2",
3
+ "version": "1.9.6",
4
+ "gitHead": "5c05c5ec3616748021723a09de6514d27b0cf577",
5
5
  "private": false,
6
6
  "description": "Befly - 管理后台功能组件",
7
7
  "keywords": [
@@ -70,6 +70,7 @@ import { LockOnIcon, UserIcon } from "tdesign-icons-vue-next";
70
70
  import { hashPassword } from "befly-admin-ui/utils/hashPassword";
71
71
  import { $Http } from "@/plugins/http.js";
72
72
  import { $Config } from "@/plugins/config.js";
73
+ import { $Store } from "@/plugins/store.js";
73
74
 
74
75
  const router = useRouter();
75
76
 
@@ -109,7 +110,7 @@ async function apiLogin() {
109
110
  password: hashedPassword
110
111
  });
111
112
 
112
- localStorage.setItem($Config.tokenName, res.data.token);
113
+ $Store.local.set($Config.tokenName, res.data.token);
113
114
 
114
115
  MessagePlugin.success(res.msg || "登录成功");
115
116
 
@@ -91,9 +91,10 @@ import DetailPanel from "befly-admin-ui/components/detailPanel.vue";
91
91
  import PageTableDetail from "befly-admin-ui/components/pageTableDetail.vue";
92
92
  import { withDefaultColumns } from "befly-admin-ui/utils/withDefaultColumns";
93
93
  import { $Config } from "@/plugins/config.js";
94
+ import { $Store } from "@/plugins/store.js";
94
95
 
95
96
  const uploadHeaders = {
96
- Authorization: `Bearer ${localStorage.getItem($Config.tokenName) || ""}`
97
+ Authorization: `Bearer ${$Store.local.get($Config.tokenName, "")}`
97
98
  };
98
99
 
99
100
  const $Data = reactive({