feat: update
This commit is contained in:
@ -6,7 +6,7 @@ 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, setServiceUrls } from '@/store/actions';
|
||||
import { setLocationInfo, setCityOperators } from '@/store/actions';
|
||||
import { selectLocation } from '@/store/selector';
|
||||
import { CityOperatorListItem, GetCityCodeRequest, LocationInfo } from '@/types/location';
|
||||
|
||||
@ -135,14 +135,13 @@ export async function requestLocation(force: boolean = false) {
|
||||
return location;
|
||||
}
|
||||
|
||||
export async function requestServiceUrls() {
|
||||
const list = await http.post<CityOperatorListItem[]>(API.GET_ALL_CITY_OPERATOR);
|
||||
export async function requestCityOperators() {
|
||||
const list = await http.get<CityOperatorListItem[]>(API.GET_ALL_CITY_OPERATOR);
|
||||
store.dispatch(
|
||||
setServiceUrls(
|
||||
setCityOperators(
|
||||
(list || []).map(it => ({
|
||||
title: `【${it.cityName}】`,
|
||||
cityCode: Number(it.cityCode),
|
||||
serviceUrl: it.groupLink,
|
||||
cityCode: it.cityCode,
|
||||
groupLink: it.groupLink,
|
||||
}))
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user