Browse Source

错误捕获

yuwenjun1997 2 years ago
parent
commit
4f867df539
67 changed files with 1117 additions and 608 deletions
  1. 9 0
      src/permission.js
  2. 2 0
      src/store/modules/app.js
  3. 12 6
      src/store/modules/user.js
  4. 2 16
      src/utils/request.js
  5. 3 0
      src/views/admin/audit/club/index.vue
  6. 3 0
      src/views/admin/audit/device/index.vue
  7. 3 1
      src/views/admin/audit/material/article/index.vue
  8. 26 18
      src/views/admin/audit/material/article/review.vue
  9. 3 0
      src/views/admin/audit/material/file/index.vue
  10. 4 1
      src/views/admin/audit/material/image/index.vue
  11. 15 11
      src/views/admin/audit/material/image/review.vue
  12. 3 0
      src/views/admin/audit/material/index.vue
  13. 3 0
      src/views/admin/audit/material/package/index.vue
  14. 3 0
      src/views/admin/audit/material/video/index.vue
  15. 3 0
      src/views/admin/audit/personnel/index.vue
  16. 3 0
      src/views/admin/logistics-licensed/club/device/index.vue
  17. 34 22
      src/views/admin/member/handsel.vue
  18. 23 18
      src/views/admin/member/index.vue
  19. 27 15
      src/views/admin/member/record.vue
  20. 22 12
      src/views/admin/member/service.vue
  21. 70 36
      src/views/admin/member/settings/combo-edit.vue
  22. 6 0
      src/views/admin/member/settings/service-edit.vue
  23. 34 18
      src/views/admin/settings/accounts/edit.vue
  24. 8 4
      src/views/admin/settings/accounts/index.vue
  25. 10 6
      src/views/admin/settings/auth-card/components/supplier-list.vue
  26. 15 7
      src/views/admin/settings/menus/components/edit-page.vue
  27. 11 7
      src/views/admin/settings/menus/components/table-list.vue
  28. 35 19
      src/views/admin/settings/roles/edit.vue
  29. 13 5
      src/views/admin/settings/roles/index.vue
  30. 3 0
      src/views/admin/supplier/club/device/index.vue
  31. 20 9
      src/views/admin/supplier/edit_old.vue
  32. 12 8
      src/views/admin/supplier/index.vue
  33. 20 9
      src/views/common/helper/document/index.vue
  34. 21 14
      src/views/common/helper/video/index.vue
  35. 20 14
      src/views/common/login/index.vue
  36. 0 1
      src/views/common/password/index.vue
  37. 11 7
      src/views/common/share/pay/pay.vue
  38. 7 3
      src/views/components/ClubDetail/index.vue
  39. 3 0
      src/views/components/DeviceDetail/index.vue
  40. 31 18
      src/views/components/payment/pay-alipay.vue
  41. 9 5
      src/views/components/payment/pay-bank.vue
  42. 89 75
      src/views/normal/club/device/edit.vue
  43. 9 0
      src/views/normal/club/device/index.vue
  44. 10 6
      src/views/normal/club/edit.vue
  45. 16 9
      src/views/normal/docs/article-edit.vue
  46. 22 15
      src/views/normal/feedback/detail.vue
  47. 15 8
      src/views/normal/material/article/edit.vue
  48. 12 5
      src/views/normal/material/article/index.vue
  49. 18 5
      src/views/normal/material/file/index.vue
  50. 15 8
      src/views/normal/material/image/edit.vue
  51. 12 5
      src/views/normal/material/image/index.vue
  52. 18 5
      src/views/normal/material/package/index.vue
  53. 15 5
      src/views/normal/material/video/index.vue
  54. 9 5
      src/views/normal/personal/index.vue
  55. 21 11
      src/views/normal/personal/set-account.vue
  56. 17 9
      src/views/normal/personal/set-mobile.vue
  57. 25 13
      src/views/normal/personal/vip-record.vue
  58. 23 11
      src/views/normal/personnel/operate/edit.vue
  59. 25 13
      src/views/normal/personnel/operate/index.vue
  60. 23 11
      src/views/normal/personnel/training/edit.vue
  61. 25 13
      src/views/normal/personnel/training/index.vue
  62. 32 16
      src/views/normal/settings/accounts/edit.vue
  63. 7 3
      src/views/normal/settings/accounts/index.vue
  64. 10 6
      src/views/normal/settings/auth-card/components/supplier-list.vue
  65. 40 21
      src/views/normal/settings/roles/edit.vue
  66. 13 5
      src/views/normal/settings/roles/index.vue
  67. 34 15
      src/views/normal/vip/buy.vue

+ 9 - 0
src/permission.js

@@ -1,8 +1,12 @@
+import NProgress from 'nprogress'
+import 'nprogress/nprogress.css'
 import router from '@/router'
 import store from '@/store'
 import { getToken, getUserInfo, initGoPage } from '@/utils/auth'
 // import getPageTitle from './utils/get-page-title'
 
+NProgress.configure({ showSpinner: false })
+
 // 获取用户信息
 const userInfo = getUserInfo()
 if (userInfo) {
@@ -15,6 +19,7 @@ const shareList = ['Share', 'SharePayVip', 'SharePaySuccess', 'SharePayFaild', '
 
 // 路由拦截器
 router.beforeEach(async(to, from, next) => {
+  NProgress.start()
   const hasToken = getToken()
   // 设置页面标题
   // document.title = getPageTitle(to.meta.title)
@@ -59,3 +64,7 @@ router.beforeEach(async(to, from, next) => {
     }
   }
 })
+
+router.afterEach(() => {
+  NProgress.done()
+})

+ 2 - 0
src/store/modules/app.js

@@ -65,6 +65,8 @@ const actions = {
       if (res.code === 0) {
         commit('SET_COUNTRY', res.data)
       }
+    }).catch(err => {
+      console.log(err)
     })
   }
 }

+ 12 - 6
src/store/modules/user.js

@@ -77,21 +77,27 @@ const actions = {
   },
 
   // 获取用户菜单列表
-  fetchUserInfo({ commit, state }) {
-    return fetchUserInfo({ authUserId: state.authUserId }).then((res) => {
+  async fetchUserInfo({ commit, state }) {
+    try {
+      const res = await fetchUserInfo({ authUserId: state.authUserId })
       console.log(res)
       commit('SET_ROLES', res.data.roles)
       commit('SET_MENUS', res.data.menus)
       commit('SET_PERMISSIONS', res.data.permissions)
-    })
+    } catch (error) {
+      console.log(error)
+    }
   },
 
   // 获取用户会员信息
-  fetchUserVipInfo({ commit, state }) {
+  async fetchUserVipInfo({ commit, state }) {
     if (state.userIdentity === 1) return
-    fetchUserVipInfo({ authUserId: state.authUserId }).then((res) => {
+    try {
+      const res = await fetchUserVipInfo({ authUserId: state.authUserId })
       commit('SET_VIPINFO', res.data)
-    })
+    } catch (error) {
+      console.log(error)
+    }
   },
 
   // 退出登录

+ 2 - 16
src/utils/request.js

@@ -2,10 +2,6 @@ import axios from 'axios'
 import { Message } from 'element-ui'
 import store from '@/store'
 import router from '@/router'
-import NProgress from 'nprogress'
-import 'nprogress/nprogress.css'
-
-NProgress.configure({ showSpinner: false })
 
 const service = axios.create({
   baseURL: process.env.VUE_APP_BASE_API,
@@ -15,7 +11,6 @@ const service = axios.create({
 // 请求拦截
 service.interceptors.request.use(
   (config) => {
-    NProgress.start()
     // 默认以application/json 格式传递参数
     config.headers['Content-Type'] = config.headers['Content-Type'] || 'application/json'
     // 只有以当 Content-Type === application/json 是对参数序列化
@@ -29,7 +24,6 @@ service.interceptors.request.use(
     return config
   },
   (error) => {
-    NProgress.done()
     return Promise.reject(error)
   }
 )
@@ -41,12 +35,8 @@ service.interceptors.response.use(
     // token失效时
     if (res.code === -99) {
       Message({ message: '登录失效,请重新登录!', duration: 1500 })
-      setTimeout(() => {
-        store.dispatch('user/logout')
-        store.dispatch('resetState')
-        router.replace('/login')
-      }, 500)
-      NProgress.done()
+      store.dispatch('user/logout')
+      router.replace('/login')
       return Promise.reject(res)
       // 返回不成功
     } else if (res.code !== 0) {
@@ -55,21 +45,17 @@ service.interceptors.response.use(
         type: 'error',
         duration: 1500
       })
-      NProgress.done()
       return Promise.reject(res)
     } else {
-      NProgress.done()
       return res
     }
   },
   (error) => {
-    console.log('错误:' + error) // for debug
     Message({
       message: error.message,
       type: 'error',
       duration: 500
     })
-    NProgress.done()
     return Promise.reject(error)
   }
 )

+ 3 - 0
src/views/admin/audit/club/index.vue

@@ -125,6 +125,9 @@ export default {
           this.list = res.data.list
           this.total = res.data.total
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })

+ 3 - 0
src/views/admin/audit/device/index.vue

@@ -125,6 +125,9 @@ export default {
           this.list = res.data.list
           this.total = res.data.total
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })

+ 3 - 1
src/views/admin/audit/material/article/index.vue

@@ -83,7 +83,6 @@
 </template>
 
 <script>
-
 import { getArticleList } from '@/api/doc'
 export default {
   name: 'AuditMaterialArticleList',
@@ -145,6 +144,9 @@ export default {
           this.total = res.data.total
           console.log(res)
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })

+ 26 - 18
src/views/admin/audit/material/article/review.vue

@@ -64,31 +64,39 @@ export default {
   methods: {
     // 获取文章数据
     getDetail() {
-      getArticleDeatil({ articleId: this.formData.articleId }).then((res) => {
-        console.log(res)
-        if (res.code !== 0) return
-        this.articleContent = res.data.articleContent
-        this.articleTitle = res.data.articleTitle
-        this.articleImage = res.data.articleImage
-        this.srcList.push(this.articleImage)
-      })
+      getArticleDeatil({ articleId: this.formData.articleId })
+        .then((res) => {
+          console.log(res)
+          if (res.code !== 0) return
+          this.articleContent = res.data.articleContent
+          this.articleTitle = res.data.articleTitle
+          this.articleImage = res.data.articleImage
+          this.srcList.push(this.articleImage)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 审核操作
     submit() {
       this.$refs.formRef.validate((valide) => {
         if (!valide) return
         this.formData.auditBy = this.authUserId
-        auditArticle(this.formData).then((res) => {
-          console.log(res)
-          if (res.code !== 0) return
-          this.$message({
-            message: res.data,
-            type: 'success',
-            duration: 1000
+        auditArticle(this.formData)
+          .then((res) => {
+            console.log(res)
+            if (res.code !== 0) return
+            this.$message({
+              message: res.data,
+              type: 'success',
+              duration: 1000
+            })
+            this.$store.dispatch('tagsView/delView', this.$route)
+            this.$router.back()
+          })
+          .catch((error) => {
+            console.log(error)
           })
-          this.$store.dispatch('tagsView/delView', this.$route)
-          this.$router.back()
-        })
       })
     }
   }

+ 3 - 0
src/views/admin/audit/material/file/index.vue

@@ -195,6 +195,9 @@ export default {
           this.total = res.data.total
           console.log(res)
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })

+ 4 - 1
src/views/admin/audit/material/image/index.vue

@@ -131,12 +131,15 @@ export default {
     getList() {
       this.listLoading = true
       getImageList(this.listQuery)
-        .then(res => {
+        .then((res) => {
           if (res.code !== 0) return
           this.list = res.data.list
           this.total = res.data.total
           console.log(res)
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })

+ 15 - 11
src/views/admin/audit/material/image/review.vue

@@ -73,18 +73,22 @@ export default {
       this.$refs.formRef.validate((valide) => {
         if (!valide) return
         this.formData.auditBy = this.authUserId
-        auditImage(this.formData).then((res) => {
-          console.log(res)
-          if (res.code !== 0) return
-          this.$message({
-            message: res.data,
-            type: 'success',
-            duration: 1000
+        auditImage(this.formData)
+          .then((res) => {
+            console.log(res)
+            if (res.code !== 0) return
+            this.$message({
+              message: res.data,
+              type: 'success',
+              duration: 1000
+            })
+            // 如果保存文章成功就要关闭当前页面
+            this.$store.dispatch('tagsView/delView', this.$route)
+            this.$router.back()
+          })
+          .catch((error) => {
+            console.log(error)
           })
-          // 如果保存文章成功就要关闭当前页面
-          this.$store.dispatch('tagsView/delView', this.$route)
-          this.$router.back()
-        })
       })
     },
     // 获取图片数据详情

+ 3 - 0
src/views/admin/audit/material/index.vue

@@ -135,6 +135,9 @@ export default {
           this.list = res.data.list
           this.total = res.data.total
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })

+ 3 - 0
src/views/admin/audit/material/package/index.vue

@@ -194,6 +194,9 @@ export default {
           this.total = res.data.total
           console.log(res)
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })

+ 3 - 0
src/views/admin/audit/material/video/index.vue

@@ -195,6 +195,9 @@ export default {
           this.total = res.data.total
           console.log(res)
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })

+ 3 - 0
src/views/admin/audit/personnel/index.vue

@@ -126,6 +126,9 @@ export default {
           this.list = res.data.list
           this.total = res.data.total
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })

+ 3 - 0
src/views/admin/logistics-licensed/club/device/index.vue

@@ -109,6 +109,9 @@ export default {
           this.total = total
           this.list = list
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })

+ 34 - 22
src/views/admin/member/handsel.vue

@@ -124,7 +124,7 @@
           v-infinite-scroll="onLoad"
           :data="supplierList"
           class="infinite-list hide-table-check-all"
-          style="overflow:auto"
+          style="overflow: auto"
           :infinite-scroll-delay="300"
           :infinite-scroll-immediate="false"
           header-row-class-name="tableHeader"
@@ -133,7 +133,7 @@
         >
           >
           <el-table-column label="选择" width="55" align="center">
-            <template slot-scope="{row}">
+            <template slot-scope="{ row }">
               <el-radio v-model="selectedAuthUserId" :label="row.authUserId"><span v-show="false">1</span></el-radio>
             </template>
           </el-table-column>
@@ -210,12 +210,16 @@ export default {
   methods: {
     // 提交赠送
     onSubmit() {
-      handselVip({ authUserId: this.selectedAuthUserId, packageId: this.selected }).then(res => {
-        console.log(res)
-        this.$message.success('赠送会员成功')
-        this.$store.dispatch('tagsView/delView', this.$route)
-        this.$router.back()
-      })
+      handselVip({ authUserId: this.selectedAuthUserId, packageId: this.selected })
+        .then((res) => {
+          console.log(res)
+          this.$message.success('赠送会员成功')
+          this.$store.dispatch('tagsView/delView', this.$route)
+          this.$router.back()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 移除选中的供应商
     removeSupplier() {
@@ -248,16 +252,20 @@ export default {
     },
     // 获取供应商列表
     fetchSupplierList() {
-      fetchSupplierList(this.listQuery).then(res => {
-        console.log(res)
-        this.supplierList = [...this.supplierList, ...res.data.list]
-        this.hasNextPage = res.data.hasNextPage
-        this.total = res.data.total
-      })
+      fetchSupplierList(this.listQuery)
+        .then((res) => {
+          console.log(res)
+          this.supplierList = [...this.supplierList, ...res.data.list]
+          this.hasNextPage = res.data.hasNextPage
+          this.total = res.data.total
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     handlePackageChange(id) {
       console.log(id)
-      const current = this.packageList.find(item => item.id === id)
+      const current = this.packageList.find((item) => item.id === id)
       this.currentPackageList = [current]
     },
     handleChooseSupplier() {
@@ -271,14 +279,18 @@ export default {
     },
     // 获取套餐列表
     fetchConfigureList() {
-      fetchConfigureList().then(res => {
-        this.packageList = res.data.packageList.map((item, index) => {
-          item.name = `套餐${index + 1}`
-          // item.originalPrice = `${item.originalPrice.toFixed(2)}`
-          // item.price = item.price.toFixed(2)
-          return item
+      fetchConfigureList()
+        .then((res) => {
+          this.packageList = res.data.packageList.map((item, index) => {
+            item.name = `套餐${index + 1}`
+            // item.originalPrice = `${item.originalPrice.toFixed(2)}`
+            // item.price = item.price.toFixed(2)
+            return item
+          })
+        })
+        .catch((error) => {
+          console.log(error)
         })
-      })
     }
   }
 }

+ 23 - 18
src/views/admin/member/index.vue

@@ -69,19 +69,22 @@
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" width="280">
-        <template slot-scope="{row}">
-          <el-button type="primary" size="mini" @click="navigationTo(`/member/record?id=${row.authUserId}`)">购买记录</el-button>
-          <el-button type="primary" size="mini" @click="navigationTo(`/member/service?id=${row.authUserId}`)">配置订制化服务</el-button>
+        <template slot-scope="{ row }">
+          <el-button
+            type="primary"
+            size="mini"
+            @click="navigationTo(`/member/record?id=${row.authUserId}`)"
+          >购买记录</el-button>
+          <el-button
+            type="primary"
+            size="mini"
+            @click="navigationTo(`/member/service?id=${row.authUserId}`)"
+          >配置订制化服务</el-button>
         </template>
       </el-table-column>
     </el-table>
     <!-- 页码 -->
-    <pagination
-      :total="total"
-      :page.sync="listQuery.pageNum"
-      :limit.sync="listQuery.pageSize"
-      @pagination="getList"
-    />
+    <pagination :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="getList" />
   </div>
 </template>
 
@@ -117,17 +120,19 @@ export default {
       return index + this.listQuery.pageSize * (this.listQuery.pageNum - 1) + 1
     },
     getList() {
-      fetchMemberList(this.listQuery).then(res => {
-        console.log(res)
-        this.list = res.data.list
-        this.hasNextPage = res.data.hasNextPage
-        this.total = res.data.total
-      })
+      fetchMemberList(this.listQuery)
+        .then((res) => {
+          console.log(res)
+          this.list = res.data.list
+          this.hasNextPage = res.data.hasNextPage
+          this.total = res.data.total
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     }
   }
 }
 </script>
 
-<style scoped lang="scss">
-
-</style>
+<style scoped lang="scss"></style>

+ 27 - 15
src/views/admin/member/record.vue

@@ -203,10 +203,14 @@ export default {
     },
     fetchVipRecord() {
       console.log(this.listQuery)
-      fetchVipRecord(this.listQuery).then((res) => {
-        console.log(res)
-        this.list = [...this.list, ...res.data.list]
-      })
+      fetchVipRecord(this.listQuery)
+        .then((res) => {
+          console.log(res)
+          this.list = [...this.list, ...res.data.list]
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     handleShowDemand(row) {
       this.dialogTableVisible = true
@@ -220,21 +224,29 @@ export default {
     },
     // 获取套餐列表
     fetchConfigureList() {
-      fetchConfigureList().then((res) => {
-        this.packageList = res.data.packageList.map((item, index) => {
-          item.name = `套餐${index + 1}`
-          // item.originalPrice = `${item.originalPrice.toFixed(2)}`
-          // item.price = item.price.toFixed(2)
-          return item
+      fetchConfigureList()
+        .then((res) => {
+          this.packageList = res.data.packageList.map((item, index) => {
+            item.name = `套餐${index + 1}`
+            // item.originalPrice = `${item.originalPrice.toFixed(2)}`
+            // item.price = item.price.toFixed(2)
+            return item
+          })
+        })
+        .catch((error) => {
+          console.log(error)
         })
-      })
     },
     // 获取供应商信息
     fetchSupplierInfo() {
-      getSupplierById({ authUserId: this.listQuery.authUserId }).then((res) => {
-        console.log(res)
-        this.supplierInfo = res.data
-      })
+      getSupplierById({ authUserId: this.listQuery.authUserId })
+        .then((res) => {
+          console.log(res)
+          this.supplierInfo = res.data
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     }
   }
 }

+ 22 - 12
src/views/admin/member/service.vue

@@ -47,26 +47,36 @@ export default {
   methods: {
     // 修改列表
     updateUserMenusConfigure() {
-      this.roleIds = this.serviceList.filter(item => item.checkFlag === 1).map(item => item.roleId)
+      this.roleIds = this.serviceList.filter((item) => item.checkFlag === 1).map((item) => item.roleId)
       this.isLoading = true
-      updateUserMenusConfigure({ roleIds: this.roleIds.join(','), authUserId: this.authUserId }).then(res => {
-        this.$message.success('保存成功')
-        this.$store.dispatch('tagsView/delView', this.$route)
-        this.$router.back()
-      }).finally(() => {
-        this.isLoading = false
-      })
+      updateUserMenusConfigure({ roleIds: this.roleIds.join(','), authUserId: this.authUserId })
+        .then((res) => {
+          this.$message.success('保存成功')
+          this.$store.dispatch('tagsView/delView', this.$route)
+          this.$router.back()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
+        .finally(() => {
+          this.isLoading = false
+        })
     },
     // 获取列表
     fetchUserMenusConfigure() {
       this.isLoading = true
       fetchUserMenusConfigure({
         authUserId: this.authUserId
-      }).then(res => {
-        this.serviceList = res.data
-      }).finally(() => {
-        this.isLoading = false
       })
+        .then((res) => {
+          this.serviceList = res.data
+        })
+        .catch((error) => {
+          console.log(error)
+        })
+        .finally(() => {
+          this.isLoading = false
+        })
     }
   }
 }

+ 70 - 36
src/views/admin/member/settings/combo-edit.vue

@@ -8,7 +8,7 @@
         </div>
         <div class="control">
           <span>期限</span>
-          <el-input v-model="item.duration" size="mini" style="width:80px;margin-right:16px" />
+          <el-input v-model="item.duration" size="mini" style="width: 80px; margin-right: 16px" />
           <el-select v-model="item.unit" placeholder="请选择" size="mini">
             <el-option label="月" :value="1" />
             <el-option label="年" :value="2" />
@@ -25,22 +25,44 @@
           <span>元</span>
         </div>
         <div class="control">
-          <el-button v-if="index === packageList.length -1" type="primary" size="mini" @click="insertOnePackage">添加</el-button>
-          <el-button v-if="canRemovePackage " type="danger" size="mini" @click="removeOnePackage(item,index)">删除</el-button>
+          <el-button
+            v-if="index === packageList.length - 1"
+            type="primary"
+            size="mini"
+            @click="insertOnePackage"
+          >添加</el-button>
+          <el-button
+            v-if="canRemovePackage"
+            type="danger"
+            size="mini"
+            @click="removeOnePackage(item, index)"
+          >删除</el-button>
         </div>
       </div>
     </div>
     <el-divider content-position="left">会员订制服务配置</el-divider>
     <div class="list">
       <div v-for="(item, index) in serviceList" :key="index" class="section">
-        <div class="control"><span>订制服务{{ index + 1 }}</span></div>
+        <div class="control">
+          <span>订制服务{{ index + 1 }}</span>
+        </div>
         <div class="control">
           <span>订制服务名称</span>
           <el-input v-model="item.name" size="mini" />
         </div>
         <div class="control">
-          <el-button v-if="index === serviceList.length -1" type="primary" size="mini" @click="insertOneSerivice">添加</el-button>
-          <el-button v-if="canRemoveService" type="danger" size="mini" @click="removeOneService(item,index)">删除</el-button>
+          <el-button
+            v-if="index === serviceList.length - 1"
+            type="primary"
+            size="mini"
+            @click="insertOneSerivice"
+          >添加</el-button>
+          <el-button
+            v-if="canRemoveService"
+            type="danger"
+            size="mini"
+            @click="removeOneService(item, index)"
+          >删除</el-button>
         </div>
       </div>
     </div>
@@ -78,26 +100,30 @@ export default {
   methods: {
     // 获取套餐 服务配置列表
     fetchConfigureList() {
-      fetchConfigureList().then(res => {
-        this.packageList = res.data.packageList
-        this.serviceList = res.data.serviceList
-        if (this.packageList.length === 0) {
-          this.insertOnePackage()
-        }
-        if (this.serviceList.length === 0) {
-          this.insertOneSerivice()
-        }
-      })
+      fetchConfigureList()
+        .then((res) => {
+          this.packageList = res.data.packageList
+          this.serviceList = res.data.serviceList
+          if (this.packageList.length === 0) {
+            this.insertOnePackage()
+          }
+          if (this.serviceList.length === 0) {
+            this.insertOneSerivice()
+          }
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 校验文本框内容
     validateInputContent() {
-      const hasEmptyPackage = this.packageList.some(item => {
+      const hasEmptyPackage = this.packageList.some((item) => {
         for (const key in item) {
           if (!item[key]) return false
         }
         return true
       })
-      const hasEmptyService = this.serviceList.some(item => {
+      const hasEmptyService = this.serviceList.some((item) => {
         for (const key in item) {
           if (!item[key]) return false
         }
@@ -111,10 +137,14 @@ export default {
         this.$message.warning('已添加项不能为空')
         return
       }
-      updateConfigure({ packageList: this.packageList, serviceList: this.serviceList }).then(res => {
-        console.log(res)
-        this.$message.success('套餐配置保存成功')
-      })
+      updateConfigure({ packageList: this.packageList, serviceList: this.serviceList })
+        .then((res) => {
+          console.log(res)
+          this.$message.success('套餐配置保存成功')
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 添加一条空套餐记录
     insertOnePackage() {
@@ -138,14 +168,16 @@ export default {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
-        }).then(() => {
-          this.packageList.splice(index, 1)
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消删除'
-          })
         })
+          .then(() => {
+            this.packageList.splice(index, 1)
+          })
+          .catch(() => {
+            this.$message({
+              type: 'info',
+              message: '已取消删除'
+            })
+          })
       } else {
         this.packageList.splice(index, 1)
       }
@@ -157,14 +189,16 @@ export default {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
-        }).then(() => {
-          this.serviceList.splice(index, 1)
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消删除'
-          })
         })
+          .then(() => {
+            this.serviceList.splice(index, 1)
+          })
+          .catch(() => {
+            this.$message({
+              type: 'info',
+              message: '已取消删除'
+            })
+          })
       } else {
         this.serviceList.splice(index, 1)
       }

+ 6 - 0
src/views/admin/member/settings/service-edit.vue

@@ -102,6 +102,9 @@ export default {
             return item
           })
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.isLoading = false
         })
@@ -118,6 +121,9 @@ export default {
           this.$store.dispatch('tagsView/delView', this.$route)
           this.$router.back()
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.isLoading = false
         })

+ 34 - 18
src/views/admin/settings/accounts/edit.vue

@@ -100,31 +100,43 @@ export default {
   methods: {
     // 获取角色列表
     fetchRoleList() {
-      fetchRoleList().then(res => {
-        this.roleList = [...this.roleList, ...res.data.list]
-      })
+      fetchRoleList()
+        .then((res) => {
+          this.roleList = [...this.roleList, ...res.data.list]
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 修改保存用户信息
     updateUserInfo() {
       this.userInfo.roleIds = this.userInfo.roleList.join(',')
-      updateUser(this.userInfo.id, this.userInfo).then(res => {
-        this.$message.success('修改用户成功')
-        this.$store.dispatch('tagsView/delView', this.$route)
-        this.$router.back()
-      })
+      updateUser(this.userInfo.id, this.userInfo)
+        .then((res) => {
+          this.$message.success('修改用户成功')
+          this.$store.dispatch('tagsView/delView', this.$route)
+          this.$router.back()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 保存用户信息
     createUserInfo() {
       this.userInfo.roleIds = this.userInfo.roleList.join(',')
-      createUser(this.userInfo).then(res => {
-        this.$message.success('添加用户成功')
-        this.$store.dispatch('tagsView/delView', this.$route)
-        this.$router.back()
-      })
+      createUser(this.userInfo)
+        .then((res) => {
+          this.$message.success('添加用户成功')
+          this.$store.dispatch('tagsView/delView', this.$route)
+          this.$router.back()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 提交表单
     onSubmit() {
-      this.$refs.userInfoFormRef.validate(valide => {
+      this.$refs.userInfoFormRef.validate((valide) => {
         if (!valide) return
         if (this.editType === 'add') {
           this.createUserInfo()
@@ -135,9 +147,13 @@ export default {
     },
     // 获取用户信息
     fetchUserInfo() {
-      getUser(this.userInfo.id).then(res => {
-        this.setUserInfo(res.data)
-      })
+      getUser(this.userInfo.id)
+        .then((res) => {
+          this.setUserInfo(res.data)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 设置用户信息
     setUserInfo(data) {
@@ -147,7 +163,7 @@ export default {
           this.userInfo[key] = data[key]
         }
       }
-      this.userInfo.roleList = data.roleIds.split(',').map(item => parseInt(item))
+      this.userInfo.roleList = data.roleIds.split(',').map((item) => parseInt(item))
     }
   }
 }

+ 8 - 4
src/views/admin/settings/accounts/index.vue

@@ -102,10 +102,14 @@ export default {
     },
     // 获取用户列表
     fetchUserList() {
-      fetchUserList(this.listQuery).then((res) => {
-        console.log(res)
-        this.list = res.data.list
-      })
+      fetchUserList(this.listQuery)
+        .then((res) => {
+          console.log(res)
+          this.list = res.data.list
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 删除用户
     removeUser(row) {

+ 10 - 6
src/views/admin/settings/auth-card/components/supplier-list.vue

@@ -139,12 +139,16 @@ export default {
     },
     // 获取供应商列表
     fetchSupplierList() {
-      fetchSupplierList(this.listQuery).then((res) => {
-        console.log(res)
-        this.supplierList = [...this.supplierList, ...res.data.list]
-        this.hasNextPage = res.data.hasNextPage
-        this.total = res.data.total
-      })
+      fetchSupplierList(this.listQuery)
+        .then((res) => {
+          console.log(res)
+          this.supplierList = [...this.supplierList, ...res.data.list]
+          this.hasNextPage = res.data.hasNextPage
+          this.total = res.data.total
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     onLoad() {
       if (!this.hasNextPage) return

+ 15 - 7
src/views/admin/settings/menus/components/edit-page.vue

@@ -216,10 +216,14 @@ export default {
 
     // 获取父菜单信息
     fetchParentMenuInfo() {
-      getMenu(this.menuData.parentId).then((res) => {
-        this.parentMenuData = res.data
-        this.menuData.baseFlag = res.data.baseFlag
-      })
+      getMenu(this.menuData.parentId)
+        .then((res) => {
+          this.parentMenuData = res.data
+          this.menuData.baseFlag = res.data.baseFlag
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
 
     // 获取父级菜单列表
@@ -234,9 +238,13 @@ export default {
 
     // 获取菜单数据
     fetchMenuInfo() {
-      getMenu(this.menuData.id).then((res) => {
-        this.setMenuData(res.data)
-      })
+      getMenu(this.menuData.id)
+        .then((res) => {
+          this.setMenuData(res.data)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
 
     // 设置菜单数据(编辑时调用)

+ 11 - 7
src/views/admin/settings/menus/components/table-list.vue

@@ -217,14 +217,19 @@ export default {
 
     // 编辑成功
     onEditSuccess() {
-      this.$store.dispatch('tagsView/delCachedView', this.$route).then(() => {
-        const { fullPath } = this.$route
-        this.$nextTick(() => {
-          this.$router.replace({
-            path: '/redirect' + fullPath
+      this.$store
+        .dispatch('tagsView/delCachedView', this.$route)
+        .then(() => {
+          const { fullPath } = this.$route
+          this.$nextTick(() => {
+            this.$router.replace({
+              path: '/redirect' + fullPath
+            })
           })
         })
-      })
+        .catch((error) => {
+          console.log(error)
+        })
     },
 
     // 更新状态
@@ -294,4 +299,3 @@ export default {
   }
 }
 </script>
-

+ 35 - 19
src/views/admin/settings/roles/edit.vue

@@ -73,9 +73,13 @@ export default {
     },
     // 获取菜单权限列表
     getMenuTree() {
-      sysMenuTree({ menuType: 1 }).then((res) => {
-        this.menuTree = res.data
-      })
+      sysMenuTree({ menuType: 1 })
+        .then((res) => {
+          this.menuTree = res.data
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 设置角色信息
     setRoleInfo(data) {
@@ -89,28 +93,40 @@ export default {
     },
     // 获取角色信息
     fetchRoleInfo() {
-      getRole(this.role.id).then((res) => {
-        console.log(res.data)
-        this.setRoleInfo(res.data)
-      })
+      getRole(this.role.id)
+        .then((res) => {
+          console.log(res.data)
+          this.setRoleInfo(res.data)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 修改角色
     updateRole() {
-      updateRole(this.role.id, this.role).then((res) => {
-        console.log(res)
-        this.$message.success('修改角色成功')
-        this.$store.dispatch('tagsView/delView', this.$route)
-        this.$router.back()
-      })
+      updateRole(this.role.id, this.role)
+        .then((res) => {
+          console.log(res)
+          this.$message.success('修改角色成功')
+          this.$store.dispatch('tagsView/delView', this.$route)
+          this.$router.back()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 创建角色
     createRole() {
-      createRole(this.role).then((res) => {
-        console.log(res)
-        this.$message.success('添加角色成功')
-        this.$store.dispatch('tagsView/delView', this.$route)
-        this.$router.back()
-      })
+      createRole(this.role)
+        .then((res) => {
+          console.log(res)
+          this.$message.success('添加角色成功')
+          this.$store.dispatch('tagsView/delView', this.$route)
+          this.$router.back()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 提交
     handleSubmit() {

+ 13 - 5
src/views/admin/settings/roles/index.vue

@@ -37,7 +37,11 @@
       </el-table-column>
       <el-table-column label="操作" align="center" width="200">
         <template slot-scope="{ row }">
-          <el-button type="primary" size="mini" @click="navigationTo(`roles/edit?type=edit&id=${row.id}`)">编辑</el-button>
+          <el-button
+            type="primary"
+            size="mini"
+            @click="navigationTo(`roles/edit?type=edit&id=${row.id}`)"
+          >编辑</el-button>
           <el-button type="danger" size="mini" @click="removeRole(row)">删除</el-button>
         </template>
       </el-table-column>
@@ -77,9 +81,13 @@ export default {
     },
     // 获取角色列表
     fetchRoleList() {
-      fetchRoleList(this.listQuery).then(res => {
-        this.list = res.data.list
-      })
+      fetchRoleList(this.listQuery)
+        .then((res) => {
+          this.list = res.data.list
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 删除角色
     removeRole(row) {
@@ -89,7 +97,7 @@ export default {
         type: 'warning'
       })
         .then(() => {
-          deleteRole(row.id).then(res => {
+          deleteRole(row.id).then((res) => {
             this.$message.success('删除角色成功')
             this.getList()
           })

+ 3 - 0
src/views/admin/supplier/club/device/index.vue

@@ -187,6 +187,9 @@ export default {
           this.list = list
           // this.checkAuditFailedList(list)
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })

+ 20 - 9
src/views/admin/supplier/edit_old.vue

@@ -422,9 +422,13 @@ export default {
     // 获取供应商信息
     fetchSupplierInfo() {
       if (!this.id) return
-      getSupplierById({ authUserId: this.id }).then((res) => {
-        this.initSupplierInfo(res.data)
-      })
+      getSupplierById({ authUserId: this.id })
+        .then((res) => {
+          this.initSupplierInfo(res.data)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
 
     // 初始化供应商信息
@@ -499,6 +503,9 @@ export default {
           this.$store.dispatch('tagsView/delView', this.$route)
           this.$router.replace('/supplier/list')
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.isLoading = false
         })
@@ -717,12 +724,16 @@ export default {
     },
     // 获取品牌列表
     getBrandList(type) {
-      fetchBrandList({ type }).then((res) => {
-        if (res.code !== 0) {
-          return
-        }
-        this.brandList = res.data
-      })
+      fetchBrandList({ type })
+        .then((res) => {
+          if (res.code !== 0) {
+            return
+          }
+          this.brandList = res.data
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     /** 品牌标签操作END */
 

+ 12 - 8
src/views/admin/supplier/index.vue

@@ -197,15 +197,19 @@ export default {
       })
       if (text !== 'confirm') return
       // 要执行的操作
-      resetPassword({ authUserId: item.authUserId }).then((res) => {
-        if (res.code !== 0) return
-        const h = this.$createElement
-        this.$notify.success({
-          title: '重置密码',
-          message: h('i', { style: 'color: #333' }, `已重置供应商"${item.name}"的密码`),
-          duration: 2000
+      resetPassword({ authUserId: item.authUserId })
+        .then((res) => {
+          if (res.code !== 0) return
+          const h = this.$createElement
+          this.$notify.success({
+            title: '重置密码',
+            message: h('i', { style: 'color: #333' }, `已重置供应商"${item.name}"的密码`),
+            duration: 2000
+          })
+        })
+        .catch((error) => {
+          console.log(error)
         })
-      })
     },
     // 代他操作
     async handleProxy(item) {

+ 20 - 9
src/views/common/helper/document/index.vue

@@ -292,6 +292,9 @@ export default {
           // this.list = res.data.list
           this.total = res.data.total
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })
@@ -307,11 +310,15 @@ export default {
         this.$message.info('已取消操作')
       })
       if (text !== 'confirm') return
-      removeCourse({ fileId: row.fileId }).then((res) => {
-        if (res.code !== 0) return
-        this.$message.success('删除成功')
-        this.getList(this.listQuery)
-      })
+      removeCourse({ fileId: row.fileId })
+        .then((res) => {
+          if (res.code !== 0) return
+          this.$message.success('删除成功')
+          this.getList(this.listQuery)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
 
     // 预览
@@ -356,10 +363,14 @@ export default {
 
     // 获取模块列表
     getMenuTree() {
-      sysMenuTree({ menuType: 2 }).then((res) => {
-        this.menuTree = res.data
-        this.getList()
-      })
+      sysMenuTree({ menuType: 2 })
+        .then((res) => {
+          this.menuTree = res.data
+          this.getList()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 表格索引
     indexMethod(index) {

+ 21 - 14
src/views/common/helper/video/index.vue

@@ -19,11 +19,7 @@
       </div>
       <div class="filter-control">
         <el-button type="primary" @click="getList">查询</el-button>
-        <el-button
-          v-if="userIdentity === 1"
-          type="primary"
-          @click="dialogVisible = true"
-        >添加</el-button>
+        <el-button v-if="userIdentity === 1" type="primary" @click="dialogVisible = true">添加</el-button>
       </div>
     </div>
     <!-- 搜索区域END -->
@@ -281,6 +277,9 @@ export default {
           this.list = this.formatFileModuleType(res.data.list)
           this.total = res.data.total
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })
@@ -296,11 +295,15 @@ export default {
         this.$message.info('已取消操作')
       })
       if (text !== 'confirm') return
-      removeCourse({ fileId: row.fileId }).then((res) => {
-        if (res.code !== 0) return
-        this.$message.success('删除成功')
-        this.getList(this.listQuery)
-      })
+      removeCourse({ fileId: row.fileId })
+        .then((res) => {
+          if (res.code !== 0) return
+          this.$message.success('删除成功')
+          this.getList(this.listQuery)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
 
     // 预览
@@ -340,10 +343,14 @@ export default {
     },
     // 获取模块列表
     getMenuTree() {
-      sysMenuTree({ menuType: 2 }).then((res) => {
-        this.menuTree = res.data
-        this.getList()
-      })
+      sysMenuTree({ menuType: 2 })
+        .then((res) => {
+          this.menuTree = res.data
+          this.getList()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 表格索引
     indexMethod(index) {

+ 20 - 14
src/views/common/login/index.vue

@@ -54,7 +54,7 @@
       <el-button
         :loading="loading"
         type="primary"
-        style="width:100%;margin-bottom:44px;"
+        style="width: 100%; margin-bottom: 44px"
         @click.native.prevent="handleLogin"
       >登录</el-button>
     </el-form>
@@ -106,19 +106,25 @@ export default {
       })
     },
     handleLogin() {
-      this.$refs.loginForm.validate(valid => {
+      this.$refs.loginForm.validate((valid) => {
         if (!valid) return
         this.loading = true
-        this.$store.dispatch('user/login', this.loginForm).then(res => {
-          // 保存token及用户信息
-          if (!res.data) return
-          setToken(res.data.token)
-          setUserInfo(res.data)
-          this.$store.commit('tagsView/CLEAR_ALL_VIEW')
-          this.$router.replace({ path: '/login/redirect' })
-        }).finally(() => {
-          this.loading = false
-        })
+        this.$store
+          .dispatch('user/login', this.loginForm)
+          .then((res) => {
+            // 保存token及用户信息
+            if (!res.data) return
+            setToken(res.data.token)
+            setUserInfo(res.data)
+            this.$store.commit('tagsView/CLEAR_ALL_VIEW')
+            this.$router.replace({ path: '/login/redirect' })
+          })
+          .catch((error) => {
+            console.log(error)
+          })
+          .finally(() => {
+            this.loading = false
+          })
       })
     },
     handleInput() {
@@ -224,11 +230,11 @@ $light_gray: #eee;
       margin: 0px auto 40px auto;
       text-align: center;
       font-weight: bold;
-      span{
+      span {
         vertical-align: middle;
         margin-left: 16px;
       }
-      img{
+      img {
         width: 50px;
         height: 50px;
         vertical-align: middle;

+ 0 - 1
src/views/common/password/index.vue

@@ -83,7 +83,6 @@ export default {
         // 退出登录重置用户信息
         this.$store.dispatch('user/logout')
         // 重置相关state
-        this.$store.dispatch('resetState')
         this.$router.replace('/login')
       }, 500)
     }

+ 11 - 7
src/views/common/share/pay/pay.vue

@@ -99,13 +99,17 @@ export default {
     },
     // 获取订单信息
     fetchPayInfoWithLinkLogo() {
-      fetchPayInfoWithLinkLogo({ linkLogo: this.linkLogo }).then((res) => {
-        const result = JSON.parse(res.data)
-        this.orderPayLink = result.orderPayLink
-        this.authUser = result.authUser
-        console.log(result)
-        this.countDown()
-      })
+      fetchPayInfoWithLinkLogo({ linkLogo: this.linkLogo })
+        .then((res) => {
+          const result = JSON.parse(res.data)
+          this.orderPayLink = result.orderPayLink
+          this.authUser = result.authUser
+          console.log(result)
+          this.countDown()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 确认支付事件
     handleConfirmPay(e) {

+ 7 - 3
src/views/components/ClubDetail/index.vue

@@ -215,9 +215,13 @@ export default {
     },
     // 数据回显
     getDetail() {
-      getAuthFormData({ authId: this.authId }).then((res) => {
-        this.clubInfo = { ...this.clubInfo, ...res.data }
-      })
+      getAuthFormData({ authId: this.authId })
+        .then((res) => {
+          this.clubInfo = { ...this.clubInfo, ...res.data }
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     }
   }
 }

+ 3 - 0
src/views/components/DeviceDetail/index.vue

@@ -86,6 +86,9 @@ export default {
         .then((res) => {
           this.productInfo = { ...this.productInfo, ...res.data }
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.isLoading = false
         })

+ 31 - 18
src/views/components/payment/pay-alipay.vue

@@ -1,6 +1,8 @@
 <template>
   <div class="pay-code">
-    <div class="paymount">扫码付款:<span class="exp">¥</span><span class="price">{{ data.payAmount | formatPrice }}</span></div>
+    <div class="paymount">
+      扫码付款:<span class="exp">¥</span><span class="price">{{ data.payAmount | formatPrice }}</span>
+    </div>
     <el-image v-loading="isLoading" :src="payUrl" class="qrcode" />
     <div class="pay-tip">
       <i class="icon-alipay" />
@@ -43,32 +45,43 @@ export default {
         vipRecordId: this.data.vipRecordId
       }
       this.isLoading = true
-      payVipWithAlipay(params).then(res => {
-        const result = JSON.parse(res.data)
-        console.log(result)
-        if (result.rt2_retCode === '0000') {
-          this.payData = {
-            mbOrderId: result.rt5_orderId,
-            qrcodeUrl: result.rt8_qrcode
+      payVipWithAlipay(params)
+        .then((res) => {
+          const result = JSON.parse(res.data)
+          console.log(result)
+          if (result.rt2_retCode === '0000') {
+            this.payData = {
+              mbOrderId: result.rt5_orderId,
+              qrcodeUrl: result.rt8_qrcode
+            }
+            this.drawQrcode()
+          } else {
+            this.$message.error('支付系统遇到点小问题,请稍后重试')
+            this.isLoading = false
           }
-          this.drawQrcode()
-        } else {
-          this.$message.error('支付系统遇到点小问题,请稍后重试')
-          this.isLoading = false
-        }
-      })
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 绘制支付二维码
     drawQrcode() {
       qrcode
-        .toDataURL(this.payData.qrcodeUrl, { width: 180, margin: 0, errorCorrectionLevel: 'H', type: 'image/jpeg', scale: 4 })
-        .then(url => {
+        .toDataURL(this.payData.qrcodeUrl, {
+          width: 180,
+          margin: 0,
+          errorCorrectionLevel: 'H',
+          type: 'image/jpeg',
+          scale: 4
+        })
+        .then((url) => {
           this.payUrl = url
           this.checkedPayConfirm()
         })
-        .catch(err => {
+        .catch((err) => {
           console.error(err)
-        }).finally(() => {
+        })
+        .finally(() => {
           this.isLoading = false
         })
     },

+ 9 - 5
src/views/components/payment/pay-bank.vue

@@ -102,11 +102,15 @@ export default {
   methods: {
     // 获取网银支付列表
     fetchBankcodeList() {
-      fetchBankcodeList().then((res) => {
-        const result = JSON.parse(res.data)
-        this.bankB2BList = result.B2B
-        this.bankB2CList = result.B2C
-      })
+      fetchBankcodeList()
+        .then((res) => {
+          const result = JSON.parse(res.data)
+          this.bankB2BList = result.B2B
+          this.bankB2CList = result.B2C
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 确认支付弹窗
     handleConfirmPay() {

+ 89 - 75
src/views/normal/club/device/edit.vue

@@ -1,80 +1,89 @@
 <template>
   <div class="device-edit page-form-container">
-    <el-form ref="form" label-width="130px" :model="formData" :rules="rules">
-      <el-form-item label="认证方式:">
-        <span>{{ authTypeName }}</span>
-      </el-form-item>
-      <el-form-item label="设备名称:" prop="productTypeId">
-        <el-select v-model="formData.productTypeId" style="width: 100%" clearable>
-          <el-option
-            v-for="item in productCateList"
-            :key="item.productTypeId"
-            :label="item.name"
-            :value="item.productTypeId"
-          />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="设备SN码:" prop="snCode">
-        <el-input v-model="formData.snCode" placeholder="设备SN码" />
-      </el-form-item>
-      <el-form-item label="认证日期:" prop="authDate">
-        <el-date-picker v-model="formData.authDate" type="date" placeholder="选择日期" style="width: 100%" />
-      </el-form-item>
-      <el-form-item label="授权牌:" prop="certificateImageType">
-        <el-radio-group v-model="formData.certificateImageType" size="mini">
-          <el-radio :label="1">模板库生成</el-radio>
-          <el-radio :label="2">自定义上传</el-radio>
-        </el-radio-group>
-        <template v-if="formData.certificateImageType === 1">
-          <div v-if="authTempFlag">
-            <preview-image v-if="formData.certificateImage" :src="formData.certificateImage" />
-          </div>
-          <div v-else>无</div>
-        </template>
-        <template v-else>
-          <upload-image
-            tip="建议尺寸:150px * 112px"
-            :image-list="certificateImageList"
-            :before-upload="beforeCertificateImageUpload"
-            @success="uploadCertificateImageSuccess"
-            @remove="handleCertificateImageRemove"
-          />
-        </template>
-      </el-form-item>
-      <el-form-item v-if="authTempFlag && formData.certificateImageType === 1" label="授权牌logo:">
-        <div class="form-label-tip">授权牌logo(提示:授权牌logo与机构名称组合)</div>
-        <div style="margin-top: 8px">
-          <upload-image
-            :tip="authImageLogoUploadTip"
-            :image-list="authImageLogoList"
-            :before-upload="beforeAuthImageLogoUpload"
-            @success="uploadAuthImageLogoSuccess"
-            @remove="handleAuthImageLogoRemove"
-          />
-          <el-input v-show="false" v-model="formData.authImageLogo" />
-        </div>
-      </el-form-item>
-      <el-form-item label="购买渠道:" prop="purchaseWay">
-        <el-input v-model="formData.purchaseWay" placeholder="购买渠道" />
-      </el-form-item>
-      <el-form-item label="发票:" prop="invoiceImage">
-        <upload-image
-          tip="建议图片分辨率:242px*242px"
-          :limit="1"
-          :image-list="invoiceImageList"
-          :before-upload="beforeInvoiceImageUpload"
-          @success="uploadInvoiceImageSuccess"
-          @remove="handleInvoiceImageRemove"
-        />
-        <el-input v-show="false" v-model="formData.invoiceImage" />
-      </el-form-item>
-    </el-form>
+    <el-form ref="form" label-width="100px" :model="formData" :rules="rules">
+      <el-tabs v-model="activeName">
+        <!-- 基础资料 -->
+        <el-tab-pane label="基础资料" name="first">
+          <el-form-item label="设备名称:" prop="productTypeId">
+            <el-select v-model="formData.productTypeId" style="width: 100%" clearable>
+              <el-option
+                v-for="item in productCateList"
+                :key="item.productTypeId"
+                :label="item.name"
+                :value="item.productTypeId"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="设备SN码:" prop="snCode">
+            <el-input v-model="formData.snCode" placeholder="设备SN码" />
+          </el-form-item>
+          <el-form-item label="购买渠道:" prop="purchaseWay">
+            <el-input v-model="formData.purchaseWay" placeholder="购买渠道" />
+          </el-form-item>
+          <el-form-item label="发票:" prop="invoiceImage">
+            <upload-image
+              tip="建议图片分辨率:242px*242px"
+              :limit="1"
+              :image-list="invoiceImageList"
+              :before-upload="beforeInvoiceImageUpload"
+              @success="uploadInvoiceImageSuccess"
+              @remove="handleInvoiceImageRemove"
+            />
+            <el-input v-show="false" v-model="formData.invoiceImage" />
+          </el-form-item>
+          <el-form-item label="认证方式:">
+            <span>{{ authTypeName }}</span>
+          </el-form-item>
+        </el-tab-pane>
+        <!-- 授权牌资料 -->
+        <el-tab-pane label="授权牌资料" name="second">
+          <el-form-item label="授权牌:" prop="certificateImageType">
+            <el-radio-group v-model="formData.certificateImageType" size="mini">
+              <el-radio :label="1">模板库生成</el-radio>
+              <el-radio :label="2">自定义上传</el-radio>
+            </el-radio-group>
+            <template v-if="formData.certificateImageType === 1">
+              <div v-if="authTempFlag">
+                <preview-image v-if="formData.certificateImage" :src="formData.certificateImage" />
+              </div>
+              <div v-else>无</div>
+            </template>
+            <template v-else>
+              <upload-image
+                tip="建议尺寸:150px * 112px"
+                :image-list="certificateImageList"
+                :before-upload="beforeCertificateImageUpload"
+                @success="uploadCertificateImageSuccess"
+                @remove="handleCertificateImageRemove"
+              />
+            </template>
+          </el-form-item>
+          <el-form-item v-if="authTempFlag && formData.certificateImageType === 1" label="授权牌logo:">
+            <div class="form-label-tip">授权牌logo(提示:授权牌logo与机构名称组合)</div>
+            <div style="margin-top: 8px">
+              <upload-image
+                :tip="authImageLogoUploadTip"
+                :image-list="authImageLogoList"
+                :before-upload="beforeAuthImageLogoUpload"
+                @success="uploadAuthImageLogoSuccess"
+                @remove="handleAuthImageLogoRemove"
+              />
+              <el-input v-show="false" v-model="formData.authImageLogo" />
+            </div>
+          </el-form-item>
+          <el-form-item label="认证日期:" prop="authDate">
+            <el-date-picker v-model="formData.authDate" type="date" placeholder="选择日期" style="width: 100%" />
+          </el-form-item>
+
+        </el-tab-pane>
+      </el-tabs>
 
-    <!-- 表单提交 返回 -->
-    <div class="control-box">
-      <el-button type="primary" @click="submit">保存</el-button>
-      <el-button type="warning" @click="navigateBack">返回</el-button>
-    </div>
+      <!-- 表单提交 返回 -->
+      <div class="control-box">
+        <el-button type="primary" @click="submit">保存</el-button>
+        <el-button type="warning" @click="navigateBack">返回</el-button>
+      </div>
+    </el-form>
   </div>
 </template>
 
@@ -95,6 +104,7 @@ export default {
       callback()
     }
     return {
+      activeName: 'first',
       editType: 'add',
       isLoading: false,
       formData: {
@@ -311,4 +321,8 @@ export default {
 }
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.el-tab-pane {
+  margin-top: 24px;
+}
+</style>

+ 9 - 0
src/views/normal/club/device/index.vue

@@ -215,6 +215,9 @@ export default {
           this.list = list
           // this.checkAuditFailedList(list)
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })
@@ -240,6 +243,9 @@ export default {
             })
             this.listLoading = false
           })
+          .catch((error) => {
+            console.log(error)
+          })
           .finally(() => {
             this.getList()
           })
@@ -269,6 +275,9 @@ export default {
             duration: 2000
           })
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.getList()
         })

+ 10 - 6
src/views/normal/club/edit.vue

@@ -122,12 +122,16 @@ export default {
     // 初始化机构数据
     initFormData() {
       if (!this.authId) return
-      getAuthFormData({ authId: this.authId }).then((res) => {
-        this.$refs.ClubBasicsInfo.initForm(res.data)
-        this.$refs.ClubAuthorizeBrand.initForm(res.data)
-        this.$refs.ClubAssociated.initForm(res.data)
-        this.$refs.ClubSpecialInfo.initForm(res.data)
-      })
+      getAuthFormData({ authId: this.authId })
+        .then((res) => {
+          this.$refs.ClubBasicsInfo.initForm(res.data)
+          this.$refs.ClubAuthorizeBrand.initForm(res.data)
+          this.$refs.ClubAssociated.initForm(res.data)
+          this.$refs.ClubSpecialInfo.initForm(res.data)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 获取授权牌模板
     fetchAuthTempUsed() {}

+ 16 - 9
src/views/normal/docs/article-edit.vue

@@ -118,6 +118,9 @@ export default {
             this.$store.dispatch('tagsView/delView', this.$route)
             this.$router.back()
           })
+          .catch((error) => {
+            console.log(error)
+          })
           .finally(() => {
             this.isLoading = false
           })
@@ -126,17 +129,21 @@ export default {
     // 初始化表单回显数据
     initFormData() {
       if (!this.formData.articleId) return
-      getArticleDeatil({ articleId: this.formData.articleId }).then((res) => {
-        for (const key in this.formData) {
-          if (Object.hasOwnProperty.call(this.formData, key)) {
-            if (res.data[key]) {
-              this.formData[key] = res.data[key]
+      getArticleDeatil({ articleId: this.formData.articleId })
+        .then((res) => {
+          for (const key in this.formData) {
+            if (Object.hasOwnProperty.call(this.formData, key)) {
+              if (res.data[key]) {
+                this.formData[key] = res.data[key]
+              }
             }
           }
-        }
-        this.imageList = [{ name: '文章封面', url: this.formData.articleImage }]
-        console.log(res)
-      })
+          this.imageList = [{ name: '文章封面', url: this.formData.articleImage }]
+          console.log(res)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 封面图片上传成功
     handleUploadImageSussces({ response, file, fileList }) {

+ 22 - 15
src/views/normal/feedback/detail.vue

@@ -8,11 +8,11 @@
         </el-form-item>
         <el-form-item label="手机号:">{{ feedbackData.mobile }}</el-form-item>
         <el-form-item label="反馈内容:">
-          <div style="overflow-wrap:anywhere;text-align:justify">{{ feedbackData.content }}</div>
+          <div style="overflow-wrap: anywhere; text-align: justify">{{ feedbackData.content }}</div>
         </el-form-item>
         <el-form-item label="处理状态:">
-          <span v-if="feedbackData.handleStatus===0" class="status danger">未处理</span>
-          <span v-if="feedbackData.handleStatus===1" class="status success">已处理</span>
+          <span v-if="feedbackData.handleStatus === 0" class="status danger">未处理</span>
+          <span v-if="feedbackData.handleStatus === 1" class="status success">已处理</span>
         </el-form-item>
         <el-form-item label="处理结果:" prop="handleResult">
           <el-input v-model="formData.handleResult" type="textarea" placeholder="请添加处理结果" />
@@ -49,10 +49,10 @@ export default {
   methods: {
     // 提交处理信息
     submit() {
-      this.$refs.formRef.validate(valid => {
+      this.$refs.formRef.validate((valid) => {
         if (!valid) return
         handleFeedback({ feedbackId: this.feedbackId, handleResult: this.formData.handleResult })
-          .then(res => {
+          .then((res) => {
             if (res.code !== 0) return
             this.$message({
               message: res.data,
@@ -62,30 +62,37 @@ export default {
             this.$store.dispatch('tagsView/delView', this.$route)
             this.$router.back()
           })
+          .catch((error) => {
+            console.log(error)
+          })
       })
     },
     // 获取反馈信息
     getDetail() {
-      getFeedbackDetail({ feedbackId: this.feedbackId }).then(res => {
-        console.log(res)
-        this.feedbackData = res.data
-        if (this.feedbackData.handleResult) {
-          this.formData.handleResult = this.feedbackData.handleResult
-        }
-      })
+      getFeedbackDetail({ feedbackId: this.feedbackId })
+        .then((res) => {
+          console.log(res)
+          this.feedbackData = res.data
+          if (this.feedbackData.handleResult) {
+            this.formData.handleResult = this.feedbackData.handleResult
+          }
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     }
   }
 }
 </script>
 
 <style lang="scss" scoped>
-.form{
+.form {
   width: 800px;
   margin: 30px auto;
-  .el-button{
+  .el-button {
     width: 120px;
   }
-  h2{
+  h2 {
     text-align: center;
     margin-bottom: 45px;
     color: #444;

+ 15 - 8
src/views/normal/material/article/edit.vue

@@ -98,6 +98,9 @@ export default {
             this.$store.dispatch('tagsView/delView', this.$route)
             this.$router.back()
           })
+          .catch((error) => {
+            console.log(error)
+          })
           .finally(() => {
             this.isLoading = false
           })
@@ -106,15 +109,19 @@ export default {
     // 初始化表单回显数据
     initFormData() {
       if (!this.formData.articleId) return
-      getArticleDeatil({ articleId: this.formData.articleId }).then((res) => {
-        for (const key in this.formData) {
-          if (Object.hasOwnProperty.call(this.formData, key)) {
-            this.formData[key] = res.data[key]
+      getArticleDeatil({ articleId: this.formData.articleId })
+        .then((res) => {
+          for (const key in this.formData) {
+            if (Object.hasOwnProperty.call(this.formData, key)) {
+              this.formData[key] = res.data[key]
+            }
           }
-        }
-        this.imageList = [{ name: '文章封面', url: this.formData.articleImage }]
-        console.log(res)
-      })
+          this.imageList = [{ name: '文章封面', url: this.formData.articleImage }]
+          console.log(res)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 封面图片上传成功
     handleUploadImageSussces({ response, file, fileList }) {

+ 12 - 5
src/views/normal/material/article/index.vue

@@ -148,6 +148,9 @@ export default {
           console.log(res)
           this.total = res.data.total
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })
@@ -162,11 +165,15 @@ export default {
         this.$message.info('已取消操作')
       })
       if (text !== 'confirm') return
-      removeArticle({ articleId: row.articleId }).then((res) => {
-        if (res.code !== 0) return
-        this.$message.success(res.data)
-        this.getList(this.listQuery)
-      })
+      removeArticle({ articleId: row.articleId })
+        .then((res) => {
+          if (res.code !== 0) return
+          this.$message.success(res.data)
+          this.getList(this.listQuery)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 状态改变
     handleChangeStatus(item) {

+ 18 - 5
src/views/normal/material/file/index.vue

@@ -202,6 +202,9 @@ export default {
           this.total = res.data.total
           console.log(res)
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })
@@ -240,6 +243,9 @@ export default {
               duration: 500
             })
           })
+          .catch((error) => {
+            console.log(error)
+          })
           .finally(() => {
             this.submitLoading = false
           })
@@ -256,11 +262,15 @@ export default {
         this.$message.info('已取消操作')
       })
       if (text !== 'confirm') return
-      removeFile({ fileId: row.fileId }).then((res) => {
-        if (res.code !== 0) return
-        this.$message.success(res.data)
-        this.getList()
-      })
+      removeFile({ fileId: row.fileId })
+        .then((res) => {
+          if (res.code !== 0) return
+          this.$message.success(res.data)
+          this.getList()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
 
     // 状态改变
@@ -279,6 +289,9 @@ export default {
           })
           this.getList()
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })

+ 15 - 8
src/views/normal/material/image/edit.vue

@@ -64,14 +64,14 @@ export default {
         authUserId: this.authUserId,
         imageTitle: this.formData.imageTitle
       }
-      params.imageArr = this.imageList.map(image => image.response ? image.response.data : image.url)
+      params.imageArr = this.imageList.map((image) => (image.response ? image.response.data : image.url))
       // 校验表单数据
-      this.$refs.formRef.validate(valid => {
+      this.$refs.formRef.validate((valid) => {
         if (!valid) return
         this.isLoading = true
         // 保存
         saveImage(params)
-          .then(res => {
+          .then((res) => {
             console.log(res)
             if (res.code !== 0) return
             this.$message.success(res.data)
@@ -79,6 +79,9 @@ export default {
             this.$store.dispatch('tagsView/delView', this.$route)
             this.$router.back()
           })
+          .catch((error) => {
+            console.log(error)
+          })
           .finally(() => {
             this.isLoading = false
           })
@@ -87,11 +90,15 @@ export default {
     // 初始化表单数据
     initFormData() {
       if (this.editType !== 'edit') return
-      getImageDetail({ imageId: this.imageId }).then(res => {
-        const { imageTitle, imageList } = res.data
-        this.formData.imageTitle = imageTitle
-        this.imageList = imageList.map(image => ({ url: image, name: '' }))
-      })
+      getImageDetail({ imageId: this.imageId })
+        .then((res) => {
+          const { imageTitle, imageList } = res.data
+          this.formData.imageTitle = imageTitle
+          this.imageList = imageList.map((image) => ({ url: image, name: '' }))
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 文件上传
     handleUploadSuccess({ response, file, fileList }) {

+ 12 - 5
src/views/normal/material/image/index.vue

@@ -137,6 +137,9 @@ export default {
           this.list = res.data.list
           this.total = res.data.total
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })
@@ -152,11 +155,15 @@ export default {
         this.$message.info('已取消操作')
       })
       if (text !== 'confirm') return
-      removeImage({ imageId: row.imageId }).then((res) => {
-        if (res.code !== 0) return
-        this.$message.success(res.data)
-        this.getList(this.listQuery)
-      })
+      removeImage({ imageId: row.imageId })
+        .then((res) => {
+          if (res.code !== 0) return
+          this.$message.success(res.data)
+          this.getList(this.listQuery)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 状态改变
     handleChangeStatus(item) {

+ 18 - 5
src/views/normal/material/package/index.vue

@@ -198,6 +198,9 @@ export default {
           this.total = res.data.total
           console.log(res)
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })
@@ -236,6 +239,9 @@ export default {
               duration: 500
             })
           })
+          .catch((error) => {
+            console.log(error)
+          })
           .finally(() => {
             this.submitLoading = false
           })
@@ -252,11 +258,15 @@ export default {
         this.$message.info('已取消操作')
       })
       if (text !== 'confirm') return
-      removeFile({ fileId: row.fileId }).then((res) => {
-        if (res.code !== 0) return
-        this.$message.success(res.data)
-        this.getList()
-      })
+      removeFile({ fileId: row.fileId })
+        .then((res) => {
+          if (res.code !== 0) return
+          this.$message.success(res.data)
+          this.getList()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
 
     // 状态改变
@@ -275,6 +285,9 @@ export default {
           })
           this.getList()
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })

+ 15 - 5
src/views/normal/material/video/index.vue

@@ -256,6 +256,9 @@ export default {
           this.total = res.data.total
           console.log(res)
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.listLoading = false
         })
@@ -311,6 +314,9 @@ export default {
               duration: 500
             })
           })
+          .catch((error) => {
+            console.log(error)
+          })
           .finally(() => {
             this.submitLoading = false
           })
@@ -343,11 +349,15 @@ export default {
         this.$message.info('已取消操作')
       })
       if (text !== 'confirm') return
-      removeVideo({ videoId: row.videoId }).then((res) => {
-        if (res.code !== 0) return
-        this.$message.success(res.data)
-        this.getList()
-      })
+      removeVideo({ videoId: row.videoId })
+        .then((res) => {
+          if (res.code !== 0) return
+          this.$message.success(res.data)
+          this.getList()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 显示对话框
     handleShowDialog(type, row) {

+ 9 - 5
src/views/normal/personal/index.vue

@@ -187,11 +187,15 @@ export default {
   methods: {
     // 获取供应商信息
     fetchSupplierInfo() {
-      getSupplierById({ authUserId: this.$store.getters.authUserId }).then((res) => {
-        console.log(res)
-        this.supplierInfo = res.data
-        this.brandList = res.data.shopInfo
-      })
+      getSupplierById({ authUserId: this.$store.getters.authUserId })
+        .then((res) => {
+          console.log(res)
+          this.supplierInfo = res.data
+          this.brandList = res.data.shopInfo
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 品牌信息变化
     onBrandFormChange(data) {

+ 21 - 11
src/views/normal/personal/set-account.vue

@@ -10,7 +10,9 @@
             <el-input v-model="formData.verifyCode" placeholder="请输入验证码" />
           </el-col>
           <el-col :span="6" class="send-code">
-            <el-button type="primary" :disabled="sendStatus > 0" @click="handleSendVerifyCode">{{ sendCodeBtnText }}</el-button>
+            <el-button type="primary" :disabled="sendStatus > 0" @click="handleSendVerifyCode">{{
+              sendCodeBtnText
+            }}</el-button>
           </el-col>
         </el-row>
       </el-form-item>
@@ -71,7 +73,7 @@ export default {
   },
   methods: {
     submit() {
-      this.$refs.form.validate(valide => {
+      this.$refs.form.validate((valide) => {
         if (!valide) return
         this.handleBindLoginAccount()
       })
@@ -79,11 +81,15 @@ export default {
     // 绑定登录号
     handleBindLoginAccount() {
       this.formData.authUserId = this.$store.getters.authUserId
-      bindLoginAccount(this.formData).then(res => {
-        this.$message.success('绑定登录号成功')
-        this.$store.dispatch('tagsView/delView', this.$route)
-        this.$router.back()
-      })
+      bindLoginAccount(this.formData)
+        .then((res) => {
+          this.$message.success('绑定登录号成功')
+          this.$store.dispatch('tagsView/delView', this.$route)
+          this.$router.back()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 发送验证码
     handleSendVerifyCode() {
@@ -91,10 +97,14 @@ export default {
         this.$message.warning('请输入正确的手机号')
         return
       }
-      sendVerifyCode({ mobile: this.formData.mobile }).then(res => {
-        this.$message.success('验证码已发送')
-        this.countdown()
-      })
+      sendVerifyCode({ mobile: this.formData.mobile })
+        .then((res) => {
+          this.$message.success('验证码已发送')
+          this.countdown()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 验证码倒计时
     countdown() {

+ 17 - 9
src/views/normal/personal/set-mobile.vue

@@ -75,11 +75,15 @@ export default {
     // 保存
     saveMobile() {
       this.formData.authUserId = this.$store.getters.authUserId
-      resetMobile(this.formData).then((res) => {
-        this.$message.success('修改手机号成功')
-        this.$store.dispatch('tagsView/delView', this.$route)
-        this.$router.back()
-      })
+      resetMobile(this.formData)
+        .then((res) => {
+          this.$message.success('修改手机号成功')
+          this.$store.dispatch('tagsView/delView', this.$route)
+          this.$router.back()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 发送验证码
     handleSendVerifyCode() {
@@ -87,10 +91,14 @@ export default {
         this.$message.warning('请输入正确的手机号')
         return
       }
-      sendVerifyCode({ mobile: this.formData.oldMobile }).then((res) => {
-        this.$message.success('验证码已发送')
-        this.countdown()
-      })
+      sendVerifyCode({ mobile: this.formData.oldMobile })
+        .then((res) => {
+          this.$message.success('验证码已发送')
+          this.countdown()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 验证码倒计时
     countdown() {

+ 25 - 13
src/views/normal/personal/vip-record.vue

@@ -177,10 +177,14 @@ export default {
     },
     fetchVipRecord() {
       console.log(this.listQuery)
-      fetchVipRecord(this.listQuery).then((res) => {
-        console.log(res)
-        this.list = [...this.list, ...res.data.list]
-      })
+      fetchVipRecord(this.listQuery)
+        .then((res) => {
+          console.log(res)
+          this.list = [...this.list, ...res.data.list]
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     handleShowDemand(row) {
       this.dialogTableVisible = true
@@ -194,19 +198,27 @@ export default {
     },
     // 获取套餐列表
     fetchConfigureList() {
-      fetchConfigureList().then((res) => {
-        this.packageList = res.data.packageList.map((item, index) => {
-          item.name = `套餐${index + 1}`
-          return item
+      fetchConfigureList()
+        .then((res) => {
+          this.packageList = res.data.packageList.map((item, index) => {
+            item.name = `套餐${index + 1}`
+            return item
+          })
+        })
+        .catch((error) => {
+          console.log(error)
         })
-      })
     },
     // 获取供应商信息
     fetchSupplierInfo() {
-      getSupplierById({ authUserId: this.listQuery.authUserId }).then((res) => {
-        console.log(res)
-        this.supplierInfo = res.data
-      })
+      getSupplierById({ authUserId: this.listQuery.authUserId })
+        .then((res) => {
+          console.log(res)
+          this.supplierInfo = res.data
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     }
   }
 }

+ 23 - 11
src/views/normal/personnel/operate/edit.vue

@@ -234,9 +234,13 @@ export default {
         this.isRequest = false
         return
       }
-      doctorFormData({ doctorId: this.doctorId }).then((res) => {
-        this.setFormData(res.data)
-      })
+      doctorFormData({ doctorId: this.doctorId })
+        .then((res) => {
+          this.setFormData(res.data)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
 
     // 设置表单数据
@@ -271,9 +275,13 @@ export default {
         this.$refs.subForm.valideAllForm(),
         this.$refs.submitForm.validate(),
         this.$refs.customItems.valideAllForm()
-      ]).then((res) => {
-        this.save()
-      })
+      ])
+        .then((res) => {
+          this.save()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
 
     // 保存
@@ -302,11 +310,15 @@ export default {
         brand: item.brand,
         image: item.image
       }))
-      doctorSave(data).then((res) => {
-        this.$message.success('保存成功')
-        this.$store.dispatch('tagsView/delView', this.$route)
-        this.$router.push('/personnel/operate/list')
-      })
+      doctorSave(data)
+        .then((res) => {
+          this.$message.success('保存成功')
+          this.$store.dispatch('tagsView/delView', this.$route)
+          this.$router.push('/personnel/operate/list')
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
 
     // 获取医师机构列表

+ 25 - 13
src/views/normal/personnel/operate/index.vue

@@ -131,20 +131,28 @@ export default {
     // 获取列表
     getList() {
       this.listQuery.authUserId = this.authUserId
-      fetchDoctorList(this.listQuery).then((res) => {
-        console.log(res)
-        this.list = res.data.list
-        this.total = res.data.total
-      })
+      fetchDoctorList(this.listQuery)
+        .then((res) => {
+          console.log(res)
+          this.list = res.data.list
+          this.total = res.data.total
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 修改状态
     handleChangeStatus(row) {
       const status = row.status === 1 ? 0 : 1
 
-      doctorStatusChange({ doctorId: row.doctorId, status }).then((res) => {
-        this.$message.success('状态修改成功')
-        this.getList()
-      })
+      doctorStatusChange({ doctorId: row.doctorId, status })
+        .then((res) => {
+          this.$message.success('状态修改成功')
+          this.getList()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 删除
     async handleRemoveDoctor(row) {
@@ -157,10 +165,14 @@ export default {
       })
       if (text !== 'confirm') return
 
-      removeDoctor({ doctorId: row.doctorId }).then((res) => {
-        this.$message.success('删除成功')
-        this.getList()
-      })
+      removeDoctor({ doctorId: row.doctorId })
+        .then((res) => {
+          this.$message.success('删除成功')
+          this.getList()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 表格索引
     indexMethod(index) {

+ 23 - 11
src/views/normal/personnel/training/edit.vue

@@ -229,9 +229,13 @@ export default {
         this.isRequest = false
         return
       }
-      doctorFormData({ doctorId: this.doctorId }).then((res) => {
-        this.setFormData(res.data)
-      })
+      doctorFormData({ doctorId: this.doctorId })
+        .then((res) => {
+          this.setFormData(res.data)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
 
     // 设置表单数据
@@ -266,9 +270,13 @@ export default {
         // this.$refs.subForm.valideAllForm(),
         this.$refs.submitForm.validate(),
         this.$refs.customItems.valideAllForm()
-      ]).then((res) => {
-        this.save()
-      })
+      ])
+        .then((res) => {
+          this.save()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
 
     // 保存
@@ -297,11 +305,15 @@ export default {
         brand: item.brand,
         image: item.image
       }))
-      doctorSave(data).then((res) => {
-        this.$message.success('保存成功')
-        this.$store.dispatch('tagsView/delView', this.$route)
-        this.$router.push('/personnel/training/list')
-      })
+      doctorSave(data)
+        .then((res) => {
+          this.$message.success('保存成功')
+          this.$store.dispatch('tagsView/delView', this.$route)
+          this.$router.push('/personnel/training/list')
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
 
     // 获取医师机构列表

+ 25 - 13
src/views/normal/personnel/training/index.vue

@@ -131,20 +131,28 @@ export default {
     // 获取列表
     getList() {
       this.listQuery.authUserId = this.authUserId
-      fetchDoctorList(this.listQuery).then((res) => {
-        console.log(res)
-        this.list = res.data.list
-        this.total = res.data.total
-      })
+      fetchDoctorList(this.listQuery)
+        .then((res) => {
+          console.log(res)
+          this.list = res.data.list
+          this.total = res.data.total
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 修改状态
     handleChangeStatus(row) {
       const status = row.status === 1 ? 0 : 1
 
-      doctorStatusChange({ doctorId: row.doctorId, status }).then((res) => {
-        this.$message.success('状态修改成功')
-        this.getList()
-      })
+      doctorStatusChange({ doctorId: row.doctorId, status })
+        .then((res) => {
+          this.$message.success('状态修改成功')
+          this.getList()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 删除
     async handleRemoveDoctor(row) {
@@ -157,10 +165,14 @@ export default {
       })
       if (text !== 'confirm') return
 
-      removeDoctor({ doctorId: row.doctorId }).then((res) => {
-        this.$message.success('删除成功')
-        this.getList()
-      })
+      removeDoctor({ doctorId: row.doctorId })
+        .then((res) => {
+          this.$message.success('删除成功')
+          this.getList()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 表格索引
     indexMethod(index) {

+ 32 - 16
src/views/normal/settings/accounts/edit.vue

@@ -117,31 +117,43 @@ export default {
   methods: {
     // 获取角色列表
     fetchRoleList() {
-      fetchRoleList().then((res) => {
-        this.roleList = [...this.roleList, ...res.data.list]
-      })
+      fetchRoleList()
+        .then((res) => {
+          this.roleList = [...this.roleList, ...res.data.list]
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 修改保存用户信息
     updateUserInfo() {
       const userInfo = deepClone(this.userInfo)
       userInfo.roleIds = userInfo.roleList.join(',')
       userInfo.loginAccount = `${this.prefix}_${userInfo.loginAccount}`
-      updateUser(userInfo.id, userInfo).then((res) => {
-        this.$message.success('修改用户成功')
-        this.$store.dispatch('tagsView/delView', this.$route)
-        this.$router.back()
-      })
+      updateUser(userInfo.id, userInfo)
+        .then((res) => {
+          this.$message.success('修改用户成功')
+          this.$store.dispatch('tagsView/delView', this.$route)
+          this.$router.back()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 保存用户信息
     createUserInfo() {
       const userInfo = deepClone(this.userInfo)
       userInfo.roleIds = userInfo.roleList.join(',')
       userInfo.loginAccount = `${this.prefix}_${userInfo.loginAccount}`
-      createUser(userInfo).then((res) => {
-        this.$message.success('添加用户成功')
-        this.$store.dispatch('tagsView/delView', this.$route)
-        this.$router.back()
-      })
+      createUser(userInfo)
+        .then((res) => {
+          this.$message.success('添加用户成功')
+          this.$store.dispatch('tagsView/delView', this.$route)
+          this.$router.back()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 提交表单
     onSubmit() {
@@ -156,9 +168,13 @@ export default {
     },
     // 获取用户信息
     fetchUserInfo() {
-      getUser(this.userInfo.id).then((res) => {
-        this.setUserInfo(res.data)
-      })
+      getUser(this.userInfo.id)
+        .then((res) => {
+          this.setUserInfo(res.data)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 设置用户信息
     setUserInfo(data) {

+ 7 - 3
src/views/normal/settings/accounts/index.vue

@@ -102,9 +102,13 @@ export default {
     },
     // 获取用户列表
     fetchUserList() {
-      fetchUserList(this.listQuery).then((res) => {
-        this.list = res.data.list
-      })
+      fetchUserList(this.listQuery)
+        .then((res) => {
+          this.list = res.data.list
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 删除用户
     removeUser(row) {

+ 10 - 6
src/views/normal/settings/auth-card/components/supplier-list.vue

@@ -124,12 +124,16 @@ export default {
     },
     // 获取供应商列表
     fetchSupplierList() {
-      fetchSupplierList(this.listQuery).then((res) => {
-        console.log(res)
-        this.supplierList = [...this.supplierList, ...res.data.list]
-        this.hasNextPage = res.data.hasNextPage
-        this.total = res.data.total
-      })
+      fetchSupplierList(this.listQuery)
+        .then((res) => {
+          console.log(res)
+          this.supplierList = [...this.supplierList, ...res.data.list]
+          this.hasNextPage = res.data.hasNextPage
+          this.total = res.data.total
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     onLoad() {
       if (!this.hasNextPage) return

+ 40 - 21
src/views/normal/settings/roles/edit.vue

@@ -68,13 +68,20 @@ export default {
     },
     getCheckedKeys() {
       // console.log(this.$refs.tree.getCheckedNodes(false, true).map(item => item.id))
-      this.role.menuIds = this.$refs.tree.getCheckedNodes(false, true).map(item => item.id).join(',')
+      this.role.menuIds = this.$refs.tree
+        .getCheckedNodes(false, true)
+        .map((item) => item.id)
+        .join(',')
     },
     // 获取菜单权限列表
     getMenuTree() {
-      sysMenuTree({ menuType: 2 }).then(res => {
-        this.menuTree = res.data
-      })
+      sysMenuTree({ menuType: 2 })
+        .then((res) => {
+          this.menuTree = res.data
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 设置角色信息
     setRoleInfo(data) {
@@ -88,32 +95,44 @@ export default {
     },
     // 获取角色信息
     fetchRoleInfo() {
-      getRole(this.role.id).then(res => {
-        console.log(res.data)
-        this.setRoleInfo(res.data)
-      })
+      getRole(this.role.id)
+        .then((res) => {
+          console.log(res.data)
+          this.setRoleInfo(res.data)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 修改角色
     updateRole() {
-      updateRole(this.role.id, this.role).then(res => {
-        console.log(res)
-        this.$message.success('修改角色成功')
-        this.$store.dispatch('tagsView/delView', this.$route)
-        this.$router.back()
-      })
+      updateRole(this.role.id, this.role)
+        .then((res) => {
+          console.log(res)
+          this.$message.success('修改角色成功')
+          this.$store.dispatch('tagsView/delView', this.$route)
+          this.$router.back()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 创建角色
     createRole() {
-      createRole(this.role).then(res => {
-        console.log(res)
-        this.$message.success('添加角色成功')
-        this.$store.dispatch('tagsView/delView', this.$route)
-        this.$router.back()
-      })
+      createRole(this.role)
+        .then((res) => {
+          console.log(res)
+          this.$message.success('添加角色成功')
+          this.$store.dispatch('tagsView/delView', this.$route)
+          this.$router.back()
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 提交
     handleSubmit() {
-      this.$refs.ruleRef.validate(valide => {
+      this.$refs.ruleRef.validate((valide) => {
         if (!valide) return
         if (this.editType === 'add') {
           this.createRole()

+ 13 - 5
src/views/normal/settings/roles/index.vue

@@ -37,7 +37,11 @@
       </el-table-column>
       <el-table-column label="操作" align="center" width="200">
         <template slot-scope="{ row }">
-          <el-button type="primary" size="mini" @click="navigationTo(`roles/edit?type=edit&id=${row.id}`)">编辑</el-button>
+          <el-button
+            type="primary"
+            size="mini"
+            @click="navigationTo(`roles/edit?type=edit&id=${row.id}`)"
+          >编辑</el-button>
           <el-button type="danger" size="mini" @click="removeRole(row)">删除</el-button>
         </template>
       </el-table-column>
@@ -77,9 +81,13 @@ export default {
     },
     // 获取角色列表
     fetchRoleList() {
-      fetchRoleList(this.listQuery).then(res => {
-        this.list = res.data.list
-      })
+      fetchRoleList(this.listQuery)
+        .then((res) => {
+          this.list = res.data.list
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 删除角色
     removeRole(row) {
@@ -89,7 +97,7 @@ export default {
         type: 'warning'
       })
         .then(() => {
-          deleteRole(row.id).then(res => {
+          deleteRole(row.id).then((res) => {
             this.$message.success('删除角色成功')
             this.getList()
           })

+ 34 - 15
src/views/normal/vip/buy.vue

@@ -179,6 +179,9 @@ export default {
           this.registerSuperPay()
           this.setOrderInfo()
         })
+        .catch((error) => {
+          console.log(error)
+        })
         .finally(() => {
           this.isLoading = false
         })
@@ -210,19 +213,27 @@ export default {
         authUserId: this.$store.getters.authUserId,
         packageId: this.checkedPackage,
         services: this.checkedServiceList.join(',')
-      }).then((res) => {
-        this.orderInfo.vipRecordId = res.data
       })
+        .then((res) => {
+          this.orderInfo.vipRecordId = res.data
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 在线支付开关检测
     payOnlineChecked() {
-      payOnlineChecked().then((res) => {
-        if (res.data === '1') {
-          this.paySwitch = true
-        } else {
-          this.paySwitch = false
-        }
-      })
+      payOnlineChecked()
+        .then((res) => {
+          if (res.data === '1') {
+            this.paySwitch = true
+          } else {
+            this.paySwitch = false
+          }
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 确认支付是否完成
     handlePayConfirm(e) {
@@ -246,15 +257,23 @@ export default {
     },
     // 查询支付是否成功 (支付宝 银联)
     checkedAliPaySuccess(params) {
-      checkedAliPaySuccess(params).then((res) => {
-        this.handlePayResult(res)
-      })
+      checkedAliPaySuccess(params)
+        .then((res) => {
+          this.handlePayResult(res)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 查询支付是否成功 (支付宝 银联)
     checkedUnionPaySuccess(params) {
-      checkedUnionPaySuccess(params).then((res) => {
-        this.handlePayResult(res)
-      })
+      checkedUnionPaySuccess(params)
+        .then((res) => {
+          this.handlePayResult(res)
+        })
+        .catch((error) => {
+          console.log(error)
+        })
     },
     // 处理微信支付查询结果
     handleWixinPayResult(result) {