@netang/quasar 0.2.20 → 0.2.22

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.
@@ -6,6 +6,7 @@
6
6
  ref="fileRef"
7
7
  class="hidden"
8
8
  type="file"
9
+ capture="camera"
9
10
  :multiple="count !== 1"
10
11
  @change="uploader.fileChange"
11
12
  >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netang/quasar",
3
- "version": "0.2.20",
3
+ "version": "0.2.22",
4
4
 
5
5
  "description": "netang-quasar",
6
6
  "scripts": {
package/utils/getImage.js CHANGED
@@ -141,47 +141,47 @@ export default function getImage(src, options) {
141
141
  )
142
142
  )
143
143
 
144
- // 判断图片上传方式
145
- switch (type) {
146
-
147
- // 七牛云
148
- // 文档: https://developer.qiniu.com/dora/1279/basic-processing-images-imageview2
149
- case 'qiniu':
150
- // minio
151
- case 'minio':
152
-
153
- const {
154
- compress,
155
- mode,
156
- w,
157
- h,
158
- q,
159
- interlace,
160
- ignoreError,
161
- format,
162
- } = Object.assign({
163
- // 是否压缩
164
- compress: true,
165
- // 模式
166
- mode: '2',
167
- //
168
- w: 0,
169
- //
170
- h: 0,
171
- // 质量
172
- q: 75,
173
- // 是否支持渐进显示
174
- interlace: false,
175
- // 是否忽略错误
176
- // 主要针对图片兼容性的问题导致无法处理, 取值为 1 时, 则处理失败时返回原图
177
- // 不设置此参数, 默认处理失败时返回错误信息
178
- ignoreError: false,
179
- // 格式
180
- format: 'webp',
181
- }, options)
182
-
183
- // 如果压缩
184
- if (compress) {
144
+ const {
145
+ compress,
146
+ mode,
147
+ w,
148
+ h,
149
+ q,
150
+ interlace,
151
+ ignoreError,
152
+ format,
153
+ } = Object.assign({
154
+ // 是否压缩
155
+ compress: true,
156
+ // 模式
157
+ mode: '2',
158
+ // 宽
159
+ w: 0,
160
+ // 高
161
+ h: 0,
162
+ // 质量
163
+ q: 75,
164
+ // 是否支持渐进显示
165
+ interlace: false,
166
+ // 是否忽略错误
167
+ // 主要针对图片兼容性的问题导致无法处理, 取值为 1 时, 则处理失败时返回原图
168
+ // 不设置此参数, 默认处理失败时返回错误信息
169
+ ignoreError: false,
170
+ // 格式
171
+ format: 'webp',
172
+ }, options)
173
+
174
+ // 如果压缩
175
+ if (compress) {
176
+
177
+ // 判断图片上传方式
178
+ switch (type) {
179
+
180
+ // 七牛云
181
+ // 文档: https://developer.qiniu.com/dora/1279/basic-processing-images-imageview2
182
+ case 'qiniu':
183
+ // minio
184
+ case 'minio':
185
185
 
186
186
  // 裁剪图片方式
187
187
  src += `?imageView2/${mode}`
@@ -215,48 +215,48 @@ export default function getImage(src, options) {
215
215
  if (format) {
216
216
  src += '/format/' + format
217
217
  }
218
- }
219
- break
218
+ break
220
219
 
221
- // 【oss】
222
- // -------------------------------------------------------------------------------------------------
223
- // 文档: https://help.aliyun.com/document_detail/44686.html
224
- case 'oss':
220
+ // 【oss】
221
+ // -------------------------------------------------------------------------------------------------
222
+ // 文档: https://help.aliyun.com/document_detail/44686.html
223
+ case 'oss':
225
224
 
226
- // 裁剪图片方式
227
- src += `?x-oss-process=image`
225
+ // 裁剪图片方式
226
+ src += `?x-oss-process=image`
228
227
 
229
- // 缩放
230
- if (w || h) {
228
+ // 缩放
229
+ if (w || h) {
231
230
 
232
- src += '/resize'
231
+ src += '/resize'
233
232
 
234
- // 宽
235
- if (w) {
236
- src += ',w_' + w
237
- }
233
+ // 宽
234
+ if (w) {
235
+ src += ',w_' + w
236
+ }
238
237
 
239
- // 高
240
- if (h) {
241
- src += ',h_' + h
238
+ // 高
239
+ if (h) {
240
+ src += ',h_' + h
241
+ }
242
242
  }
243
- }
244
243
 
245
- // 质量
246
- if (q) {
247
- src += '/quality,q_' + q
248
- }
244
+ // 质量
245
+ if (q) {
246
+ src += '/quality,q_' + q
247
+ }
249
248
 
250
- // 渐进显示
251
- if (interlace) {
252
- src += '/interlace,1'
253
- }
249
+ // 渐进显示
250
+ if (interlace) {
251
+ src += '/interlace,1'
252
+ }
254
253
 
255
- // 格式化
256
- if (format) {
257
- src += '/format,' + format
258
- }
259
- break
254
+ // 格式化
255
+ if (format) {
256
+ src += '/format,' + format
257
+ }
258
+ break
259
+ }
260
260
  }
261
261
 
262
262
  // 【调试模式】