vue2-client 1.2.32-test → 1.2.32-test1

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": "vue2-client",
3
- "version": "1.2.32-test",
3
+ "version": "1.2.32-test1",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -56,7 +56,7 @@ export default {
56
56
  ...mapState('account', { currUser: 'user' })
57
57
  },
58
58
  methods: {
59
- async uploadFiles (info) {
59
+ uploadFiles (info) {
60
60
  // 初始化文件信息
61
61
  const fileInfo = {
62
62
  uid: info.file.uid,
@@ -87,20 +87,21 @@ export default {
87
87
  if (process.env.NODE_ENV === 'production') {
88
88
  url = `/${this.model.stockAlias}/webmeteruploadapi/upload`
89
89
  }
90
- const res = await post(url, formData, { headers })
91
- // 根据服务端返回的结果判断成功与否,设置文件条目的状态
92
- if (res.success) {
93
- fileInfo.status = 'done'
94
- fileInfo.response = JSON.parse(res.data)
95
- fileInfo.id = JSON.parse(res.data).id
96
- fileInfo.url = JSON.parse(res.data).f_downloadpath
97
- this.$emit('setFiles', this.uploadedFileList.filter(item => item.status === 'done').map(item => item.id))
98
- this.$message.success('上传成功!')
99
- } else {
100
- fileInfo.status = 'error'
101
- fileInfo.response = res.data
102
- this.$message.error('上传失败!')
103
- }
90
+ post(url, formData, { headers }).then(res => {
91
+ // 根据服务端返回的结果判断成功与否,设置文件条目的状态
92
+ if (res.success) {
93
+ fileInfo.status = 'done'
94
+ fileInfo.response = JSON.parse(res.data)
95
+ fileInfo.id = JSON.parse(res.data).id
96
+ fileInfo.url = JSON.parse(res.data).f_downloadpath
97
+ this.$emit('setFiles', this.uploadedFileList.filter(item => item.status === 'done').map(item => item.id))
98
+ this.$message.success('上传成功!')
99
+ } else {
100
+ fileInfo.status = 'error'
101
+ fileInfo.response = res.data
102
+ this.$message.error('上传失败!')
103
+ }
104
+ })
104
105
  },
105
106
  // 删除文件
106
107
  deleteFileItem (file) {