@jx3box/jx3box-common-ui 6.9.7 → 6.9.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "6.9.7",
3
+ "version": "6.9.8",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/service/header.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import axios from "axios";
2
- import { $helper, $cms } from "@jx3box/jx3box-common/js/https.js";
2
+ import { $helper, $cms, $next } from "@jx3box/jx3box-common/js/https.js";
3
3
  import { __dataPath } from "@jx3box/jx3box-common/data/jx3box.json";
4
4
 
5
5
  function getMsg() {
6
- return $helper({ mute: true }).get("/api/messages/unread_total");
6
+ return $next({ mute: true }).get("/api/letter/unread/count");
7
7
  }
8
8
 
9
9
  function getNav(client = "std") {
@@ -24,7 +24,7 @@ function getMenu(key) {
24
24
  return $cms().get(`/api/cms/config/menu/${key}`);
25
25
  }
26
26
 
27
- function getGames(){
27
+ function getGames() {
28
28
  return axios.get(__dataPath + 'data/product/games.json')
29
29
  }
30
30
 
@@ -29,7 +29,7 @@ export default {
29
29
  // 消息
30
30
  checkMSG: function () {
31
31
  getMsg().then((res) => {
32
- this.pop = !!res.data.data.unread;
32
+ this.pop = !!(~~res.data.data.letter + ~~res.data.data.message);
33
33
  });
34
34
  },
35
35
  }
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="c-header-panel c-header-info">
3
3
  <div class="c-header-profile" id="c-header-profile">
4
- <img class="u-avatar" :src="user.avatar" />
4
+ <img class="u-avatar" :src="showAvatar(user.user_avatar)" />
5
5
  <template v-if="isPhone">
6
6
  <ul class="u-menu u-pop-content">
7
7
  <li>
@@ -29,8 +29,8 @@
29
29
  <div class="c-header-userdata u-pop-content">
30
30
  <div class="u-profile">
31
31
  <div class="u-basic">
32
- <a class="u-displayname" :href="url.homepage" :title="user.name" target="_blank">{{
33
- showUserName(user.name)
32
+ <a class="u-displayname" :href="url.homepage" :title="user.display_name" target="_blank">{{
33
+ showUserName(user.display_name)
34
34
  }}</a>
35
35
  <a class="u-sign" href="/dashboard/cooperation">
36
36
  <img
@@ -51,9 +51,9 @@
51
51
  </div>
52
52
  <div class="u-id">
53
53
  <span
54
- >魔盒UID:<b>{{ user.uid }}</b></span
54
+ >魔盒UID:<b>{{ user.ID }}</b></span
55
55
  >
56
- <i class="el-icon-document-copy u-copy" @click.stop="copyText(user.uid)"></i>
56
+ <i class="el-icon-document-copy u-copy" @click.stop="copyText(user.ID)"></i>
57
57
  </div>
58
58
  </div>
59
59
 
@@ -85,12 +85,13 @@
85
85
 
86
86
  <script>
87
87
  import User from "@jx3box/jx3box-common/js/user";
88
+ import { showAvatar } from "@jx3box/jx3box-common/js/utils";
88
89
  import { getMyInfo } from "../../service/author";
89
90
  import { __Links, __Root, __imgPath, __OriginRoot } from "@jx3box/jx3box-common/data/jx3box.json";
90
91
  import { copyText } from "../../assets/js/utils";
91
92
  export default {
92
93
  name: "info",
93
- props: ['asset'],
94
+ props: ["asset"],
94
95
  data() {
95
96
  return {
96
97
  isPhone: window.innerWidth < 768,
@@ -106,7 +107,7 @@ export default {
106
107
  },
107
108
 
108
109
  isSuperAuthor: false,
109
- }
110
+ };
110
111
  },
111
112
  computed: {
112
113
  siteRoot: function () {
@@ -122,10 +123,10 @@ export default {
122
123
  return User._isPRO(this.asset) || false;
123
124
  },
124
125
  isAdmin() {
125
- return User.isAdmin()
126
+ return User.isAdmin();
126
127
  },
127
128
  isEditor() {
128
- return User.isEditor()
129
+ return User.isEditor();
129
130
  },
130
131
  },
131
132
  mounted() {
@@ -133,10 +134,11 @@ export default {
133
134
  },
134
135
  methods: {
135
136
  copyText,
137
+ showAvatar,
136
138
  logout: function () {
137
139
  User.destroy()
138
140
  .then((res) => {
139
- this.$emit('logout')
141
+ this.$emit("logout");
140
142
  if (location.pathname.startsWith("/dashboard") || location.pathname.startsWith("/publish")) {
141
143
  location.href = this.siteRoot;
142
144
  }
@@ -154,10 +156,11 @@ export default {
154
156
  return val || "匿名";
155
157
  },
156
158
  loadMyInfo: function () {
157
- getMyInfo().then((res) => {
158
- this.isSuperAuthor = !!res.sign;
159
+ getMyInfo().then((data) => {
160
+ this.user = data;
161
+ this.isSuperAuthor = !!data.sign;
159
162
  });
160
163
  },
161
- }
162
- }
164
+ },
165
+ };
163
166
  </script>