Compare commits

...

2 Commits

Author SHA1 Message Date
Dawn1Ocean 1caeba1225 Merge branch 'mgy' of https://git.zjueva.net/Dawn_Ocean/EVA-Tea into mgy 2024-05-09 14:56:56 +08:00
Dawn1Ocean 44ce17d43d change doc & mock 2024-05-09 14:54:21 +08:00
3 changed files with 129 additions and 22 deletions

View File

@ -32,6 +32,78 @@
} }
``` ```
## 登陆
### 账号密码登陆 `POST /login`
request:
```json
{
"stuid": "3220114514",
"passwd": "__passwd_test__"
}
```
data:
.role
-1 => 未定
0 => 干事
1 => 部长
2 => 会长
3 => 副会长
4 => 技术指导
5 => 已退休
6 => 管理员
7 => 副部长
8 => 总监
.department
-1 => 未定
0 => 电器部
1 => 电脑部
2 => 人资部
3 => 文宣部
4 => 财外部
```json
{
"token": "token_test",
"name": "亦可",
"avatar": "https://....png",
"role": 6,
"department": 1,
"access": "admin" // "admin" => 主席团成员 "leader" => 值班组长 "member" => 普通成员
}
```
### 登出 `POST /logout`
request:
```json
{
"token": "token_test"
}
```
## 主页面 ## 主页面
### 统计数据 `GET /stats` ### 统计数据 `GET /stats`
@ -86,10 +158,12 @@ data:
"otherDutyTime": [ "otherDutyTime": [
{ {
"name": "第一班", "name": "第一班",
"place": "蓝田",
"range": ["2024-03-07T19:52:48.523303", "2024-03-07T19:52:48.523303"] "range": ["2024-03-07T19:52:48.523303", "2024-03-07T19:52:48.523303"]
}, },
{ {
"name": "第二班", "name": "第二班",
"place": "蓝田",
"range": ["2024-03-07T19:52:48.523303", "2024-03-07T19:52:48.523303"] "range": ["2024-03-07T19:52:48.523303", "2024-03-07T19:52:48.523303"]
}, },
... ...
@ -102,19 +176,50 @@ data:
#### 更新当前值班情况 `POST /admin/duty/update` #### 更新当前值班情况 `POST /admin/duty/update`
无关项返回空字符串,后端手动校验 无关项不返回,后端手动校验
新增字段dutyStatus "normal" => 正常值班 "others" => 特殊值班 "pause" => 暂停值班
request: request:
##### 正常值班
```json ```json
{ {
"isNormalDuty": true, "dutyStatus": "normal",
"currentDuty": "2",
"inDutyCnt": 3, "inDutyCnt": 3,
"otherDutyTime": [], },
"offDutyReason": "", ```
"place": "204",
"dutyRecoverTime": "", ##### 特殊值班
```json
{
"dutyStatus": "others",
"inDutyCnt": 3,
"otherDutyTime": [
{
"name": "第一班",
"place": "蓝田",
"range": ["2024-03-07T19:52:48.523303", "2024-03-07T19:52:48.523303"]
},
{
"name": "第二班",
"place": "蓝田",
"range": ["2024-03-07T19:52:48.523303", "2024-03-07T19:52:48.523303"]
},
...
],
},
```
##### 暂停值班
```json
{
"dutyStatus": "pause",
"offDutyReason": "期中考试周",
"dutyRecoverTime": "2024-03-07T19:52:48.523303",
}, },
``` ```

View File

@ -1,9 +1,9 @@
import askleavelist from './askleavelist.json';
import conclusionlist from './conclusionlist.json'; import conclusionlist from './conclusionlist.json';
import loglist from './loglist.json'; import loglist from './loglist.json';
import reportlist from './reportlist.json'; import reportlist from './reportlist.json';
import sheet from './sheet.json'; import sheet from './sheet.json';
import sheetlist from './sheetlist.json'; import sheetlist from './sheetlist.json';
import askleavelist from './askleavelist.json';
module.exports = { module.exports = {
'GET /stats': { 'GET /stats': {
@ -91,6 +91,21 @@ module.exports = {
total: 24, total: 24,
data: askleavelist, data: askleavelist,
}, },
'POST /login': {
success: true,
data: {
token: 'token_test',
name: '亦可',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png',
role: 6,
department: 1,
access: 'admin',
},
},
'POST /logout': {
success: true,
data: {},
},
'GET /api/currentUser': { 'GET /api/currentUser': {
success: true, success: true,
data: { data: {

View File

@ -15,11 +15,6 @@ declare namespace API {
currentAuthority?: string; currentAuthority?: string;
}; };
type PageParams = {
current?: number;
pageSize?: number;
};
type LoginParams = { type LoginParams = {
username?: string; username?: string;
password?: string; password?: string;
@ -27,14 +22,6 @@ declare namespace API {
type?: string; type?: string;
}; };
type ErrorResponse = {
/** 业务约定的错误码 */
errorCode: string;
/** 业务上的错误信息 */
errorMessage?: string;
/** 业务上的请求是否成功 */
success?: boolean;
};
type LogList = { type LogList = {
pageIndex: number; pageIndex: number;
pageCount: number; pageCount: number;