feat:
This commit is contained in:
parent
dbfa53880f
commit
347c7d7cc9
@ -4,8 +4,10 @@ import { useCallback, useState } from 'react';
|
|||||||
|
|
||||||
import LoginDialog from '@/components/login-dialog';
|
import LoginDialog from '@/components/login-dialog';
|
||||||
import PartnerKanban from '@/components/partner-kanban';
|
import PartnerKanban from '@/components/partner-kanban';
|
||||||
|
import { PageUrl } from '@/constants/app';
|
||||||
import useUserInfo from '@/hooks/use-user-info';
|
import useUserInfo from '@/hooks/use-user-info';
|
||||||
import { becomePartner } from '@/utils/partner';
|
import { becomePartner } from '@/utils/partner';
|
||||||
|
import { navigateTo } from '@/utils/route';
|
||||||
import { isNeedPhone, requestUserInfo } from '@/utils/user';
|
import { isNeedPhone, requestUserInfo } from '@/utils/user';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
@ -48,6 +50,7 @@ export default function PartnerEntry() {
|
|||||||
const handleBindSuccess = useCallback(async () => {
|
const handleBindSuccess = useCallback(async () => {
|
||||||
await becomePartner();
|
await becomePartner();
|
||||||
await requestUserInfo();
|
await requestUserInfo();
|
||||||
|
await navigateTo(PageUrl.Partner);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (userInfo.isPartner) {
|
if (userInfo.isPartner) {
|
||||||
|
@ -61,7 +61,8 @@ export const getInviteCode = async () => {
|
|||||||
return inviteCode;
|
return inviteCode;
|
||||||
};
|
};
|
||||||
export const getProfitList = async (data: GetProfitRequest) => {
|
export const getProfitList = async (data: GetProfitRequest) => {
|
||||||
return await http.post<PartnerProfitItem[]>(API.GET_PROFIT_LIST, { data });
|
const result = await http.post<PartnerProfitItem[]>(API.GET_PROFIT_LIST, { data });
|
||||||
|
return Array.isArray(result) ? result : [];
|
||||||
};
|
};
|
||||||
export const formatMoney = (cents: number) => {
|
export const formatMoney = (cents: number) => {
|
||||||
if (!cents) {
|
if (!cents) {
|
||||||
|
Loading…
Reference in New Issue
Block a user