feat: 球局详情完善 & 订单详情完善
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import Taro from "@tarojs/taro";
|
||||
import httpService, { ApiResponse } from "./httpService";
|
||||
import tokenManager from '../utils/tokenManager';
|
||||
import { useUser } from '@/store/userStore';
|
||||
import tokenManager from "../utils/tokenManager";
|
||||
import { useUser } from "@/store/userStore";
|
||||
|
||||
// 微信用户信息接口
|
||||
export interface WechatUserInfo {
|
||||
@@ -49,7 +49,7 @@ export interface UserStats {
|
||||
export interface PhoneLoginParams {
|
||||
phone: string;
|
||||
verification_code: string;
|
||||
user_code: string
|
||||
user_code: string;
|
||||
}
|
||||
|
||||
export interface UserInfoType {
|
||||
@@ -105,7 +105,7 @@ export const wechat_auth_login = async (
|
||||
try {
|
||||
await useUser.getState().fetchUserInfo();
|
||||
} catch (error) {
|
||||
console.error('更新用户信息到 store 失败:', error);
|
||||
console.error("更新用户信息到 store 失败:", error);
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -158,7 +158,7 @@ export const phone_auth_login = async (
|
||||
try {
|
||||
await useUser.getState().fetchUserInfo();
|
||||
} catch (error) {
|
||||
console.error('更新用户信息到 store 失败:', error);
|
||||
console.error("更新用户信息到 store 失败:", error);
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -410,4 +410,40 @@ export const updateUserPhone = async (payload: ChangePhoneParams) => {
|
||||
console.error("更新用户手机号失败:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
// 获取指定用户信息
|
||||
export const getUserInfoById = async (id) => {
|
||||
try {
|
||||
const response = await httpService.post("/user/detail_by_id", { id });
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.error("获取用户信息失败:", error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
// 关注用户
|
||||
export const followUser = async (following_id) => {
|
||||
try {
|
||||
const response = await httpService.post("/wch_users/follow", {
|
||||
following_id,
|
||||
});
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.error("关注失败:", error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
// 取消关注用户
|
||||
export const unFollowUser = async (following_id) => {
|
||||
try {
|
||||
const response = await httpService.post("/wch_users/unfollow", {
|
||||
following_id,
|
||||
});
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.error("取消关注失败:", error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user