@jx3box/jx3box-common-ui 8.2.9 → 8.2.11

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": "8.2.9",
3
+ "version": "8.2.11",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/service/author.js CHANGED
@@ -48,8 +48,8 @@ function getDouyu(ids) {
48
48
  }
49
49
  // 获取用户勋章
50
50
  function getUserMedals(uid) {
51
- return $next({ mute: true })
52
- .get("/api/next2/user/" + uid + "/medals")
51
+ return $cms({ mute: true })
52
+ .get("/api/cms/user/medal/" + uid)
53
53
  .then((res) => {
54
54
  return res.data.data;
55
55
  });
@@ -1,10 +1,10 @@
1
1
  <template>
2
- <div class="c-author-honor" :style="{ backgroundImage: `url(${imgUrl()})` }" v-if="honor">
2
+ <a class="c-author-honor" :style="{ backgroundImage: `url(${imgUrl()})` }" v-if="honor" :href="url" target="_blank">
3
3
  <span v-if="!isJdt" :style="{ color: honor.color }">{{ honor.honor }}</span>
4
- </div>
4
+ </a>
5
5
  </template>
6
6
  <script>
7
- import { __imgPath } from "@jx3box/jx3box-common/data/jx3box.json";
7
+ import { __imgPath, __Root } from "@jx3box/jx3box-common/data/jx3box.json";
8
8
  import { getUserHonor } from "../../service/author";
9
9
  import { inRange } from "lodash";
10
10
  const HONOR_IMG_KEY = "honor_img";
@@ -27,6 +27,9 @@ export default {
27
27
  isJdt() {
28
28
  return this.honor?.honor_info?.img?.toLowerCase()?.includes("jdt");
29
29
  },
30
+ url() {
31
+ return this.honor?.honor_info?.url ? __Root + this.honor?.honor_info?.url : "";
32
+ }
30
33
  },
31
34
  methods: {
32
35
  imgUrl: function () {
@@ -101,7 +104,7 @@ export default {
101
104
  data.img = honorConfig.img;
102
105
  data.img_ext = honorConfig.img_ext;
103
106
  data.isHave = true;
104
- data.isImgIndex = ranking.length > 0;
107
+ data.isImgIndex = ranking?.length > 0;
105
108
  sessionStorage.setItem(HONOR_IMG_KEY + this.uid, JSON.stringify(data));
106
109
  this.honor = data;
107
110
  },
@@ -25,7 +25,7 @@
25
25
  <script>
26
26
  import { getMedalLink } from "@jx3box/jx3box-common/js/utils";
27
27
  import { getUserMedals } from "../../service/author";
28
- import { __imgPath } from "@jx3box/jx3box-common/data/jx3box.json";
28
+ import { __imgPath, __Root } from "@jx3box/jx3box-common/data/jx3box.json";
29
29
  export default {
30
30
  name: "AuthorMedals",
31
31
  props: ["uid"],
@@ -58,6 +58,7 @@ export default {
58
58
  return __imgPath + "image/medals/user/" + medal + ".gif";
59
59
  },
60
60
  getMedalLink(medal) {
61
+ if (medal.medal_url) return `${__Root}${medal.medal_url}`
61
62
  return medal.rank_id ? getMedalLink(medal.rank_id, medal.medal_type || "rank") : "";
62
63
  },
63
64
  },