From b07d31af186cee3b756beadd3d4a42df4f16ee0a Mon Sep 17 00:00:00 2001 From: CS-Tao <990296951@qq.com> Date: Sat, 6 Oct 2018 20:53:36 +0800 Subject: [PATCH 1/9] Fix mock --- src/renderer/api/urls/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/api/urls/index.js b/src/renderer/api/urls/index.js index 79357aab..735a0870 100644 --- a/src/renderer/api/urls/index.js +++ b/src/renderer/api/urls/index.js @@ -15,7 +15,7 @@ const urls = { url () { return '/loginState' }, - regular: /\/user-loginState/, + regular: /\/loginState/, method: 'post' }, // 抢座状态 From 35b13704b370fccb99100536463f84d45eb76065 Mon Sep 17 00:00:00 2001 From: CS-Tao <990296951@qq.com> Date: Sat, 6 Oct 2018 20:54:27 +0800 Subject: [PATCH 2/9] Decrease grab count --- src/renderer/components/Body/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/Body/index.vue b/src/renderer/components/Body/index.vue index ce5a7110..2b23391b 100644 --- a/src/renderer/components/Body/index.vue +++ b/src/renderer/components/Body/index.vue @@ -66,7 +66,7 @@ import usageApi from '@/api/usage.api' import { ipcRenderer } from 'electron' const emptyMessage = '数据加载失败' -const maxGrabCount = 45 +const maxGrabCount = 10 const arbitraryGrabCount = 4 export default { @@ -547,7 +547,7 @@ export default { } .time-input { width: 120px!important; - margin: 0 5px; + margin: 0 3px; } .num { width: 120px; From 4dacfc29c30da1038545987e80f31459f49b71a5 Mon Sep 17 00:00:00 2001 From: CS-Tao <990296951@qq.com> Date: Sun, 7 Oct 2018 01:44:07 +0800 Subject: [PATCH 3/9] Add announcement form --- package.json | 2 + src/renderer/api/gitcontents.api.js | 10 ++ src/renderer/api/mock/gitcontents.api.js | 26 ++++ src/renderer/api/mock/index.js | 3 + src/renderer/api/urls/index.js | 8 ++ .../components/Body/Announce/index.vue | 71 ++++++++++ src/renderer/components/Body/index.vue | 4 +- src/renderer/components/Footer/index.vue | 16 ++- src/renderer/components/Header/index.vue | 17 ++- src/renderer/components/Main.vue | 10 +- src/renderer/store/getters/index.js | 4 +- src/renderer/store/modules/app.js | 9 +- src/renderer/styles/element-ui.scss | 3 + src/renderer/styles/index.scss | 18 ++- yarn.lock | 121 +++++++++++++++++- 15 files changed, 312 insertions(+), 10 deletions(-) create mode 100644 src/renderer/components/Body/Announce/index.vue diff --git a/package.json b/package.json index 254a9634..d4810cc3 100644 --- a/package.json +++ b/package.json @@ -66,10 +66,12 @@ "electron-store": "^2.0.0", "electron-updater": "^3.0.3", "element-ui": "^2.4.4", + "js-md5": "^0.7.3", "mockjs": "^1.0.1-beta3", "node-notifier": "^5.2.1", "vue": "^2.3.3", "vue-electron": "^1.0.6", + "vue-markdown": "^2.2.4", "vue-router": "^2.5.3", "vuepress-theme-vue": "^1.0.3", "vuex": "^2.3.1" diff --git a/src/renderer/api/gitcontents.api.js b/src/renderer/api/gitcontents.api.js index a64468a7..3ad89353 100644 --- a/src/renderer/api/gitcontents.api.js +++ b/src/renderer/api/gitcontents.api.js @@ -40,5 +40,15 @@ export default { time: new Date() } }) + }, + // 公告 + announce: () => { + return service({ + url: urls.gitcontents.announce.url(), + method: urls.gitcontents.announce.method, + params: { + time: new Date() + } + }) } } diff --git a/src/renderer/api/mock/gitcontents.api.js b/src/renderer/api/mock/gitcontents.api.js index 1fd57cce..d52e7127 100644 --- a/src/renderer/api/mock/gitcontents.api.js +++ b/src/renderer/api/mock/gitcontents.api.js @@ -34,5 +34,31 @@ export default { ] } } + }, + announce: config => { + console.log('Mock: ' + config.url) + return `### 公告 +- 本软件的最新版本是 v1.3.2,点击菜单: \`关于 > 更新日志\`可以查看最新版本 + +- 短时间内向图书馆后台发送大量请求会被图书馆暂时性封号(30min),请节制使用本软件 + +- 如果有任何疑问可以联系我📧: whucstao@qq.com + +- 发现 bug 请点击: \`关于 > 问题反馈\` + +- 设置页面的软件使用数据可以帮助我改善软件,希望您可以把软件使用数据提交给我😋 + +- 移动端还要好几个月才会发布,敬请期待🤕 + +#### 如果您有多的钱,让我们支付宝见! + +

支付宝二维码.jpg

+ +#### 或者微信见! + +

微信二维码.jpg

+ +#### 祝您使用愉快,学习进步😉~ +` } } diff --git a/src/renderer/api/mock/index.js b/src/renderer/api/mock/index.js index 35825175..efe375b2 100644 --- a/src/renderer/api/mock/index.js +++ b/src/renderer/api/mock/index.js @@ -7,6 +7,9 @@ import urls from '../urls' // 用户验证 Mock.mock(urls.gitcontents.validateUser.regular, urls.gitcontents.validateUser.method, gitcontentsApi.validateUser) +// 公告 +Mock.mock(urls.gitcontents.announce.regular, urls.gitcontents.announce.method, gitcontentsApi.announce) + // 登录状态 Mock.mock(urls.usage.loginState.regular, urls.usage.loginState.method, usageApi.loginState) diff --git a/src/renderer/api/urls/index.js b/src/renderer/api/urls/index.js index 735a0870..98f7cbd9 100644 --- a/src/renderer/api/urls/index.js +++ b/src/renderer/api/urls/index.js @@ -7,6 +7,14 @@ const urls = { }, regular: /\/user-validation\/validation.json/, method: 'get' + }, + // 公告 + announce: { + url () { + return '/user-validation/announce.md' + }, + regular: /\/user-validation\/announce.md/, + method: 'get' } }, usage: { diff --git a/src/renderer/components/Body/Announce/index.vue b/src/renderer/components/Body/Announce/index.vue new file mode 100644 index 00000000..856a6d6a --- /dev/null +++ b/src/renderer/components/Body/Announce/index.vue @@ -0,0 +1,71 @@ + + + + + diff --git a/src/renderer/components/Body/index.vue b/src/renderer/components/Body/index.vue index 2b23391b..b12c234f 100644 --- a/src/renderer/components/Body/index.vue +++ b/src/renderer/components/Body/index.vue @@ -50,6 +50,7 @@ 定时抢座 + @@ -58,6 +59,7 @@