Skip to content

Commit

Permalink
Merge pull request #493 from chavyleung/yy
Browse files Browse the repository at this point in the history
fix(boxjs): argument 支持 JSON 格式
  • Loading branch information
dompling authored Apr 24, 2024
2 parents 252c5d5 + 09cc96c commit 996d2e2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions box/chavy.boxjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const $ = new Env('BoxJs')
// 为 eval 准备的上下文环境
const $eval_env = {}

$.version = '0.19.0'
$.version = '0.19.1'
$.versionType = 'beta'

// 发出的请求需要需要 Surge、QuanX 的 rewrite
Expand Down Expand Up @@ -825,7 +825,7 @@ async function apiRunScript() {
script_text = opts.script
}
if (opts.argument) {
script_text = `globalThis.$argument="${opts.argument}";${script_text}`
script_text = `globalThis.$argument=\`${opts.argument}\`;${script_text}`
}
if (
$.isSurge() &&
Expand Down
19 changes: 19 additions & 0 deletions box/release/box.release.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
{
"releases": [
{
"version": "0.19.1",
"tags": ["beta"],
"author": "@chavyleung",
"msg": "fix(boxjs): /api/runScritp 接受 argument 参数",
"notes": [
{
"name": "功能",
"descs": [
"/api/runScritp 接受 argument 参数",
"更新: argument 支持 JSON 格式的参数"
]
},
{
"name": "感谢",
"descs": ["@is_bo 建议"]
}
]
},
{
"version": "0.19.0",
"tags": ["beta"],
Expand Down
4 changes: 2 additions & 2 deletions chavy.box.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const $ = new Env('BoxJs')
// 为 eval 准备的上下文环境
const $eval_env = {}

$.version = '0.19.0'
$.version = '0.19.1'
$.versionType = 'beta'

// 发出的请求需要需要 Surge、QuanX 的 rewrite
Expand Down Expand Up @@ -825,7 +825,7 @@ async function apiRunScript() {
script_text = opts.script
}
if (opts.argument) {
script_text = `globalThis.$argument="${opts.argument}";${script_text}`
script_text = `globalThis.$argument=\`${opts.argument}\`;${script_text}`
}
if (
$.isSurge() &&
Expand Down

0 comments on commit 996d2e2

Please sign in to comment.