優化 API 請求處理,增加安全性檢查以防止錯誤資料傳遞
This commit is contained in:
parent
65ace7a093
commit
96fcd24546
Binary file not shown.
|
Before Width: | Height: | Size: 552 KiB After Width: | Height: | Size: 217 KiB |
@ -45,17 +45,8 @@ export const getSystemEnergyCostGrowth = async (building_ids) => {
|
||||
}
|
||||
|
||||
export const getUserList = async (params = {}) => {
|
||||
const {
|
||||
page = 1,
|
||||
pageSize = 9999999
|
||||
} = params;
|
||||
|
||||
const requestData = {
|
||||
Page: page,
|
||||
PageSize: pageSize
|
||||
};
|
||||
|
||||
const res = await instance.post(GET_USER_API, requestData);
|
||||
const res = await instance.post(GET_USER_API, {});
|
||||
|
||||
return apihandler(res.code, res.data, {
|
||||
msg: res.msg,
|
||||
|
||||
@ -39,8 +39,8 @@ const authPages = computed(() =>
|
||||
const open = ref(false);
|
||||
const getSubMonitorPage = async (building_guid) => {
|
||||
const res = await getAllSysSidebar(building_guid);
|
||||
buildingStore.mainSubSys = res.data.history_Main_Systems;
|
||||
menu_array.value = res.data.history_Main_Systems;
|
||||
buildingStore.mainSubSys = res?.data?.history_Main_Systems ?? [];
|
||||
menu_array.value = res?.data?.history_Main_Systems ?? [];
|
||||
};
|
||||
const getSubPage = async (system_type) => {
|
||||
const res = await getSideBar(system_type);
|
||||
|
||||
@ -13,7 +13,7 @@ let intervalId = null;
|
||||
const getEnergyInfos = async () => {
|
||||
try {
|
||||
const res = await getEnergyInfo(store.selectedBuilding.building_guid);
|
||||
const apiData = res.data;
|
||||
const apiData = res?.data || {};
|
||||
|
||||
energyData.value = [
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user