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 @@ {{ seatsForSelect[n-1].name }} - - + + - + - + 定时抢座 @@ -63,6 +63,8 @@ import timerForm from './Timer' import libraryRestApi from '@/api/library.api' import { ipcRenderer } from 'electron' +const emptyMessage = '数据加载失败' + export default { props: { showMode: { @@ -161,7 +163,7 @@ export default { type: 'error', duration: '2000', showClose: true, - message: response.data.message + message: response.data.message ? response.data.message : emptyMessage }) this.filterSeats() } @@ -253,7 +255,7 @@ export default { type: 'error', duration: '0', showClose: true, - message: response.data.message + message: response.data.message ? response.data.message : emptyMessage }) } }).catch(() => {}) @@ -327,9 +329,9 @@ export default { type: 'error', duration: 0, showClose: true, - message: response.data.message + message: response.data.message ? response.data.message : emptyMessage }) - this.windowsNotification('抢座失败', response.data.message) + this.windowsNotification('抢座失败', response.data.message ? response.data.message : emptyMessage) } } else if (response.data.code === 12 && response.data.code === '12') { // 登录失败: 用户名或密码不正确 @@ -338,9 +340,9 @@ export default { type: 'error', duration: 0, showClose: true, - message: response.data.message + message: response.data.message ? response.data.message : emptyMessage }) - this.windowsNotification('抢座失败', response.data.message) + this.windowsNotification('抢座失败', response.data.message ? response.data.message : emptyMessage) } else { // 其他 this.$store.dispatch('updateTimer', 'fail') @@ -348,9 +350,9 @@ export default { type: 'error', duration: 0, showClose: true, - message: response.data.message + message: response.data.message ? response.data.message : emptyMessage }) - this.windowsNotification('抢座失败', response.data.message) + this.windowsNotification('抢座失败', response.data.message ? response.data.message : emptyMessage) } } }).catch(() => {}) diff --git a/src/renderer/components/Header/index.vue b/src/renderer/components/Header/index.vue index 504b9a1f..3807156c 100644 --- a/src/renderer/components/Header/index.vue +++ b/src/renderer/components/Header/index.vue @@ -2,7 +2,7 @@
- + - + @@ -56,7 +56,7 @@ - +
@@ -74,6 +74,8 @@ import settingsForm from './Settings' import gitcontentsApi from '@/api/gitcontents.api' import libraryRestApi from '@/api/library.api' +const emptyMessage = '数据加载失败' + export default { data () { return { @@ -236,7 +238,7 @@ export default { type: 'error', duration: '2000', showClose: true, - message: response.data.message + message: response.data.message ? response.data.message : emptyMessage }) } }).catch(() => {}) @@ -262,7 +264,7 @@ export default { type: 'error', duration: '2000', showClose: true, - message: response.data.message + message: response.data.message ? response.data.message : emptyMessage }) } }).catch(() => {}) From d5c1f81bcc5654cde45b1ae29e0b5bddef3d528e Mon Sep 17 00:00:00 2001 From: CS-Tao <990296951@qq.com> Date: Thu, 6 Sep 2018 23:37:22 +0800 Subject: [PATCH 2/3] Set time interval for vip --- src/renderer/components/Body/index.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/renderer/components/Body/index.vue b/src/renderer/components/Body/index.vue index 2ea22b62..9b48d627 100644 --- a/src/renderer/components/Body/index.vue +++ b/src/renderer/components/Body/index.vue @@ -320,6 +320,8 @@ export default { // 开始下一次抢座 if (!this.isVip) { this.sleep(800) + } else { + this.sleep(520) } this.reserveSeat(beginTime, endTime, newSeatId, date, userToken) } else {} From b4cec7d382a5bebb4ee5e9e4674e78e4a4c70c74 Mon Sep 17 00:00:00 2001 From: CS-Tao <990296951@qq.com> Date: Thu, 6 Sep 2018 23:52:13 +0800 Subject: [PATCH 3/3] Upgrate app version to v1.1.2 --- README.md | 6 +++--- docs/specification/README.md | 6 +++--- package.json | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8fa79095..e92ed7ff 100644 --- a/README.md +++ b/README.md @@ -17,15 +17,15 @@ - Windows - 安装包: `whu-library-seat-setup-.exe` - - 链接: [v1.1.1](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.1.1/whu-library-seat-setup-1.1.1.exe) + - 链接: [v1.1.2](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.1.2/whu-library-seat-setup-1.1.2.exe) - Mac OS - 安装包: `whu-library-seat-.dmg` - - 链接: [v1.1.1](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.1.1/whu-library-seat-1.1.1.dmg) + - 链接: [v1.1.2](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.1.2/whu-library-seat-1.1.2.dmg) - Linux - 安装包: `whu-library-seat--x86_64.AppImage` - - 链接: [v1.1.1](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.1.1/whu-library-seat-1.1.1-x86_64.AppImage) + - 链接: [v1.1.2](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.1.2/whu-library-seat-1.1.2-x86_64.AppImage) ### 安装软件 diff --git a/docs/specification/README.md b/docs/specification/README.md index 52e9a1a5..6265efec 100644 --- a/docs/specification/README.md +++ b/docs/specification/README.md @@ -10,15 +10,15 @@ - Windows - 安装包: `whu-library-seat-setup-.exe` - - 链接: [v1.1.1](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.1.1/whu-library-seat-setup-1.1.1.exe) + - 链接: [v1.1.2](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.1.2/whu-library-seat-setup-1.1.2.exe) - Mac OS - 安装包: `whu-library-seat-.dmg` - - 链接: [v1.1.1](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.1.1/whu-library-seat-1.1.1.dmg) + - 链接: [v1.1.2](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.1.2/whu-library-seat-1.1.2.dmg) - Linux - 安装包: `whu-library-seat--x86_64.AppImage` - - 链接: [v1.1.1](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.1.1/whu-library-seat-1.1.1-x86_64.AppImage) + - 链接: [v1.1.2](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.1.2/whu-library-seat-1.1.2-x86_64.AppImage) ### 安装软件 diff --git a/package.json b/package.json index 76876349..8a5eee1b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "whu-library-seat", - "version": "1.1.1", + "version": "1.1.2", "author": "CS-Tao ", "description": "武汉大学图书馆抢座软件", "license": null,