执行js的方法增加返回uuid

This commit is contained in:
cebgcontract 2022-07-20 17:44:59 +08:00
parent cecbcd212e
commit e162bc7229
2 changed files with 6 additions and 2 deletions

View File

@ -9,6 +9,7 @@
#include "scripting/js-bindings/event/EventDispatcher.h"
#include "scripting/js-bindings/manual/jsb_conversions.hpp"
#include "platform/CCApplication.h"
#include "scrypt/native-crypto.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
#include "AppDelegate.h"
@ -146,10 +147,12 @@ NS_CC_BEGIN
}
}
char *runWalletMethod(const char *methodName, int paramCount, char **paramList) {
const char *runWalletMethod(const char *methodName, int paramCount, char **paramList) {
JSMethodParam *data = new JSMethodParam();
std::string methodNameStr(methodName);
data->methodName = methodNameStr;
data -> funId = uuid_v4();
data->paramCount = paramCount;
for (int i = 0; i < paramCount; i++) {
char *arg = *(paramList + i);
@ -157,7 +160,7 @@ NS_CC_BEGIN
}
std::shared_ptr<JSMethodParam> params(data);
RUN_IN_SERVERTHREAD(JcWallet::getInstance()->runJsMethod(params));
return "1";
return data->funId.c_str();
}
}

View File

@ -12,6 +12,7 @@
NS_CC_BEGIN
struct JSMethodParam {
std::string methodName;
std::string funId;
int paramCount;
se::ValueArray args;
};