Browse Source

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

许成详 6 years ago
parent
commit
ddcc933356
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      src/pages/user/calendar/making.vue

+ 7
- 2
src/pages/user/calendar/making.vue View File

217
     onRead (file) {
217
     onRead (file) {
218
       let that = this
218
       let that = this
219
       this.isLoading = true
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
         this.$toast('图片名称中包含非法字符')
222
         this.$toast('图片名称中包含非法字符')
223
         this.isLoading = false
223
         this.isLoading = false
224
         return
224
         return
233
         image.onload = function () {
233
         image.onload = function () {
234
           let width = image.width;
234
           let width = image.width;
235
           let height = image.height;
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
           if (width / height > 2.5) {
241
           if (width / height > 2.5) {
237
             that.isLoading = false
242
             that.isLoading = false
238
             that.$toast('该图片长度过长,请重新选择')
243
             that.$toast('该图片长度过长,请重新选择')