feat: 模卡更新

This commit is contained in:
chashaobao
2025-11-03 22:18:39 +08:00
parent fde2027588
commit 5e3e6903cb
31 changed files with 479 additions and 193 deletions

View File

@ -6,9 +6,9 @@ import { CITY_CODE_TO_NAME_MAP, COUNTY_CODE_TO_NAME_MAP, PROVINCE_CODE_TO_NAME_M
import http from '@/http';
import { API } from '@/http/api';
import store from '@/store';
import { setLocationInfo, setCityOperators } from '@/store/actions';
import { setLocationInfo, setCityConfigs } from '@/store/actions';
import { selectLocation } from '@/store/selector';
import { CityOperatorListItem, GetCityCodeRequest, LocationInfo } from '@/types/location';
import { CityConfigListItem, GetCityCodeRequest, LocationInfo } from '@/types/location';
import { authorize, getWxSetting } from './wx';
@ -135,14 +135,7 @@ export async function requestLocation(force: boolean = false) {
return location;
}
export async function requestCityOperators() {
const list = await http.get<CityOperatorListItem[]>(API.GET_ALL_CITY_OPERATOR);
store.dispatch(
setCityOperators(
(list || []).map(it => ({
cityCode: it.cityCode,
groupLink: it.groupLink,
}))
)
);
export async function requestCityConfigs() {
const list = await http.get<CityConfigListItem[]>(API.GET_ALL_CITY_CONFIGS);
store.dispatch(setCityConfigs(list));
}