fix(common-tools): 资料下载改挂站点 /static/ 静态位
/materials/ 是不在发布白名单里的新目录,deploy_app_web.py 只上传 index.html+assets+/static/ 清单 ⇒ 上线即 404。改走既有 /static/(nginx 已配), 发布清单在 ops 仓 deploy_app_web.py 同步登记 4 个文件。
This commit is contained in:
@@ -13,11 +13,11 @@ import {
|
||||
const here = dirname(fileURLToPath(import.meta.url))
|
||||
const ROOT = resolve(here, '..')
|
||||
|
||||
test('downloadHref:落在 /materials/ 下,空格与非 ASCII 都按 encodeURI 转义', () => {
|
||||
assert.equal(downloadHref('百分30利润表格.xlsx'), `/materials/${encodeURI('百分30利润表格.xlsx')}`)
|
||||
test('downloadHref:落在 /static/ 下,空格与非 ASCII 都按 encodeURI 转义', () => {
|
||||
assert.equal(downloadHref('百分30利润表格.xlsx'), `/static/${encodeURI('百分30利润表格.xlsx')}`)
|
||||
assert.equal(
|
||||
downloadHref('设置最低价ASIN 批量文档格式.xlsx'),
|
||||
'/materials/%E8%AE%BE%E7%BD%AE%E6%9C%80%E4%BD%8E%E4%BB%B7ASIN%20%E6%89%B9%E9%87%8F%E6%96%87%E6%A1%A3%E6%A0%BC%E5%BC%8F.xlsx',
|
||||
'/static/%E8%AE%BE%E7%BD%AE%E6%9C%80%E4%BD%8E%E4%BB%B7ASIN%20%E6%89%B9%E9%87%8F%E6%96%87%E6%A1%A3%E6%A0%BC%E5%BC%8F.xlsx',
|
||||
)
|
||||
// 不允许出现裸空格(浏览器会容忍,但 href 里必须是编码后的形态)
|
||||
for (const item of PRICING_DOWNLOADS) {
|
||||
|
||||
Reference in New Issue
Block a user