diff --git a/src/hocs/withPageWrapper.js b/src/hocs/withPageWrapper.js index bc1af6c78..121efe510 100644 --- a/src/hocs/withPageWrapper.js +++ b/src/hocs/withPageWrapper.js @@ -109,7 +109,11 @@ function withPageWrapper(Component) { }) if (res.confirm) { if (entryDefalutStore == '1') { - await checkStoreWhiteList() + try { + await checkStoreWhiteList() + } catch (err) { + await handleStoreWhiteList() + } } else { Taro.redirectTo({ url: `/pages/custom/custom-page?id=${guidderTemplateId}&fromConnect=davild` diff --git a/src/hooks/useWhiteShop.js b/src/hooks/useWhiteShop.js index 6813a1934..0ac3e631d 100644 --- a/src/hooks/useWhiteShop.js +++ b/src/hooks/useWhiteShop.js @@ -3,7 +3,7 @@ import { useSelector, useDispatch } from 'react-redux' import Taro from '@tarojs/taro' import api from '@/api' import S from '@/spx' -import { pickBy, getDistributorId, entryLaunch } from '@/utils' +import { pickBy, getDistributorId, entryLaunch, isEmpty } from '@/utils' import doc from '@/doc' import { useShopInfo } from '@/hooks' import { updateShopInfo } from '@/store/slices/shop' @@ -31,7 +31,7 @@ export default () => { if (dtid) { params['distributor_id'] = dtid } else if (entryStoreByLBS) { - if (!location) { + if (isEmpty(location)) { const locationInfo = await entryLaunch.getLocationInfo() dispatch(updateLocation(locationInfo)) params['lat'] = locationInfo?.lat @@ -154,6 +154,7 @@ export default () => { return { checkEnterStoreRule, + checkStoreWhiteList, checkUserInStoreWhiteList, getUserWhiteShop }