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,
|
||||
}))
|
||||
)
|
||||
);
|
||||
|
||||
@ -21,8 +21,8 @@ import {
|
||||
WithdrawRecord,
|
||||
WithdrawResponse,
|
||||
} from '@/types/partner';
|
||||
import { requestUserInfo } from '@/utils/user';
|
||||
import { buildUrl } from '@/utils/common';
|
||||
import { requestUserInfo } from '@/utils/user';
|
||||
|
||||
export const getInviteCodeFromQuery = (query: Record<string, string>): string | undefined => {
|
||||
if (query) {
|
||||
@ -134,7 +134,9 @@ export async function getWithdrawList(data: IPaginationRequest) {
|
||||
});
|
||||
}
|
||||
export async function getLastProfitList() {
|
||||
const result = await http.get<UserProfitListItem[]>(API.GET_PROFIT_LIST);
|
||||
const result = await http.get<UserProfitListItem[]>(API.GET_USER_PROFIT_LIST, {
|
||||
contentType: 'application/x-www-form-urlencoded',
|
||||
});
|
||||
return Array.isArray(result) ? result : [];
|
||||
}
|
||||
|
||||
@ -151,6 +153,6 @@ export async function decryptOpenGid(data: DecryptOpenGidBody) {
|
||||
});
|
||||
}
|
||||
export async function getStaffInfo(cityCode: string) {
|
||||
const result = await http.post<StaffInfo[]>(buildUrl(API.GET_STAFF_CODE, { cityCode }));
|
||||
const result = await http.get<StaffInfo[]>(buildUrl(API.GET_STAFF_CODE, { cityCode }));
|
||||
return Array.isArray(result) && result.length ? result[0] : null;
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ export const getUserId = () => getUserInfo().userId;
|
||||
export const isValidUserInfo = (info: UserInfo) => !!info.userId;
|
||||
|
||||
export const isNeedLogin = (info: UserInfo) => !info.isBindPhone;
|
||||
// export const isNeedLogin = (info: UserInfo) => !info.isBindPhone || info.userId === '534740874077898752';
|
||||
// export const isNeedLogin = (info: UserInfo) => !info.isBindPhone || info.userId === '218396277145075712';
|
||||
|
||||
export const isNeedPhone = (info: UserInfo) => isNeedLogin(info) || !info.phone;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user