befly-admin-ui 1.9.4 → 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.
package/layouts/default.vue
CHANGED
|
@@ -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 ${
|
|
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
|
-
|
|
247
|
+
$Store.local.remove($Config.tokenName);
|
|
247
248
|
await router.push($Config.loginPath);
|
|
248
249
|
MessagePlugin.success("退出成功");
|
|
249
250
|
destroy();
|
package/package.json
CHANGED
package/views/login_1/index.vue
CHANGED
|
@@ -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
|
-
|
|
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 ${
|
|
97
|
+
Authorization: `Bearer ${$Store.local.get($Config.tokenName, "")}`
|
|
97
98
|
};
|
|
98
99
|
|
|
99
100
|
const $Data = reactive({
|