Ethscriptions commited on
Commit
d9a7d47
·
1 Parent(s): 3bbe358

Keep redesigned root route separate from legacy toolbox page

Browse files
Files changed (1) hide show
  1. fanqie/mount.js +3 -2
fanqie/mount.js CHANGED
@@ -9,6 +9,7 @@ module.exports = function mountFanqie(app, passwordOk, express) {
9
  // 旧版全局写作工具单独保留,供新版 /fanqie/ 以内嵌方式完整展示。
10
  // 根入口使用新版工作台,避免 /fanqie/tools 与 /fanqie/ 互相覆盖。
11
  const TOOLS_PAGE = path.join(__dirname, 'tools.html')
 
12
  const materials = require('./materials.js')
13
  const guarded = (handler) => async (req, res) => {
14
  if (!passwordOk(req)) return res.status(401).json({ error: 'password required' })
@@ -96,11 +97,11 @@ module.exports = function mountFanqie(app, passwordOk, express) {
96
  // 这样原平台的素材浏览、母题库、自动组稿、红线库等内容保持原样,项目写作作为新增功能提供。
97
  app.get(['/fanqie', '/fanqie/'], (_req, res) => {
98
  res.setHeader('Cache-Control', 'no-cache')
99
- res.sendFile(TOOLS_PAGE)
100
  })
101
  app.get('/fanqie/*', (_req, res) => {
102
  res.setHeader('Cache-Control', 'no-cache')
103
- res.sendFile(TOOLS_PAGE)
104
  })
105
  console.log('番茄写作工作台 mounted at /fanqie/')
106
  }
 
9
  // 旧版全局写作工具单独保留,供新版 /fanqie/ 以内嵌方式完整展示。
10
  // 根入口使用新版工作台,避免 /fanqie/tools 与 /fanqie/ 互相覆盖。
11
  const TOOLS_PAGE = path.join(__dirname, 'tools.html')
12
+ const ROOT_PAGE = path.join(DIST, 'index.html')
13
  const materials = require('./materials.js')
14
  const guarded = (handler) => async (req, res) => {
15
  if (!passwordOk(req)) return res.status(401).json({ error: 'password required' })
 
97
  // 这样原平台的素材浏览、母题库、自动组稿、红线库等内容保持原样,项目写作作为新增功能提供。
98
  app.get(['/fanqie', '/fanqie/'], (_req, res) => {
99
  res.setHeader('Cache-Control', 'no-cache')
100
+ res.sendFile(ROOT_PAGE)
101
  })
102
  app.get('/fanqie/*', (_req, res) => {
103
  res.setHeader('Cache-Control', 'no-cache')
104
+ res.sendFile(ROOT_PAGE)
105
  })
106
  console.log('番茄写作工作台 mounted at /fanqie/')
107
  }