执行js的方法增加返回uuid
This commit is contained in:
parent
cecbcd212e
commit
e162bc7229
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
NS_CC_BEGIN
|
||||
struct JSMethodParam {
|
||||
std::string methodName;
|
||||
std::string funId;
|
||||
int paramCount;
|
||||
se::ValueArray args;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user