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