|
|
@@ -1,10 +1,10 @@
|
|
|
+import APP from '@/services';
|
|
|
+import { getAccoutIdList } from '@/services/bus/account';
|
|
|
import { buildProtoReq50, parseProtoRsp50 } from '@/services/socket/protobuf/buildReq';
|
|
|
-import { sha256 } from 'js-sha256';
|
|
|
-
|
|
|
import { Callback } from '@/utils/websocket/index';
|
|
|
+import { sha256 } from 'js-sha256';
|
|
|
import * as type from './interface/index';
|
|
|
-import APP from '@/services';
|
|
|
-import { getAccoutIdList } from '@/services/bus/account';
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 构建出金请求包的方法
|
|
|
@@ -32,7 +32,7 @@ export function buildOutMoney(param: type.buildOutMoneyReqParam) {
|
|
|
Object.assign(params.reqParams, param, { OldTaPWD: sha256.hex(param.OldTaPWD) });
|
|
|
console.log('params', params);
|
|
|
const package50 = buildProtoReq50(params);
|
|
|
- APP.sendTradingServer(package50, undefined, <Callback>{
|
|
|
+ APP.sendTradingServer(package50, undefined, {
|
|
|
onSuccess: (res) => {
|
|
|
const { isSuccess, result } = parseProtoRsp50(res, 't2bBankWithdrawRsp');
|
|
|
if (isSuccess) {
|
|
|
@@ -44,7 +44,7 @@ export function buildOutMoney(param: type.buildOutMoneyReqParam) {
|
|
|
onFail: (err) => {
|
|
|
reject(err.message)
|
|
|
},
|
|
|
- });
|
|
|
+ } as Callback);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -65,7 +65,7 @@ export const requestBankSign = (param: type.t2bBankSignReq): Promise<type.t2bBan
|
|
|
),
|
|
|
};
|
|
|
const package50 = buildProtoReq50(params);
|
|
|
- APP.sendTradingServer(package50, undefined, <Callback>{
|
|
|
+ APP.sendTradingServer(package50, undefined, {
|
|
|
onSuccess: (res) => {
|
|
|
const { isSuccess, result } = parseProtoRsp50(res, 't2bBankSignRsp');
|
|
|
if (isSuccess) {
|
|
|
@@ -75,7 +75,7 @@ export const requestBankSign = (param: type.t2bBankSignReq): Promise<type.t2bBan
|
|
|
}
|
|
|
},
|
|
|
onFail: (err) => reject(err.message),
|
|
|
- });
|
|
|
+ } as Callback);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
@@ -96,7 +96,7 @@ export const requestBankCancelSign = (param: type.t2bBankCancelSignReq): Promise
|
|
|
),
|
|
|
};
|
|
|
const package50 = buildProtoReq50(params);
|
|
|
- APP.sendTradingServer(package50, undefined, <Callback>{
|
|
|
+ APP.sendTradingServer(package50, undefined, {
|
|
|
onSuccess: (res) => {
|
|
|
const { isSuccess, result } = parseProtoRsp50(res, 't2bBankCancelSignRsp');
|
|
|
if (isSuccess) {
|
|
|
@@ -106,7 +106,7 @@ export const requestBankCancelSign = (param: type.t2bBankCancelSignReq): Promise
|
|
|
}
|
|
|
},
|
|
|
onFail: (err) => reject(err.message),
|
|
|
- });
|
|
|
+ } as Callback);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
@@ -123,7 +123,7 @@ export const queryBankCustomerSign = (): Promise<type.BankAccountSign[]> => {
|
|
|
},
|
|
|
};
|
|
|
const package50 = buildProtoReq50(params);
|
|
|
- APP.sendTradingServer(package50, undefined, <Callback>{
|
|
|
+ APP.sendTradingServer(package50, undefined, {
|
|
|
onSuccess: (res) => {
|
|
|
const { isSuccess, result } = parseProtoRsp50(res, 'BankSignRsp');
|
|
|
if (isSuccess) {
|
|
|
@@ -133,7 +133,7 @@ export const queryBankCustomerSign = (): Promise<type.BankAccountSign[]> => {
|
|
|
}
|
|
|
},
|
|
|
onFail: (err) => reject(err.message),
|
|
|
- });
|
|
|
+ } as Callback);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
@@ -147,7 +147,7 @@ export const queryCusBankInfo = (): Promise<type.CusBankInfoRsp> => {
|
|
|
params: {},
|
|
|
};
|
|
|
const package50 = buildProtoReq50(params);
|
|
|
- APP.sendTradingServer(package50, undefined, <Callback>{
|
|
|
+ APP.sendTradingServer(package50, undefined, {
|
|
|
onSuccess: (res) => {
|
|
|
const { isSuccess, result } = parseProtoRsp50(res);
|
|
|
if (isSuccess) {
|
|
|
@@ -159,7 +159,7 @@ export const queryCusBankInfo = (): Promise<type.CusBankInfoRsp> => {
|
|
|
onFail: (err) => {
|
|
|
reject(err.message);
|
|
|
},
|
|
|
- });
|
|
|
+ } as Callback);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
@@ -173,7 +173,7 @@ export const queryBankInfo = (cusBankId: number): Promise<any> => {
|
|
|
params: { cusBankId },
|
|
|
};
|
|
|
const package50 = buildProtoReq50(params);
|
|
|
- APP.sendTradingServer(package50, undefined, <Callback>{
|
|
|
+ APP.sendTradingServer(package50, undefined, {
|
|
|
onSuccess: (res) => {
|
|
|
const { isSuccess, result } = parseProtoRsp50(res);
|
|
|
if (isSuccess) {
|
|
|
@@ -185,7 +185,7 @@ export const queryBankInfo = (cusBankId: number): Promise<any> => {
|
|
|
onFail: (err) => {
|
|
|
reject(err.message);
|
|
|
},
|
|
|
- });
|
|
|
+ } as Callback);
|
|
|
});
|
|
|
};
|
|
|
/**
|
|
|
@@ -205,7 +205,7 @@ export const queryQueryBankInOut = (beginDate: string, endDate: string): Promise
|
|
|
params: param,
|
|
|
};
|
|
|
const package50 = buildProtoReq50(params);
|
|
|
- APP.sendTradingServer(package50, undefined, <Callback>{
|
|
|
+ APP.sendTradingServer(package50, undefined, {
|
|
|
onSuccess: (res) => {
|
|
|
const { isSuccess, result } = parseProtoRsp50(res);
|
|
|
if (isSuccess) {
|
|
|
@@ -217,6 +217,6 @@ export const queryQueryBankInOut = (beginDate: string, endDate: string): Promise
|
|
|
onFail: (err) => {
|
|
|
reject(err.message);
|
|
|
},
|
|
|
- });
|
|
|
+ } as Callback);
|
|
|
});
|
|
|
};
|