forked from FoundKeyGang/FoundKey
fix(client): Mk:api関数にトークンを渡せない問題
This commit is contained in:
parent
4ea60d36e5
commit
9244efe351
1 changed files with 2 additions and 1 deletions
|
@ -23,9 +23,10 @@ export function createAiScriptEnv(vm, opts) {
|
||||||
return confirm.canceled ? values.FALSE : values.TRUE;
|
return confirm.canceled ? values.FALSE : values.TRUE;
|
||||||
}),
|
}),
|
||||||
'Mk:api': values.FN_NATIVE(async ([ep, param, token]) => {
|
'Mk:api': values.FN_NATIVE(async ([ep, param, token]) => {
|
||||||
|
if (token) utils.assertString(token);
|
||||||
apiRequests++;
|
apiRequests++;
|
||||||
if (apiRequests > 16) return values.NULL;
|
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);
|
return utils.jsToVal(res);
|
||||||
}),
|
}),
|
||||||
'Mk:save': values.FN_NATIVE(([key, value]) => {
|
'Mk:save': values.FN_NATIVE(([key, value]) => {
|
||||||
|
|
Loading…
Reference in a new issue