Skip to content

Commit 8f519e5

Browse files
committed
更新[BoxJs]: 修复应用订阅 icon&author 缺失默认值问题; 修复 appId 特殊字符转义问题
1 parent 8f9de65 commit 8f519e5

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎chavy.box.js‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const $ = new Env('BoxJs')
22
$.domain = '8.8.8.8'
33

4-
$.version = '0.1.2'
4+
$.version = '0.1.3'
55
$.versionType = 'beta'
66
$.KEY_sessions = 'chavy_boxjs_sessions'
77
$.KEY_userCfgs = 'chavy_boxjs_userCfgs'
@@ -11,6 +11,7 @@ $.json = $.name
1111
$.html = $.name
1212

1313
!(async () => {
14+
// $.setdata('', 'github')
1415
const path = getPath($request.url)
1516
// 处理主页请求 => /home
1617
if (/^\/home/.test(path)) {
@@ -22,7 +23,8 @@ $.html = $.name
2223
}
2324
// 处理 App 请求 => /app
2425
else if (/^\/app/.test(path)) {
25-
await handleApp(path.split('/app/')[1])
26+
const [, appId] = path.split('/app/')
27+
await handleApp(decodeURIComponent(decodeURIComponent(appId)))
2628
}
2729
// 处理 Api 请求 => /api
2830
else if (/^\/api/.test(path)) {
@@ -369,6 +371,11 @@ function wrapapps(apps) {
369371
} else {
370372
setting.val = val || setting.val
371373
}
374+
if (!Array.isArray(app.icons)) {
375+
app.icons = ['https://raw.githubusercontent.com/Orz-3/mini/master/appstore.png', 'https://raw.githubusercontent.com/Orz-3/task/master/appstore.png']
376+
}
377+
app.author = app.author ? app.author : '@anonymous'
378+
app.repo = app.repo ? app.repo : '作者很神秘, 没有留下任何线索!'
372379
})
373380
// 判断是否收藏应用
374381
const usercfgs = getUserCfgs()

0 commit comments

Comments
 (0)