fix(client): Mk:api関数にトークンを渡せない問題

This commit is contained in:
syuilo 2020-05-15 20:53:24 +09:00
parent 4ea60d36e5
commit 9244efe351

View file

@ -23,9 +23,10 @@ export function createAiScriptEnv(vm, opts) {
return confirm.canceled ? values.FALSE : values.TRUE;
}),
'Mk:api': values.FN_NATIVE(async ([ep, param, token]) => {
if (token) utils.assertString(token);
apiRequests++;
if (apiRequests > 16) return values.NULL;
const res = await vm.$root.api(ep.value, utils.valToJs(param), token || null);
const res = await vm.$root.api(ep.value, utils.valToJs(param), token ? token.value : null);
return utils.jsToVal(res);
}),
'Mk:save': values.FN_NATIVE(([key, value]) => {