add login redirect

This commit is contained in:
AceDataCloud committed 2021-09-11 01:59:39 +08:00
1 parent a94be71c98
commit 2a5a5c601c
12 files changed
+113 -15

No files matched your search

+13
View File
@@ -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();
+15
View File
@@ -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 {}
+3 -3
View File
@@ -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;
}