|
|
@@ -1,13 +1,13 @@
|
|
|
+import APP from '@/services';
|
|
|
+import { getAccount_longType, getUserId } from '@/services/bus/account';
|
|
|
+import { getErrorInfoByCode } from '@/services/bus/error';
|
|
|
+import { funCode } from '@/services/funcode/index';
|
|
|
import ProtobufCtr from '@/services/socket/protobuf/index';
|
|
|
import { Package50 } from '@/utils/websocket/package';
|
|
|
-import { funCode } from '@/services/funcode/index';
|
|
|
import { v4 as uuidv4 } from 'uuid';
|
|
|
-import { SoleSearchParam, CommonSearchParam, ParseRsp } from './interface';
|
|
|
import * as type from './interface';
|
|
|
+import { CommonSearchParam, ParseRsp, SoleSearchParam } from './interface';
|
|
|
import { IMessageHead } from './proto.d';
|
|
|
-import APP from '@/services';
|
|
|
-import { getAccount_longType, getUserId } from '@/services/bus/account';
|
|
|
-import { getErrorInfoByCode } from '@/services/bus/error';
|
|
|
|
|
|
/**
|
|
|
* 构建proto50 报文
|
|
|
@@ -179,11 +179,13 @@ function isErrer(rspPackage: any, funCodeName: string): void {
|
|
|
function parseSoleProtoRsp(rspPackage: any, funCodeName: string): ParseRsp {
|
|
|
isErrer(rspPackage, funCodeName);
|
|
|
const reqPackage = ProtobufCtr.generateProtoContent(funCodeName, rspPackage.content);
|
|
|
- const { RetCode, Status } = reqPackage;
|
|
|
+ const { RetCode, Status, RetDesc } = reqPackage;
|
|
|
if (RetCode !== null) {
|
|
|
if (RetCode === 0) {
|
|
|
return { isSuccess: true, result: reqPackage };
|
|
|
- } else {
|
|
|
+ } if (RetCode === -1) { // 管理端错误消息
|
|
|
+ return { isSuccess: false, result: RetDesc };
|
|
|
+ } else { // 数据库获取的错误信息
|
|
|
const errMsg = getErrorInfoByCode(String(RetCode));
|
|
|
const result = errMsg ? errMsg : `未知错误:${RetCode}`;
|
|
|
return { isSuccess: false, result };
|