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: (