xianniu-ui 0.7.0 → 0.7.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/lib/xianniu-ui.common.js +107400 -35007
- package/lib/xianniu-ui.umd.js +107400 -35007
- package/lib/xianniu-ui.umd.min.js +37 -14
- package/package.json +1 -1
- package/packages/card/main.vue +1 -1
- package/packages/upload/main.vue +2 -1
- package/src/oss/index.js +5 -3
package/package.json
CHANGED
package/packages/card/main.vue
CHANGED
package/packages/upload/main.vue
CHANGED
|
@@ -190,7 +190,7 @@ export default {
|
|
|
190
190
|
return Promise.all([
|
|
191
191
|
this.checkFileExt(file),
|
|
192
192
|
this.onExceedSize(file.size),
|
|
193
|
-
this.getStsToken(),
|
|
193
|
+
this.getStsToken(file),
|
|
194
194
|
])
|
|
195
195
|
.then(() => {
|
|
196
196
|
return Promise.resolve();
|
|
@@ -280,6 +280,7 @@ export default {
|
|
|
280
280
|
return this.$utils.download({url, name})
|
|
281
281
|
},
|
|
282
282
|
handleRemove(file, fileList) {
|
|
283
|
+
console.log('file, fileList: ', file, fileList,this.files);
|
|
283
284
|
fileList.forEach((item, idx) => {
|
|
284
285
|
if (file.uid === item.uid) {
|
|
285
286
|
fileList.splice(idx, 1);
|
package/src/oss/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const OSS = require('ali-oss')
|
|
2
2
|
import $dayjs from '@/utils/dayjs'
|
|
3
3
|
const { v4: uuidv4 } = require('uuid');
|
|
4
|
-
|
|
4
|
+
import { Message } from 'element-ui';
|
|
5
5
|
class Client {
|
|
6
6
|
constructor(params = {}) {
|
|
7
7
|
this.uploadHost = null
|
|
@@ -33,10 +33,12 @@ class Client {
|
|
|
33
33
|
const uuid = uuidv4()
|
|
34
34
|
return uuid
|
|
35
35
|
}
|
|
36
|
-
getStsToken() {
|
|
36
|
+
getStsToken(file) {
|
|
37
37
|
return new Promise((resolve, reject) => {
|
|
38
38
|
if (!this.stsUrl) {
|
|
39
|
-
|
|
39
|
+
Message.error('获取临时凭证地址不能为空')
|
|
40
|
+
file.onError()
|
|
41
|
+
return
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
fetch(this.stsUrl + '?xnToken=' + this.getToken()).then(response => response.json()).then((res) => {
|