feat:n
This commit is contained in:
@ -61,8 +61,11 @@ export const getInviteCode = async () => {
|
||||
return inviteCode;
|
||||
};
|
||||
export const getProfitList = async (data: GetProfitRequest) => {
|
||||
// const result = await http.post<PartnerProfitItem[]>(API.GET_PROFIT_LIST, { data });
|
||||
// return Array.isArray(result) ? result : [];
|
||||
const result = await http.post<PartnerProfitItem[]>(API.GET_PROFIT_LIST, {
|
||||
data,
|
||||
contentType: 'application/x-www-form-urlencoded',
|
||||
});
|
||||
return Array.isArray(result) ? result : [];
|
||||
return [];
|
||||
};
|
||||
export const formatMoney = (cents: number) => {
|
||||
@ -73,11 +76,8 @@ export const formatMoney = (cents: number) => {
|
||||
return yuan.toFixed(2);
|
||||
};
|
||||
export function formatTimestamp(timestamp: string): string {
|
||||
// 将字符串时间戳转换为数字类型
|
||||
const time = Number(timestamp);
|
||||
|
||||
// 创建 Date 对象
|
||||
const date = new Date(time);
|
||||
const date = new Date(timestamp);
|
||||
|
||||
// 获取年、月、日、时、分、秒
|
||||
const YYYY = date.getFullYear();
|
||||
@ -85,10 +85,9 @@ export function formatTimestamp(timestamp: string): string {
|
||||
const DD = String(date.getDate()).padStart(2, '0');
|
||||
const HH = String(date.getHours()).padStart(2, '0');
|
||||
const mm = String(date.getMinutes()).padStart(2, '0');
|
||||
const ss = String(date.getSeconds()).padStart(2, '0');
|
||||
|
||||
// 拼接成所需的格式
|
||||
return `${YYYY}.${MM}.${DD} ${HH}:${mm}:${ss}`;
|
||||
return `${YYYY}.${MM}.${DD} ${HH}:${mm}`;
|
||||
}
|
||||
|
||||
export function formatUserId(input: string): string {
|
||||
|
||||
Reference in New Issue
Block a user