Compare commits
No commits in common. "1caeba1225f1c2dc36fe6d0e91baeac1da7bb47f" and "31fca48febb30e0271f8a555fdb53b8929752c95" have entirely different histories.
1caeba1225
...
31fca48feb
121
doc/api.md
121
doc/api.md
|
|
@ -24,79 +24,7 @@
|
|||
}
|
||||
```
|
||||
|
||||
### `GET` 请求默认格式(若无特殊说明)
|
||||
|
||||
```json
|
||||
{
|
||||
"token": "token_test"
|
||||
}
|
||||
```
|
||||
|
||||
## 登陆
|
||||
|
||||
### 账号密码登陆 `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:
|
||||
### `GET`请求默认格式(若无特殊说明)
|
||||
|
||||
```json
|
||||
{
|
||||
|
|
@ -158,12 +86,10 @@ data:
|
|||
"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"]
|
||||
},
|
||||
...
|
||||
|
|
@ -176,50 +102,19 @@ data:
|
|||
|
||||
#### 更新当前值班情况 `POST /admin/duty/update`
|
||||
|
||||
无关项不返回,后端手动校验
|
||||
|
||||
新增字段:dutyStatus "normal" => 正常值班 "others" => 特殊值班 "pause" => 暂停值班
|
||||
无关项返回空字符串,后端手动校验
|
||||
|
||||
request:
|
||||
|
||||
##### 正常值班
|
||||
|
||||
```json
|
||||
{
|
||||
"dutyStatus": "normal",
|
||||
"isNormalDuty": true,
|
||||
"currentDuty": "2",
|
||||
"inDutyCnt": 3,
|
||||
},
|
||||
```
|
||||
|
||||
##### 特殊值班
|
||||
|
||||
```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",
|
||||
"otherDutyTime": [],
|
||||
"offDutyReason": "",
|
||||
"place": "204",
|
||||
"dutyRecoverTime": "",
|
||||
},
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import askleavelist from './askleavelist.json';
|
||||
import conclusionlist from './conclusionlist.json';
|
||||
import loglist from './loglist.json';
|
||||
import reportlist from './reportlist.json';
|
||||
import sheet from './sheet.json';
|
||||
import sheetlist from './sheetlist.json';
|
||||
import askleavelist from './askleavelist.json';
|
||||
|
||||
module.exports = {
|
||||
'GET /stats': {
|
||||
|
|
@ -91,21 +91,6 @@ module.exports = {
|
|||
total: 24,
|
||||
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': {
|
||||
success: true,
|
||||
data: {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,11 @@ declare namespace API {
|
|||
currentAuthority?: string;
|
||||
};
|
||||
|
||||
type PageParams = {
|
||||
current?: number;
|
||||
pageSize?: number;
|
||||
};
|
||||
|
||||
type LoginParams = {
|
||||
username?: string;
|
||||
password?: string;
|
||||
|
|
@ -22,6 +27,14 @@ declare namespace API {
|
|||
type?: string;
|
||||
};
|
||||
|
||||
type ErrorResponse = {
|
||||
/** 业务约定的错误码 */
|
||||
errorCode: string;
|
||||
/** 业务上的错误信息 */
|
||||
errorMessage?: string;
|
||||
/** 业务上的请求是否成功 */
|
||||
success?: boolean;
|
||||
};
|
||||
type LogList = {
|
||||
pageIndex: number;
|
||||
pageCount: number;
|
||||
|
|
|
|||
Loading…
Reference in New Issue