Commit 4e9b7471 authored by limh's avatar limh
Browse files

# http接口返回值结构修改

No related merge requests found
Showing with 13 additions and 12 deletions
+13 -12
......@@ -4,6 +4,7 @@ import { ClientUser } from '../../../public/interface';
import { getAllGameInfos, piFetch } from '../../../public/tools';
import { UserClientInfo, UserTypeArg, UserTypeArg_Enum, WalletLoginReq } from '../../../server/client/user/login_c.s';
import { WithdrawlArg } from '../../../server/client/withdrawl/withdrawl.s';
import { ResultCode } from '../../../server/data/interface';
import { getStore, setStore } from '../store/client_store';
import { clientPopNewMessage, clientShowErrorNotice } from '../utils/tools';
......@@ -53,8 +54,8 @@ export const updateUserInfo = async (param: ClientUser) => {
const url = `${CASH_HTTP_URL}/port/setUserInfo?user=${JSON.stringify(getUserParam())}&param=${JSON.stringify(arg)}`;
const r: any = await piFetch(url);
if (r && r.result === 1) {
return r.ok;
if (r && r.res.result === ResultCode.SUCCESS) {
return r.res.msg;
} else {
clientShowErrorNotice(r.err);
......@@ -75,8 +76,8 @@ export const getGoldCoinCount = async (appid: string) => {
const openid = getStore('user/openId', '');
const url = `${CASH_HTTP_URL}/port/getGoldCoin?openid=${openid}&appid=${appid}`;
const r: any = await piFetch(url);
if (r && r.result === 1) {
return r.ok;
if (r && r.res.result === ResultCode.SUCCESS) {
return r.res.msg;
} else {
clientShowErrorNotice(r.err);
......@@ -97,8 +98,8 @@ export const getWithdrawNotes = async (appid: string) => {
try {
const url = `${CASH_HTTP_URL}/port/getWithdrawlLog?user=${JSON.stringify(getUserParam())}&param=${appid}`;
const r: any = await piFetch(url);
if (r && r.result === 1) {
return r.ok;
if (r && r.res.result === ResultCode.SUCCESS) {
return r.res.msg;
} else {
clientShowErrorNotice(r.err);
......@@ -125,8 +126,8 @@ export const applyWithdraw = async (appid: string, money: number) => {
const url = `${CASH_HTTP_URL}/port/applyWithdrawl?user=${JSON.stringify(getUserParam())}&param=${JSON.stringify(arg)}`;
const r: any = await piFetch(url);
if (r && r.result === 1) {
return r.ok;
if (r && r.res.result === ResultCode.SUCCESS) {
return r.res.msg;
} else {
clientShowErrorNotice(r.err);
......@@ -150,8 +151,8 @@ export const isNewUser = async (appid: string) => {
try {
const url = `${CASH_HTTP_URL}/port/hasReceiveGift?user=${JSON.stringify(getUserParam())}&param=${appid}`;
const r: any = await piFetch(url);
if (r && r.result === 1) {
return !r.ok; // 收过大礼包则不是新用户
if (r && r.res.result === ResultCode.SUCCESS) {
return !r.res.msg; // 收过大礼包则不是新用户
} else {
clientShowErrorNotice(r.err);
......@@ -172,8 +173,8 @@ export const getLastWithdrawTime = async (appid: string) => {
try {
const url = `${CASH_HTTP_URL}/port/getLastWithdrawlTime?user=${JSON.stringify(getUserParam())}&param=${appid}`;
const r: any = await piFetch(url);
if (r && r.result === 1) {
return r.ok; // 时间戳
if (r && r.res.result === ResultCode.SUCCESS) {
return r.res.msg; // 时间戳
} else {
clientShowErrorNotice(r.err);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment