@jx3box/jx3box-common-ui 9.0.21 → 9.0.23
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 +1 -1
- package/src/header/alternate.vue +12 -5
package/package.json
CHANGED
package/src/header/alternate.vue
CHANGED
|
@@ -78,12 +78,19 @@ export default {
|
|
|
78
78
|
let keys = Object.keys(localStorage);
|
|
79
79
|
let alternate = keys.filter((key) => key.startsWith("jx3box-alternate-"));
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
alternate.forEach((key) => {
|
|
82
|
+
const item = JSON.parse(localStorage.getItem(key));
|
|
83
|
+
if (this.isExpired(item.created_at)) {
|
|
84
|
+
localStorage.removeItem(key);
|
|
85
|
+
}
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
if (!this.alternate.find((alt) => alt.uid == item.uid)) {
|
|
88
|
+
this.alternate.push(item);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// 如果当前没有马甲,添加当前登录用户
|
|
93
|
+
if (!this.alternate?.length) {
|
|
87
94
|
const data = {
|
|
88
95
|
uid: this.profile.uid,
|
|
89
96
|
name: this.profile.name,
|