From 48f6228aa85a493b8ee2140d942d18f69f51cd7c Mon Sep 17 00:00:00 2001
From: CS-Tao <990296951@qq.com>
Date: Thu, 6 Sep 2018 23:35:10 +0800
Subject: [PATCH 1/3] Show error when message is empty
---
.../components/Body/History/index.vue | 6 +++--
src/renderer/components/Body/User/index.vue | 4 ++-
src/renderer/components/Body/index.vue | 26 ++++++++++---------
src/renderer/components/Header/index.vue | 12 +++++----
4 files changed, 28 insertions(+), 20 deletions(-)
diff --git a/src/renderer/components/Body/History/index.vue b/src/renderer/components/Body/History/index.vue
index 3ea6c909..f1d3d1ad 100644
--- a/src/renderer/components/Body/History/index.vue
+++ b/src/renderer/components/Body/History/index.vue
@@ -30,6 +30,8 @@
import { mapGetters } from 'vuex'
import libraryRestApi from '@/api/library.api'
+const emptyMessage = '数据加载失败'
+
export default {
data () {
return {
@@ -55,7 +57,7 @@ export default {
type: 'error',
duration: '5000',
showClose: true,
- message: response.data.message
+ message: response.data.message ? response.data.message : emptyMessage
})
}
}).catch(() => {})
@@ -85,7 +87,7 @@ export default {
type: 'error',
duration: '5000',
showClose: true,
- message: response.data.message
+ message: response.data.message ? response.data.message : emptyMessage
})
}
}).catch(() => {})
diff --git a/src/renderer/components/Body/User/index.vue b/src/renderer/components/Body/User/index.vue
index 27a80e08..7685c063 100644
--- a/src/renderer/components/Body/User/index.vue
+++ b/src/renderer/components/Body/User/index.vue
@@ -20,6 +20,8 @@
import { mapGetters } from 'vuex'
import libraryRestApi from '@/api/library.api'
+const emptyMessage = '数据加载失败'
+
export default {
data () {
return {
@@ -52,7 +54,7 @@ export default {
type: 'error',
duration: '5000',
showClose: true,
- message: response.data.message
+ message: response.data.message ? response.data.message : emptyMessage
})
}
}).catch(() => {})
diff --git a/src/renderer/components/Body/index.vue b/src/renderer/components/Body/index.vue
index 6dd4216a..2ea22b62 100644
--- a/src/renderer/components/Body/index.vue
+++ b/src/renderer/components/Body/index.vue
@@ -34,16 +34,16 @@