Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
CS-Tao committed Dec 18, 2019
2 parents c1c8437 + 53227f6 commit f7c97bf
Show file tree
Hide file tree
Showing 21 changed files with 782 additions and 76 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
### 最新版本下载

- Windows
- 链接: [whu-library-seat-setup-1.8.4.exe](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.8.4/whu-library-seat-setup-1.8.4.exe)
- 备用地址: [whu-library-seat-setup-1.8.4.exe](https://assets.cs-tao.cc/whu-library-seat/releases/v1.8.4/whu-library-seat-setup-1.8.4.exe)
- 链接: [whu-library-seat-setup-1.9.0.exe](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.9.0/whu-library-seat-setup-1.9.0.exe)
- 备用地址: [whu-library-seat-setup-1.9.0.exe](https://assets.cs-tao.cc/whu-library-seat/releases/v1.9.0/whu-library-seat-setup-1.9.0.exe)

- Mac OS
- 链接: [whu-library-seat-1.8.4.dmg](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.8.4/whu-library-seat-1.8.4.dmg)
- 备用地址: [whu-library-seat-1.8.4.dmg](https://assets.cs-tao.cc/whu-library-seat/releases/v1.8.4/whu-library-seat-1.8.4.dmg)
- 链接: [whu-library-seat-1.9.0.dmg](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.9.0/whu-library-seat-1.9.0.dmg)
- 备用地址: [whu-library-seat-1.9.0.dmg](https://assets.cs-tao.cc/whu-library-seat/releases/v1.9.0/whu-library-seat-1.9.0.dmg)

- Linux
- 链接: [whu-library-seat-1.8.4-x86_64.AppImage](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.8.4/whu-library-seat-1.8.4-x86_64.AppImage)
- 备用地址: [whu-library-seat-1.8.4-x86_64.AppImage](https://assets.cs-tao.cc/whu-library-seat/releases/v1.8.4/whu-library-seat-1.8.4-x86_64.AppImage)
- 链接: [whu-library-seat-1.9.0-x86_64.AppImage](https://github.com/CS-Tao/whu-library-seat/releases/download/v1.9.0/whu-library-seat-1.9.0-x86_64.AppImage)
- 备用地址: [whu-library-seat-1.9.0-x86_64.AppImage](https://assets.cs-tao.cc/whu-library-seat/releases/v1.9.0/whu-library-seat-1.9.0-x86_64.AppImage)

### 安装软件

Expand Down
6 changes: 3 additions & 3 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ module.exports = {
['menu', '菜单'],
['settings', '软件设置'],
['reservation', '定时预约'],
['cancel', '取消预约'],
['stop', '结束使用'],
['change', '更改位置'],
['monitor', '座位监控'],
['protect', '座位保护'],
['seatoperate', '位置操作'],
['others', '其他']
]
}
Expand Down
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ features:
details: 软件提供了定时抢座的功能,用户可以指定时间开始抢座,也可以通过勾选"√使用当前时间"立即抢座
- title: 错误处理
details: 当位置已经被别人预约之后,软件会根据用户提供的时间段和房间信息,自动预约距离该位置较近的座位
- title: 座位监控
details: 在"位置"的下拉框选择"监控"功能,可以监控指定房间的座位信息,当有座位可用时,软件会第一时间为您预约
- title: 座位更改
details: 勾选"√使用当前时间"立即抢座,如果当前已有预约、正在使用、暂离状态的座位,软件会取消当前座位,重新预约
- title: 取消预约
details: 在预约历史界面,如果您有处于预约的座位,可以点击对应记录后面的取消预约按钮取消座位
- title: 终止使用
details: 在预约历史界面,如果您有处于正在使用或暂离状态的座位,可以点击对应记录后面的终止使用的按钮结束使用该座位
- title: 座位保护
details: 出馆前可设置一段时间后更改此座位的时间,即通过定时执行"座位更改"功能实现座位保护
- title: 开源跨平台
details: 本软件为开源跨平台软件,有 WIndows、MacOS、Linux、Android 等版本可供用户下载使用
footer: Copyright © 2018 CS-Tao
Expand Down
12 changes: 6 additions & 6 deletions docs/specification/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
### 下载软件
## 下载软件

本软件是针对`武汉大学`图书馆预约系统开发的抢座软件,支持 Windows、Mac OS、Linux、Android 等操作系统

#### 桌面端下载
### 桌面端下载

安装包链接: [https://github.com/CS-Tao/whu-library-seat#最新版本下载](https://github.com/CS-Tao/whu-library-seat#最新版本下载)

#### 移动端(Android)下载
### 移动端(Android)下载

安装包链接: [https://github.com/CS-Tao/whu-library-seat-mobile#最新版本下载](https://github.com/CS-Tao/whu-library-seat-mobile#最新版本下载)

二维码:

![安卓版本二维码](https://raw.githubusercontent.com/CS-Tao/whu-library-seat/user-validation/last-android-qr.jpg)

### 安装软件
## 安装软件

运行安装包即可

### 申请软件使用权
## 申请软件使用权

> v1.8.0 已移除本功能,改为 GitHub Star 认证,具体请查看 [GitHub Star 认证](./auth.html)

### 软件更新
## 软件更新

![图片加载失败](https://home.cs-tao.cc/github-content/contents/github/whu-library-seat/update.png)

Expand Down
8 changes: 5 additions & 3 deletions docs/specification/auth.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# GitHub Star 认证

> 无法连接服务器请移步[手动申请 Token](manualtoken.html)
请按照以下步骤登录本软件并获取永久授权

1. 点击软件下方的**钥匙**进入软件授权页面(第一次打开软件会默认进入本页面)

![图片加载失败](https://home.cs-tao.cc/github-content/contents/github/whu-library-seat/OAuth/1.png)

1. 点击`GitHub Star 永久授权`按钮,软件会打开系统浏览器访问认证页面,如果出现无法连接服务器的弹窗,请移步[手动申请 Token](manualtoken.html)进行认证
1. 点击`GitHub Star 永久授权`按钮,软件会打开系统浏览器访问认证页面

::: warning 友情提示
如果出现`无法连接服务器`的弹窗,请移步[手动申请 Token](manualtoken.html)进行认证
:::

![图片加载失败](https://home.cs-tao.cc/github-content/contents/github/whu-library-seat/OAuth/3.png)

Expand Down
3 changes: 0 additions & 3 deletions docs/specification/cancel.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/specification/change.md

This file was deleted.

15 changes: 15 additions & 0 deletions docs/specification/monitor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### 座位监控

#### 功能说明

本功能用于监控房间座位,并第一时间预约,不需要手动检查位置是否可用,让学习更加便捷。

::: warning 友情提示
但本功能会加重后台程序负担,也会给座位改签的同学带来困扰

非万不得已不建议使用
:::

#### 操作方法

登录软件后,在`位置`下拉框的`可选功能`中选择`监控`功能,点击`打开监控器`按钮,设置`监控间隔``监控时长`,点击`启动`即可
5 changes: 5 additions & 0 deletions docs/specification/protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### 座位保护

出馆前可设置一段时间后更改此座位的时间,即通过定时执行"座位更改"功能实现座位保护

比如`11.40`出馆,可在出馆前打开软件设置`12.39`重新预约本位置(注意日期、时间以及座位信息不要设置错)
8 changes: 4 additions & 4 deletions docs/specification/reservation.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
### 登录到图书馆
## 登录到图书馆

启动软件,输入用户名和密码(点击输入框旁边的小锁图标可以保存用户名或密码),点击`登录`按钮登录到图书馆

### 选择座位
## 选择座位

在主界面中选择日期、时间、场馆、房间、位置等参数,选中电源图标或太阳图标可以对座位进行预筛选(当您选择的座位已经被别人预约时,经过预筛选的座位会被优先选择),在座位号的下拉列表中,座位号为红色表示当前座位处于不可用的状态

### 定时抢座
## 定时抢座

选择好座位之后,点击`定时预约`按钮可以打开`定时器`界面

Expand All @@ -16,6 +16,6 @@
如果选择的时间小于当前时间,启动定时器时会直接开始抢座
:::

### 取消定时器
## 取消定时器

定时器启动后,点击`取消定时`按钮可以取消定时器
13 changes: 13 additions & 0 deletions docs/specification/seatoperate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## 取消预约

`预约历史`界面,如果您有处于`预约`状态的座位,可以点击对应记录后面的`取消预约`的按钮取消预约

## 结束使用

`预约历史`界面,如果您有处于`正在使用``暂离`状态的座位,可以点击对应记录后面的`终止使用`的按钮结束使用该座位

## 座位更改(即"改签")

在预约座位时,如果您当前已有处于`预约``正在使用``暂离`状态的座位,在开始预约之前软件会自动取消已有的座位,重新预约

也就是说如果您希望的重新预约的座位和正在使用的座位信息一致,便能更改当前座位的使用时间
3 changes: 0 additions & 3 deletions docs/specification/stop.md

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "whu-library-seat",
"version": "1.8.4",
"version": "1.9.0",
"author": "CS-Tao <whucstao@qq.com>",
"description": "武汉大学图书馆抢座软件",
"license": null,
Expand Down
12 changes: 9 additions & 3 deletions src/renderer/api/library.api.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ export default {
})
})
if (responseData.data.status === 'success' && responseData.data.data.token) {
updateToken(responseData.data.data.token)
if (updateToken) {
updateToken(responseData.data.data.token)
}
return request({
url: urls.library.Book.url(),
method: urls.library.Book.method,
Expand All @@ -102,11 +104,15 @@ export default {
})
} else {
const message = '网络拥堵,请重新预约'
errorCallback(message)
if (errorCallback) {
errorCallback(message)
}
return Promise.reject(Error(message))
}
} catch (error) {
errorCallback(error.message)
if (errorCallback) {
errorCallback(error.message)
}
return Promise.reject(error)
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/api/mock/gitcontents.api.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default {
return {
'status': 'success',
'code': 0,
'locked': true,
'locked': false,
'message': '正在测试,停止使用',
'time': '禁用时间:一天'
}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/api/mock/library.api.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default {
Book: config => {
console.log('Mock: ' + config.url)
var num = Math.random()
if (num > 0.05) {
if (num > 0.5) {
return {'status': 'fail', 'data': null, 'message': '预约失败,请尽快选择其他时段或座位', 'code': '1'}
} else {
return {'status': 'success', 'data': {'id': 3442608, 'receipt': '0175-608-1', 'onDate': '2018 年 07 月 23 日', 'begin': '21 : 30', 'end': '22 : 30', 'location': '信息馆2层东区东自然科学区,座位号009', 'checkedIn': false}, 'message': '', 'code': '0'}
Expand Down
6 changes: 4 additions & 2 deletions src/renderer/api/usage.api.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const appVersion = remote.app.getVersion()
export default {
// 登录状态
loginState: (account, state, code, message = null) => {
let usageRecordEnable = store.get('usageRecordEnable', true)
// let usageRecordEnable = store.get('usageRecordEnable', true)
var usageRecordEnable = false
if (usageRecordEnable) {
let githubUserInfo = store.get('authInfo_githubUserInfo', null)
let githubid = (githubUserInfo && githubUserInfo.id) ? githubUserInfo.id : null
Expand All @@ -46,7 +47,8 @@ export default {
},
// 抢座状态
grabState: (account, state, code, message = null) => {
let usageRecordEnable = store.get('usageRecordEnable', true)
// let usageRecordEnable = store.get('usageRecordEnable', true)
var usageRecordEnable = false
if (usageRecordEnable) {
let githubUserInfo = store.get('authInfo_githubUserInfo', null)
let githubid = (githubUserInfo && githubUserInfo.id) ? githubUserInfo.id : null
Expand Down
Loading

0 comments on commit f7c97bf

Please sign in to comment.