add login redirect
This commit is contained in:
1 parent
a94be71c98
commit
2a5a5c601c
12 files changed
+113
-15
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import { AxiosResponse } from 'axios';
|
||||
import httpClient from '../../instance';
|
||||
import { IUserDetailResponse, IUser } from './types';
|
||||
|
||||
class UserService {
|
||||
key = 'users';
|
||||
|
||||
async get(id: string | string[]): Promise<AxiosResponse<IUserDetailResponse>> {
|
||||
return httpClient.get(`/${this.key}/${id}`);
|
||||
}
|
||||
}
|
||||
|
||||
export default new UserService();
|
||||
@@ -0,0 +1,15 @@
|
||||
export interface IUser {
|
||||
id: string;
|
||||
username?: string;
|
||||
first_name?: string;
|
||||
last_name?: string;
|
||||
email?: string;
|
||||
nickname?: string;
|
||||
gender?: number;
|
||||
city?: string;
|
||||
province?: string;
|
||||
country?: string;
|
||||
avatar?: string;
|
||||
}
|
||||
|
||||
export interface IUserDetailResponse extends IUser {}
|
||||
@@ -1,3 +1,5 @@
|
||||
import { IUser } from '../user/types';
|
||||
|
||||
export interface IWechatQRCode {
|
||||
ticket: string;
|
||||
url: string;
|
||||
@@ -8,7 +10,5 @@ export interface IWechatQRCodeResponse extends IWechatQRCode {}
|
||||
export interface IWechatLoginStatusResponse {
|
||||
refresh_token: string;
|
||||
access_token: string;
|
||||
user: {
|
||||
id: string;
|
||||
};
|
||||
user: IUser;
|
||||
}
|
||||
Reference in new issue
Block a user