This commit is contained in:
saplf
2019-09-05 23:24:49 +08:00
parent df25ff4244
commit c8f919ce5a
19 changed files with 658 additions and 37 deletions

View File

@@ -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);
}