Commit 66fe3b0c93e2dfd1548a142fe4661ab7119a1185
1 parent
85b6cf69
chore: publish config mode -> view_mode
Showing
3 changed files
with
4 additions
and
4 deletions
back-end/h5-api/api/work/controllers/Work.js
| ... | ... | @@ -25,11 +25,11 @@ module.exports = { |
| 25 | 25 | // GET /previewOne |
| 26 | 26 | // strapi-hook-ejs: https://github.com/strapi/strapi/tree/master/packages/strapi-hook-ejs |
| 27 | 27 | previewOne: async (ctx) => { |
| 28 | - const { mode } = ctx.request.query | |
| 28 | + const { view_mode } = ctx.request.query | |
| 29 | 29 | const work = await strapi.services.work.findOne(ctx.params); |
| 30 | 30 | // 非发布状态, 查看不到内容 |
| 31 | 31 | // 非预览模式, 查看不到内容 |
| 32 | - const canRender = mode === VIEW_MODE.PREVIEW || work.is_publish | |
| 32 | + const canRender = view_mode === VIEW_MODE.PREVIEW || work.is_publish | |
| 33 | 33 | if (!canRender) work.pages = [] |
| 34 | 34 | return ctx.render('engine', { work }); |
| 35 | 35 | }, | ... | ... |
front-end/h5/src/components/core/editor/modals/preview.vue
| ... | ... | @@ -22,7 +22,7 @@ export default { |
| 22 | 22 | // work: state => state.work |
| 23 | 23 | // }), |
| 24 | 24 | releaseUrl () { |
| 25 | - return `${window.location.origin}/works/preview/${this.work.id}?mode=preview` | |
| 25 | + return `${window.location.origin}/works/preview/${this.work.id}?view_mode=preview` | |
| 26 | 26 | } |
| 27 | 27 | }, |
| 28 | 28 | data () { | ... | ... |
front-end/h5/src/engine-entry.js
| ... | ... | @@ -98,7 +98,7 @@ const Engine = { |
| 98 | 98 | |
| 99 | 99 | // 预览模式 或者 已经发布 的页面可以正常渲染,否则提示用户暂未发布 |
| 100 | 100 | const query = new URLSearchParams(window.location.search) |
| 101 | - const canRender = query.get('mode') === 'preview' || work.is_publish | |
| 101 | + const canRender = query.get('view_mode') === 'preview' || work.is_publish | |
| 102 | 102 | if (!canRender) return this.renderUnPublishTip() |
| 103 | 103 | |
| 104 | 104 | const containerStyle = this.getContainerStyle(work) | ... | ... |