Quellcode durchsuchen

Merge branch 'dev' of http://git.ycjcjy.com/SpaceOfCheng/wechat into dev

许成详 vor 6 Jahren
Ursprung
Commit
ddcc933356
1 geänderte Dateien mit 7 neuen und 2 gelöschten Zeilen
  1. 7
    2
      src/pages/user/calendar/making.vue

+ 7
- 2
src/pages/user/calendar/making.vue Datei anzeigen

@@ -217,8 +217,8 @@ export default {
217 217
     onRead (file) {
218 218
       let that = this
219 219
       this.isLoading = true
220
-      let reg = /^[0-9a-zA-Z.]+$/
221
-      if (!reg.test(file.file.name)) {
220
+      let reg = new RegExp("[`/?%#&=:\s\+]")
221
+      if (reg.test(file.file.name)) {
222 222
         this.$toast('图片名称中包含非法字符')
223 223
         this.isLoading = false
224 224
         return
@@ -233,6 +233,11 @@ export default {
233 233
         image.onload = function () {
234 234
           let width = image.width;
235 235
           let height = image.height;
236
+          // if (!/.(jpg|jpeg)$/.test(image.src)) {
237
+          //   that.isLoading = false
238
+          //   that.$toast('只允许JPG/JPEG格式的图片')
239
+          //   return
240
+          // }
236 241
           if (width / height > 2.5) {
237 242
             that.isLoading = false
238 243
             that.$toast('该图片长度过长,请重新选择')