fix:部分逻辑

This commit is contained in:
kissnavel 2025-05-17 19:46:53 +08:00
parent 800bc15007
commit c5d9131c1d
9 changed files with 56 additions and 30 deletions

View file

@ -22,12 +22,14 @@ export const saveMonthlyNewData = (uid, ...newDatas) => {
/**
* 获取月度数据
* @param {MysZZZApi} api
* @param {string} deviceFp
* @param {string} month
* @returns {Promise<object | null>}
*/
export const getMonthly = async (api, month) => {
export const getMonthly = async (api, deviceFp, month) => {
// 获取月度数据
const data = await api.getFinalData('zzzMonthly', {
deviceFp,
query: { month },
});
saveMonthlyNewData(api.uid, data);
@ -37,11 +39,12 @@ export const getMonthly = async (api, month) => {
/**
* 月度数据统计
* @param {MysZZZApi} api
* @param {string} deviceFp
* @returns {Promise<object | null>}
*/
export const getMonthlyCollect = async api => {
export const getMonthlyCollect = async (api, deviceFp) => {
// 获取当前月度数据
const currentData = await getMonthly(api, '');
const currentData = await getMonthly(api, deviceFp, '');
if (!currentData) return null;