xianniu-ui 0.8.55 → 0.8.56

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": "xianniu-ui",
3
- "version": "0.8.55",
3
+ "version": "0.8.56",
4
4
  "private": false,
5
5
  "main": "lib/xianniu-ui.umd.min.js",
6
6
  "scripts": {
@@ -161,14 +161,6 @@
161
161
  </span>
162
162
  </template>
163
163
  </div>
164
- <!-- <div
165
- slot="file"
166
- slot-scope="{ file }"
167
- class="xn-upload--slot"
168
-
169
- >
170
-
171
- </div> -->
172
164
  <div v-if="tip !== ''" slot="tip" class="el-upload__tip">{{ tip }}</div>
173
165
  <el-image-viewer
174
166
  v-if="isShowImageView"
@@ -235,7 +227,7 @@ export default {
235
227
  default: () => {},
236
228
  },
237
229
  hideUpload: {
238
- type: Boolean,
230
+ type: Boolean,
239
231
  default: false,
240
232
  },
241
233
  type: {
@@ -370,15 +362,14 @@ export default {
370
362
  .then((res) => {
371
363
  this.successFiles.push(res);
372
364
 
373
- this.realFileList.forEach((item) => {
365
+ this.realFileList.forEach((item,idx) => {
374
366
  if (item.uid === res.file.uid) {
375
367
  const obj = JSON.parse(JSON.stringify(res));
376
368
  const _item = JSON.parse(JSON.stringify(item));
377
369
  delete _item.raw;
378
- item = Object.assign(obj, _item);
370
+ this.$set(this.realFileList, idx, Object.assign(obj, _item));
379
371
  }
380
372
  });
381
-
382
373
  this.$emit("update:fileList", this.realFileList);
383
374
  this.$emit("on-file", this.res);
384
375
  this.$emit("on-success", this.successFiles);
package/src/oss/index.js CHANGED
@@ -14,17 +14,15 @@ class Client {
14
14
  const _token = localStorage.getItem('xnToken');
15
15
  if (!_token) return '';
16
16
 
17
- const isQuotedString = /^".*"$/.test(_token);
18
- try {
19
- if (isQuotedString) {
20
- return _token.slice(1, -1);
21
- } else {
22
- return JSON.parse(_token);
17
+ let token = ''
18
+ if (_token) {
19
+ try {
20
+ token = JSON.parse(_token)
21
+ } catch (error) {
22
+ token = _token
23
23
  }
24
- } catch (error) {
25
- console.error('Failed to parse token:', error);
26
- return _token;
27
24
  }
25
+ return token
28
26
  }
29
27
 
30
28
  getExt(file) {