sunjh 6 gadi atpakaļ
vecāks
revīzija
c408c3ca47

+ 4 - 1
src/components/Home.vue

@@ -76,7 +76,10 @@ export default {
     },
   },
   created: function () {
-    notify('info', 'lalal')
+    //notify('info', 'info')
+    //notify('success', 'success')
+    //notify('error', 'error')
+    //notify('warning', 'warning')
     this.loadData()
   }
 }

+ 7 - 2
src/components/project/ProjectCreate.vue

@@ -157,6 +157,7 @@ import provinceCityJSON from '@/constants/provinceCity.json'
 import ServiceType from '@/constants/enum/service-type'
 import ResourceType from '@/constants/enum/resource-type'
 import {notify} from '@/constants/index'
+
 export default {
   name: 'ProjectCreate',
   components: {
@@ -312,7 +313,7 @@ export default {
       // })
     },
     submitForm (formName) {
-      console.log(this.project)
+      //console.log(this.project)
       const newProject = {
         userId: 3,
         name: this.project.name,
@@ -332,13 +333,17 @@ export default {
         price: this.project.price
       }
       Http.post(Apis.PROJECT.CREATE_PROJECT, newProject).then((res) => {
-        //console.log(res.status)
+        notify('success', '创建成功')
         if (window.history.length <= 1) {
           this.$router.push({path: '/'})
           return false
         } else {
           this.$router.go(-1)
         }
+      }).catch(error => {
+        //console.log(error)
+        notify('error', error.data.msg)
+
       })
       // this.$refs[formName].validate(valid => {
       //   if (valid) {

+ 1 - 1
src/js/http.js

@@ -70,7 +70,7 @@ export default {
         }
       ).catch(
         (error) => {
-          reject(error)
+          reject(error.response)
         }
       )
     })