|
@@ -4,6 +4,23 @@
|
|
|
>
|
|
>
|
|
|
> 示例:**https://xxxxxxxxx/api/auth/xxxx**
|
|
> 示例:**https://xxxxxxxxx/api/auth/xxxx**
|
|
|
|
|
|
|
|
|
|
+## 获得当前登录用户的信息
|
|
|
|
|
+
|
|
|
|
|
+```http
|
|
|
|
|
+get /current
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+### Response
|
|
|
|
|
+
|
|
|
|
|
+```ts
|
|
|
|
|
+interface UserData {
|
|
|
|
|
+ err: 0 | 401 /* 用户信息失效 */;
|
|
|
|
|
+ res: UserSerializer;
|
|
|
|
|
+}
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+see [UserSerializer](../serializer/UserSerializer.md)
|
|
|
|
|
+
|
|
|
## 登录
|
|
## 登录
|
|
|
|
|
|
|
|
```http
|
|
```http
|
|
@@ -12,27 +29,25 @@ post /login
|
|
|
|
|
|
|
|
### Parameters
|
|
### Parameters
|
|
|
|
|
|
|
|
-```json
|
|
|
|
|
-{
|
|
|
|
|
- "username": string,
|
|
|
|
|
- "password": string
|
|
|
|
|
|
|
+```ts
|
|
|
|
|
+interface loginDTO {
|
|
|
|
|
+ username: string;
|
|
|
|
|
+ password: string;
|
|
|
}
|
|
}
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
### Response
|
|
### Response
|
|
|
|
|
|
|
|
-```json
|
|
|
|
|
-{
|
|
|
|
|
- "err": 0,
|
|
|
|
|
- "res": UserSerializer
|
|
|
|
|
|
|
+```ts
|
|
|
|
|
+interface UserData {
|
|
|
|
|
+ err: 0 | 403 /* 用户名密码错 */;
|
|
|
|
|
+ res: UserSerializer;
|
|
|
}
|
|
}
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
-- 403 用户名密码错
|
|
|
|
|
-
|
|
|
|
|
see [UserSerializer](../serializer/UserSerializer.md)
|
|
see [UserSerializer](../serializer/UserSerializer.md)
|
|
|
|
|
|
|
|
-## 手機號驗證碼
|
|
|
|
|
|
|
+## 手机验证码
|
|
|
|
|
|
|
|
```http
|
|
```http
|
|
|
post /verification
|
|
post /verification
|
|
@@ -40,10 +55,10 @@ post /verification
|
|
|
|
|
|
|
|
### Parameters
|
|
### Parameters
|
|
|
|
|
|
|
|
-```json
|
|
|
|
|
-{
|
|
|
|
|
- "phoneNumber": string,
|
|
|
|
|
- "token": string
|
|
|
|
|
|
|
+```ts
|
|
|
|
|
+interface VerificationDTO {
|
|
|
|
|
+ phoneNumber: string;
|
|
|
|
|
+ token: string;
|
|
|
}
|
|
}
|
|
|
```
|
|
```
|
|
|
|
|
|
|
@@ -55,31 +70,23 @@ post /register
|
|
|
|
|
|
|
|
### Parameters
|
|
### Parameters
|
|
|
|
|
|
|
|
-```json
|
|
|
|
|
-{
|
|
|
|
|
- "username": string,
|
|
|
|
|
- "password": string,
|
|
|
|
|
- "phoneNumber": string,
|
|
|
|
|
- "token": string,
|
|
|
|
|
- "email": string
|
|
|
|
|
|
|
+```ts
|
|
|
|
|
+interface RegisterDTO {
|
|
|
|
|
+ username: string;
|
|
|
|
|
+ password: string;
|
|
|
|
|
+ phoneNumber: string;
|
|
|
|
|
+ token: string;
|
|
|
|
|
+ email: string;
|
|
|
}
|
|
}
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
### Response
|
|
### Response
|
|
|
|
|
|
|
|
-```json
|
|
|
|
|
-{
|
|
|
|
|
- "err": 0,
|
|
|
|
|
- "res": UserSerializer
|
|
|
|
|
|
|
+```ts
|
|
|
|
|
+interface UserData {
|
|
|
|
|
+ err: 0 | 400;
|
|
|
|
|
+ res: UserSerializer;
|
|
|
}
|
|
}
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
see [UserSerializer](../serializer/UserSerializer.md)
|
|
see [UserSerializer](../serializer/UserSerializer.md)
|
|
|
-
|
|
|
|
|
-### Error
|
|
|
|
|
-
|
|
|
|
|
-```json
|
|
|
|
|
-{
|
|
|
|
|
- "err": 400
|
|
|
|
|
-}
|
|
|
|
|
-```
|
|
|