@jx3box/jx3box-common-ui 8.2.16 → 8.2.17
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/manage.vue +6 -4
- package/src/header/user.vue +16 -10
- package/src/header/userInfo.vue +4 -4
package/package.json
CHANGED
package/src/header/manage.vue
CHANGED
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
</template>
|
|
25
25
|
|
|
26
26
|
<script>
|
|
27
|
-
import User from "@jx3box/jx3box-common/js/user";
|
|
28
27
|
import panel from "../../assets/data/panel.json";
|
|
29
28
|
import { getMenu } from "../../service/header";
|
|
30
29
|
import { __imgPath } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
@@ -35,6 +34,12 @@ export default {
|
|
|
35
34
|
panel,
|
|
36
35
|
};
|
|
37
36
|
},
|
|
37
|
+
props: {
|
|
38
|
+
isTeammate: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
38
43
|
computed: {
|
|
39
44
|
userPanel: function () {
|
|
40
45
|
return this.panel.filter((item) => {
|
|
@@ -46,9 +51,6 @@ export default {
|
|
|
46
51
|
return item.onlyAdmin;
|
|
47
52
|
});
|
|
48
53
|
},
|
|
49
|
-
isTeammate() {
|
|
50
|
-
return JSON.parse(sessionStorage.getItem("is_teammate"));
|
|
51
|
-
},
|
|
52
54
|
},
|
|
53
55
|
mounted() {
|
|
54
56
|
this.loadPanel();
|
package/src/header/user.vue
CHANGED
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
<asset :asset="asset" />
|
|
18
18
|
|
|
19
19
|
<!-- manage -->
|
|
20
|
-
<manage />
|
|
20
|
+
<manage :isTeammate="isTeammate" />
|
|
21
21
|
|
|
22
22
|
<!-- 语言切换 -->
|
|
23
23
|
<!-- <lang-switch /> -->
|
|
24
24
|
|
|
25
25
|
<!-- user info -->
|
|
26
|
-
<user-info :asset="asset" @logout="logout" />
|
|
26
|
+
<user-info :asset="asset" @logout="logout" @update="update" />
|
|
27
27
|
</template>
|
|
28
28
|
<template v-else>
|
|
29
29
|
<div class="c-header-login">
|
|
@@ -43,12 +43,12 @@ import dayjs from "dayjs";
|
|
|
43
43
|
import isToday from "dayjs/plugin/isToday";
|
|
44
44
|
dayjs.extend(isToday);
|
|
45
45
|
|
|
46
|
-
import message from "./message.vue"
|
|
47
|
-
import publish from "./publish.vue"
|
|
48
|
-
import vip from "./vip.vue"
|
|
49
|
-
import asset from "./asset.vue"
|
|
50
|
-
import manage from "./manage.vue"
|
|
51
|
-
import userInfo from
|
|
46
|
+
import message from "./message.vue";
|
|
47
|
+
import publish from "./publish.vue";
|
|
48
|
+
import vip from "./vip.vue";
|
|
49
|
+
import asset from "./asset.vue";
|
|
50
|
+
import manage from "./manage.vue";
|
|
51
|
+
import userInfo from "./userInfo.vue";
|
|
52
52
|
// import langSwitch from "./langSwitch.vue";
|
|
53
53
|
import shop from "./shop.vue";
|
|
54
54
|
export default {
|
|
@@ -60,7 +60,7 @@ export default {
|
|
|
60
60
|
manage,
|
|
61
61
|
userInfo,
|
|
62
62
|
// langSwitch,
|
|
63
|
-
shop
|
|
63
|
+
shop,
|
|
64
64
|
},
|
|
65
65
|
data: function () {
|
|
66
66
|
return {
|
|
@@ -83,6 +83,8 @@ export default {
|
|
|
83
83
|
// 链接
|
|
84
84
|
login_url: __Links.account.login + "?redirect=" + location.href,
|
|
85
85
|
register_url: __Links.account.register + "?redirect=" + location.href,
|
|
86
|
+
|
|
87
|
+
isTeammate: false,
|
|
86
88
|
};
|
|
87
89
|
},
|
|
88
90
|
methods: {
|
|
@@ -133,7 +135,7 @@ export default {
|
|
|
133
135
|
// 初始化
|
|
134
136
|
init: function () {
|
|
135
137
|
if (this.isLogin) {
|
|
136
|
-
this.loadAsset(
|
|
138
|
+
this.loadAsset();
|
|
137
139
|
this.signIn();
|
|
138
140
|
}
|
|
139
141
|
},
|
|
@@ -142,6 +144,10 @@ export default {
|
|
|
142
144
|
logout: function () {
|
|
143
145
|
this.isLogin = false;
|
|
144
146
|
},
|
|
147
|
+
// 更新用户信息
|
|
148
|
+
update: function ({ is_teammate }) {
|
|
149
|
+
this.isTeammate = is_teammate;
|
|
150
|
+
},
|
|
145
151
|
},
|
|
146
152
|
created: function () {
|
|
147
153
|
this.init();
|
package/src/header/userInfo.vue
CHANGED
|
@@ -103,6 +103,7 @@ import { getMenu } from "../../service/header";
|
|
|
103
103
|
export default {
|
|
104
104
|
name: "info",
|
|
105
105
|
props: ["asset"],
|
|
106
|
+
emits: ["update"],
|
|
106
107
|
data() {
|
|
107
108
|
return {
|
|
108
109
|
isPhone: window.innerWidth < 768,
|
|
@@ -120,6 +121,7 @@ export default {
|
|
|
120
121
|
isSuperAuthor: false,
|
|
121
122
|
|
|
122
123
|
panel: [],
|
|
124
|
+
isTeammate: false,
|
|
123
125
|
};
|
|
124
126
|
},
|
|
125
127
|
computed: {
|
|
@@ -148,9 +150,6 @@ export default {
|
|
|
148
150
|
return item.onlyAdmin;
|
|
149
151
|
});
|
|
150
152
|
},
|
|
151
|
-
isTeammate() {
|
|
152
|
-
return JSON.parse(sessionStorage.getItem("is_teammate"));
|
|
153
|
-
},
|
|
154
153
|
pro_expire_date: function () {
|
|
155
154
|
return this.asset.pro_expire_date ? showDate(this.asset.pro_expire_date) : "-";
|
|
156
155
|
},
|
|
@@ -188,7 +187,8 @@ export default {
|
|
|
188
187
|
.then((data) => {
|
|
189
188
|
this.user = data;
|
|
190
189
|
this.isSuperAuthor = !!data.sign;
|
|
191
|
-
|
|
190
|
+
this.isTeammate = this.user?.is_teammate;
|
|
191
|
+
this.$emit("update", this.user);
|
|
192
192
|
})
|
|
193
193
|
.catch((err) => {
|
|
194
194
|
if (err?.data.code < -1) {
|