diff --git a/src/components/CityChooseList.vue b/src/components/CityChooseList.vue index 2f0994b..9f96801 100644 --- a/src/components/CityChooseList.vue +++ b/src/components/CityChooseList.vue @@ -47,6 +47,7 @@ import { useUserStore } from '@/stores/user'; import { useCityStore } from '../stores/city'; import api from '@/utils/api'; import WechatUtils,{ WechatLocation } from '@/utils/wechat' +import { getCookie, setCookie } from '@/utils/cookie' export default { name: 'CityChooseList', data() { @@ -103,8 +104,8 @@ export default { }; // localStorage.setItem('cityInfo', JSON.stringify(result.data)); // localStorage.setItem('userLocation', JSON.stringify({ ...location, time: new Date().getTime() })); - setCookie('cityInfo', JSON.stringify(result.data),1); - setCookie('userLocation', JSON.stringify({...location, time: new Date().getTime()},1)); + // setCookie('cityInfo', JSON.stringify(result.data),1); + // setCookie('userLocation', JSON.stringify({...location, time: new Date().getTime()},1)); userStore.setCity(result.data); this.$emit('cityItem',{ cityName: result.data.cityName, diff --git a/src/pages/Home.vue b/src/pages/Home.vue index dd3769b..f3678ce 100644 --- a/src/pages/Home.vue +++ b/src/pages/Home.vue @@ -490,7 +490,7 @@ const handleBrandItem = (item) => { getProductList(); } -const handleCityItem = (item) => { +const handleCityItem = (item) => { const userStore = useUserStore(); query_data.cityId = item.cityId; query_data.page = 1;