@jx3box/jx3box-editor 1.2.1 → 1.2.2

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-editor",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "JX3BOX Article & Editor",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/service/item.js CHANGED
@@ -1,14 +1,15 @@
1
1
  import { $helper } from "@jx3box/jx3box-common/js/https";
2
2
 
3
3
  // 获取物品
4
- function get_item(item_id, client_id) {
4
+ function get_item(item_id, client) {
5
5
  if (!item_id) return;
6
-
7
6
  let options = {
8
- url: `api/item/${item_id}`,
7
+ url: `/api/item/${item_id}`,
8
+ params : {
9
+ client
10
+ }
9
11
  };
10
-
11
- return $helper({ mute: true,client_id : client_id })(options);
12
+ return $helper({ mute: true })(options);
12
13
  }
13
14
 
14
15
  // 获取清单
package/src/Item.vue CHANGED
@@ -250,26 +250,34 @@ import { iconLink } from "@jx3box/jx3box-common/js/utils";
250
250
 
251
251
  export default {
252
252
  name: "Item",
253
- props: ["item", "item_id", "jx3ClientType"],
253
+ props: ["item", "item_id", "jx3ClientType","client"],
254
254
  data() {
255
255
  return {
256
256
  source: null,
257
257
  };
258
258
  },
259
259
  computed : {
260
+ // 兼容旧版传值
261
+ env_client_id : function (){
262
+ return location.href.includes('origin') ? 2 : 1
263
+ },
260
264
  client_id : function (){
261
- return this.jx3ClientType || 1
265
+ return this.jx3ClientType || this.env_client_id
266
+ },
267
+ client_by_id : function (){
268
+ return this.client_id == 1 ? 'std' : 'origin'
262
269
  },
263
- client : function (){
264
- return this.client_id == 1 ? 'std' : 'origin'
270
+ // 新版传值
271
+ final_client : function (){
272
+ return this.client || this.client_by_id
265
273
  },
266
274
  cache_key : function (){
267
- return `item-${this.client}-${this.item_id}`
275
+ return `item-${this.final_client}-${this.item_id}`
268
276
  },
269
277
  },
270
278
  methods: {
271
279
  iconLink : function (id){
272
- return iconLink(id,this.client)
280
+ return iconLink(id,this.final_client)
273
281
  },
274
282
  second_format,
275
283
  attribute_percent,
@@ -303,7 +311,7 @@ export default {
303
311
 
304
312
  // 服务端拉取
305
313
  }else{
306
- get_item(this.item_id, this.client_id).then((res) => {
314
+ get_item(this.item_id, this.final_client).then((res) => {
307
315
  let data = res.data;
308
316
  if (data.code === 200) {
309
317
  let item = data.data.item;