提取
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { AreaCodes, User } from '@/types/common';
|
||||
import { AreaCodes, User, FundBasic } from '@/types/common';
|
||||
import { loadAreaCode, storeAreaCode, loadUser, storeUser } from '@/utils/storage';
|
||||
import http from '@/utils/http';
|
||||
|
||||
@@ -43,3 +43,25 @@ export async function getUserInfo(refresh = false): Promise<User> {
|
||||
|
||||
throw Error(msg);
|
||||
}
|
||||
|
||||
export async function getFundBasic(): Promise<FundBasic> {
|
||||
const {
|
||||
ok,
|
||||
data,
|
||||
msg,
|
||||
} = await http.get<FundBasic>('/fund/detail');
|
||||
if (ok && data) {
|
||||
return data;
|
||||
}
|
||||
throw Error(msg);
|
||||
}
|
||||
|
||||
export async function checkFundPwd(): Promise<boolean> {
|
||||
const { ok, msg, data } = await http.get<number>('/user/checkFundPwd');
|
||||
if (ok) {
|
||||
// 0 未设置;1 已设置
|
||||
return data === 1;
|
||||
}
|
||||
|
||||
throw Error(msg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user