@netang/quasar 0.1.94 → 0.1.95

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": "@netang/quasar",
3
- "version": "0.1.94",
3
+ "version": "0.1.95",
4
4
  "description": "netang-quasar",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -6,6 +6,7 @@ import $n_trim from 'lodash/trim'
6
6
  import $n_isValidObject from '@netang/utils/isValidObject'
7
7
  import $n_isValidString from '@netang/utils/isValidString'
8
8
  import $n_http from '@netang/utils/http'
9
+ import $n_trimString from '@netang/utils/trimString'
9
10
 
10
11
  import $n_toast from '../toast'
11
12
  import $n_config from '../config'
@@ -170,7 +171,7 @@ export default async function ({ waitUploadFileLists, uploadFileLists, checkFile
170
171
  // vrotate: null
171
172
  // vduration: 57.291992
172
173
 
173
- const {
174
+ let {
174
175
  format,
175
176
  width,
176
177
  height,
@@ -184,6 +185,11 @@ export default async function ({ waitUploadFileLists, uploadFileLists, checkFile
184
185
  vduration,
185
186
  } = res
186
187
 
188
+ format = $n_trimString(format)
189
+ if (format) {
190
+ format = format.toLowerCase()
191
+ }
192
+
187
193
  const query = {
188
194
  // 标题
189
195
  title: fileItem.title,
@@ -244,7 +250,7 @@ export default async function ({ waitUploadFileLists, uploadFileLists, checkFile
244
250
  query.type = 2
245
251
 
246
252
  // 图片后缀名
247
- query.ext = format === 'jpeg' ? 'jpg' : format
253
+ query.ext = format === 'png' || format === 'gif' ? format : 'jpg'
248
254
 
249
255
  // 如果大小 < 20M, 则为可用图片
250
256
  if (size < 20971520) {