From 2a20ed0f14c57e5aa34e388f926cb3900e256dd0 Mon Sep 17 00:00:00 2001 From: Jimmy Liow Date: Tue, 9 Jul 2024 09:41:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AF=BC=E8=88=AA=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E7=AE=A1=E7=90=86=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/Account.js | 7 +++++-- src/views/App.jsx | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/stores/Account.js b/src/stores/Account.js index 2b5e8d8..22c96ca 100644 --- a/src/stores/Account.js +++ b/src/stores/Account.js @@ -1,6 +1,6 @@ import { create } from 'zustand' import { fetchJSON, postForm } from '@/utils/request' -import { isEmpty } from '@/utils/commons' +import { isEmpty, isNotEmpty } from '@/utils/commons' import { HT_HOST } from "@/config" import { usingStorage } from '@/hooks/usingStorage' @@ -139,7 +139,10 @@ const useAccountStore = create((set, get) => ({ }, searchAccountByCriteria: async (formValues) => { - const travel_agency_ids = formValues.agency.map((ele) => ele.key).join(',') + let travel_agency_ids = null + if (isNotEmpty(formValues.agency)) { + travel_agency_ids = formValues.agency.map((ele) => ele.key).join(',') + } const searchParams = { username: formValues.username, realname: formValues.realname, diff --git a/src/views/App.jsx b/src/views/App.jsx index a9c4937..73abe43 100644 --- a/src/views/App.jsx +++ b/src/views/App.jsx @@ -17,7 +17,7 @@ import useAuthStore from '@/stores/Auth' import { useThemeContext } from '@/stores/ThemeContext' import { usingStorage } from '@/hooks/usingStorage' -import { PERM_ACCOUNT_MANAGEMENT, PERM_ROLE_NEW, PERM_OVERSEA, PERM_AIR_TICKET } from '@/config' +import { PERM_ACCOUNT_MANAGEMENT, PERM_ROLE_NEW, PERM_OVERSEA, PERM_AIR_TICKET, PERM_PRODUCTS_MANAGEMENT } from '@/config' const { Header, Content, Footer } = Layout; const { Title } = Typography; @@ -117,7 +117,7 @@ function App() { isPermitted(PERM_OVERSEA) ? { key: 'feedback', label: {t('menu.Feedback')} } : null, isPermitted(PERM_OVERSEA) ? { key: 'report', label: {t('menu.Report')} } : null, isPermitted(PERM_AIR_TICKET) ? { key: 'airticket', label: {t('menu.Airticket')} } : null, - { key: 'products', label: {t('menu.Products')} }, + isPermitted(PERM_PRODUCTS_MANAGEMENT) ? { key: 'products', label: {t('menu.Products')} } : null, { key: 'notice', label: (