Skip to content

Commit

Permalink
feat(preview): set page title for released page; (zh) 为发布的作品设置页面标题
Browse files Browse the repository at this point in the history
  • Loading branch information
ly525 committed Dec 14, 2019
1 parent 91525f0 commit e8e0117
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion back-end/h5-api/api/work/controllers/Work.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* @Author: ly525
* @Date: 2019-12-04 19:55:24
* @LastEditors: ly525
* @LastEditTime: 2019-12-14 21:34:57
* @FilePath: /luban-h5/back-end/h5-api/api/work/controllers/Work.js
* @Github: https://github.com/ly525/luban-h5
* @Description:
* @Copyright 2018 - 2019 luban-h5. All Rights Reserved
*/
'use strict';
const request = require('request');

Expand All @@ -10,7 +20,8 @@ module.exports = {
// GET /previewOne
// strapi-hook-ejs: https://github.com/strapi/strapi/tree/master/packages/strapi-hook-ejs
previewOne: async (ctx) => {
const work = await strapi.services.work.findOne(ctx.params);
let work = await strapi.services.work.findOne(ctx.params);
work = work.toJSON();
return ctx.render('engine', { work });
},
submitForm: async (ctx) => {
Expand Down
4 changes: 2 additions & 2 deletions back-end/h5-api/views/engine.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: ly525
* @Date: 2019-12-04 20:24:04
* @LastEditors: ly525
* @LastEditTime: 2019-12-14 21:46:01
* @LastEditTime: 2019-12-14 21:46:23
* @FilePath: /luban-h5/back-end/h5-api/views/engine.ejs
* @Github: https://github.com/ly525/luban-h5
* @Description: 手机端预览模板
Expand All @@ -13,7 +13,7 @@

<head>
<meta charset="UTF-8">
<title>work.html</title>
<title><%= work.title %></title>
<meta name="viewport" id="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
Expand Down

0 comments on commit e8e0117

Please sign in to comment.