|
@@ -23,6 +23,7 @@ const apis = {
|
|
|
ACTIVITY_TA_LEVEL: '/api/activity/activityTa/level',
|
|
ACTIVITY_TA_LEVEL: '/api/activity/activityTa/level',
|
|
|
CLAIM_DAILY_REWARD: '/api/wallet/recharge/claimDailyReward',
|
|
CLAIM_DAILY_REWARD: '/api/wallet/recharge/claimDailyReward',
|
|
|
NEW_USER_NUM: '/api/wallet/ranking/newUserNum',
|
|
NEW_USER_NUM: '/api/wallet/ranking/newUserNum',
|
|
|
|
|
+ LOGOUT: '/api/account/logout',
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
export interface UserInfo {
|
|
export interface UserInfo {
|
|
@@ -66,6 +67,12 @@ export const login = async (params: LoginParams): Promise<LoginResult> => {
|
|
|
return { success: false };
|
|
return { success: false };
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// 退出登录
|
|
|
|
|
+export const logout = async (): Promise<boolean> => {
|
|
|
|
|
+ const res = await get(apis.LOGOUT);
|
|
|
|
|
+ return res.success;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
// 获取用户信息
|
|
// 获取用户信息
|
|
|
export const getUserInfo = async (): Promise<UserInfo | null> => {
|
|
export const getUserInfo = async (): Promise<UserInfo | null> => {
|
|
|
const res = await get<UserInfo>(apis.USER_INFO);
|
|
const res = await get<UserInfo>(apis.USER_INFO);
|
|
@@ -188,6 +195,7 @@ export const getNewUserNum = async (params?: any) => {
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
login,
|
|
login,
|
|
|
|
|
+ logout,
|
|
|
getUserInfo,
|
|
getUserInfo,
|
|
|
updateUserInfo,
|
|
updateUserInfo,
|
|
|
updateAvatar,
|
|
updateAvatar,
|