feat: login
This commit is contained in:
70
typings/schema.d.ts
vendored
Normal file
70
typings/schema.d.ts
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
interface AuthedRequest {
|
||||
token?: string
|
||||
user_id?: number
|
||||
}
|
||||
|
||||
interface BaseResponse<T> {
|
||||
ret: number
|
||||
msg: string
|
||||
data: T
|
||||
}
|
||||
|
||||
interface UserSchema {
|
||||
id: number
|
||||
username: string
|
||||
nickname: string
|
||||
avatar: string
|
||||
sex: 0 | 1 | 2 // 0: 未知, 1: 男, 2: 女
|
||||
email: string
|
||||
mobile: string
|
||||
auth_code: 0 | 1 | 2 // 0: Banned, 1: User, 2: Operator
|
||||
}
|
||||
|
||||
namespace req {
|
||||
namespace user {
|
||||
/**
|
||||
* @description 用户登录
|
||||
* @param username 用户名或手机号
|
||||
* @param password 密码
|
||||
*/
|
||||
interface Login {
|
||||
username: string
|
||||
password: string
|
||||
}
|
||||
|
||||
interface SmsLogin {
|
||||
mobile: string
|
||||
}
|
||||
|
||||
interface SmsLoginVerify {
|
||||
mobile: string
|
||||
sms_code: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace resp {
|
||||
namespace user {
|
||||
interface CheckSession {
|
||||
is_login: boolean
|
||||
}
|
||||
|
||||
interface Login {
|
||||
is_login: boolean
|
||||
token?: string
|
||||
user_id?: number
|
||||
}
|
||||
|
||||
interface Profile {
|
||||
profile: UserSchema
|
||||
}
|
||||
interface SmsLogin {
|
||||
message: string
|
||||
}
|
||||
|
||||
interface SmsLoginVerify {
|
||||
token: string
|
||||
person_id: number
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user