yuantianjiao 6 years ago
parent
commit
83fb77dc6b

+ 9
- 3
src/components/material.vue View File

@@ -35,6 +35,7 @@
35 35
         :with-credentials='true'
36 36
         type="drag"
37 37
         :action="api.material.addImg.url"
38
+        name='media'
38 39
         class="upload-btn">
39 40
         <div>
40 41
           <Icon type="ios-camera" size="50"></Icon>
@@ -118,9 +119,14 @@ export default {
118 119
     handleSuccess (res, file) {
119 120
       console.log(res)
120 121
       console.log(file)
121
-      // this.addImg(file).then(() => {
122
-
123
-      // })
122
+      this.$Message.success('上传成功')
123
+      this.getImg({ type: 'image' }).then(() => {
124
+        if (this.model === 'set') {
125
+          this.$nextTick(() => {
126
+            this.uploadList = this.img
127
+          })
128
+        }
129
+      })
124 130
     },
125 131
     handleFormatError (file) {
126 132
       this.$Notice.warning({

+ 8
- 0
src/components/menuForm.vue View File

@@ -170,6 +170,7 @@ export default {
170 170
   methods: {
171 171
     ...mapMaterialActions(['addImg']),
172 172
     checkLink () {
173
+      console.log(111)
173 174
       if (!this.linkText) {
174 175
         this.$Message.warning('链接名称必填')
175 176
         return false
@@ -181,6 +182,9 @@ export default {
181 182
       if (this.errors.first('linkT')) {
182 183
         this.$Message.warning('链接格式不正确')
183 184
         return false
185
+      } else if (this.linkHref.indexOf('http') <= -1) {
186
+        this.$Message.warning('链接必须附带http协议头')
187
+        return false
184 188
       }
185 189
       let text = `<a href='${this.linkHref}'>${this.linkText}</a>`
186 190
       this.text += text
@@ -292,10 +296,14 @@ export default {
292 296
           this.emitData.media_id = this.view.media_id
293 297
         }
294 298
       } else if (this.type === '跳转网页') {
299
+        console.log(111)
295 300
         if (this.errors.first('link')) {
296 301
           this.$Message.warning('url格式不正确')
297 302
         } else if (!this.linkHref) {
298 303
           this.$Message.warning('url必填')
304
+        } else if (this.linkHref.indexOf('http') <= -1) {
305
+          this.$Message.warning('链接必须附带http协议头')
306
+          return false
299 307
         }
300 308
         this.emitData.type = 'view'
301 309
         this.emitData.url = this.linkHref

+ 9
- 6
src/pages/login/login.vue View File

@@ -15,7 +15,7 @@
15 15
         <span>记住用户名密码</span>
16 16
         <input type="checkbox" v-model="Remember">
17 17
       </div>
18
-      <div class="submit" @click="submit()">登陆</div>
18
+      <Button type="success" class="submit" @click="submit()">登陆</Button>
19 19
     </div>
20 20
   </div>
21 21
 </template>
@@ -80,6 +80,14 @@ export default {
80 80
     ...mapLoginActions(['setRemember', 'setUserName', 'setPassWord', 'login']),
81 81
     ...mapMainActions(['getUserInfo', 'clearMenu']),
82 82
     submit () {
83
+      if (!this.UserName) {
84
+        this.$Message.warning('请输入用户名')
85
+        return
86
+      }
87
+      if (!this.PassWord) {
88
+        this.$Message.warning('请输入密码')
89
+        return
90
+      }
83 91
       this.login({ UserName: this.UserName, UserPass: this.md5(this.PassWord) }).then(() => {
84 92
         if (!this.Remember) {
85 93
           this.UserName = ''
@@ -161,11 +169,6 @@ export default {
161 169
     .submit {
162 170
       width: 200px;
163 171
       height: 35px;
164
-      text-align: center;
165
-      line-height: 35px;
166
-      background-color: #00bbbd;
167
-      color: #fff;
168
-      border-radius: 12px;
169 172
     }
170 173
   }
171 174
 }

+ 1
- 1
src/pages/main/management/management.vue View File

@@ -12,7 +12,7 @@
12 12
         <Button type="primary" @click="submit">确认</Button>
13 13
       </div>
14 14
     </Modal>
15
-    <Modal title="公众平台账号授权" v-model="pop.show" :mask-closable="false">
15
+    <Modal title="公众平台账号授权" v-model="pop.show">
16 16
       <div class="qrcode" v-if="wechatConfig.ConfId">
17 17
         <img v-if="wechatConfig.HeadImg" :src="wechatConfig.HeadImg" alt="">
18 18
         <img v-else :src="defultHead" alt="">

+ 8
- 2
src/pages/main/menuConfig/menuConfig.vue View File

@@ -55,7 +55,7 @@ export default {
55 55
     }
56 56
   },
57 57
   created () {
58
-    this.getWechatMenu()
58
+    this.init()
59 59
   },
60 60
   computed: {
61 61
     ...mapMenuConfigState({
@@ -68,6 +68,9 @@ export default {
68 68
   },
69 69
   methods: {
70 70
     ...mapMenuConfigActions(['getWechatMenu', 'AddMainMenu', 'SetMainMenu', 'AddSubMenu', 'SetSubMenu', 'mainActive', 'subActive', 'mainPlusActive', 'subPlusActive', 'clear', 'setWechatMenu']),
71
+    init () {
72
+      this.getWechatMenu()
73
+    },
71 74
     chengeForm (hasContent, hasDelete) {
72 75
       this.formActive = false
73 76
       this.hasContent = hasContent
@@ -156,7 +159,10 @@ export default {
156 159
       this.SetSubMenu(data)
157 160
     },
158 161
     submit () {
159
-      this.setWechatMenu()
162
+      this.setWechatMenu().then(() => {
163
+        this.$Message.success('发布成功')
164
+        this.init()
165
+      })
160 166
     }
161 167
   }
162 168
 }

+ 3
- 3
src/store/material.js View File

@@ -24,9 +24,9 @@ export default {
24 24
             ...data,
25 25
           }
26 26
         }).then(res => {
27
-          // data.forEach((curr) => {
28
-          //   curr.checked = false
29
-          // })
27
+          res.forEach((curr) => {
28
+            curr.checked = false
29
+          })
30 30
           context.commit('updateImg', res)
31 31
           resolve(res)
32 32
         }).catch(reject)

+ 15
- 1
src/store/menuConfig.js View File

@@ -117,7 +117,21 @@ export default {
117 117
         }).then((res) => {
118 118
           let button = []
119 119
           if (res) {
120
-            button = res.menu.button
120
+            button = res.menu.menu.button
121
+            button.forEach((current) => {
122
+              if (current.type === 'click') {
123
+                current.type = 'text'
124
+                current.value = res.keyList.filter(item => item.KeyId === current.key)[0].Value
125
+              }
126
+              if (current.sub_button) {
127
+                current.sub_button.forEach((curr) => {
128
+                  if (curr.type === 'click') {
129
+                    curr.type = 'text'
130
+                    curr.value = res.keyList.filter(item => item.KeyId === curr.key)[0].Value
131
+                  }
132
+                })
133
+              }
134
+            })
121 135
           }
122 136
           context.commit('updateMenu', loop({ button }))
123 137
           resolve()