Commit e8e01175087f43fa1a4191374bbee975c98866b0

Authored by ly525
1 parent 91525f0b

feat(preview): set page title for released page; (zh) 为发布的作品设置页面标题

back-end/h5-api/api/work/controllers/Work.js
  1 +/*
  2 + * @Author: ly525
  3 + * @Date: 2019-12-04 19:55:24
  4 + * @LastEditors: ly525
  5 + * @LastEditTime: 2019-12-14 21:34:57
  6 + * @FilePath: /luban-h5/back-end/h5-api/api/work/controllers/Work.js
  7 + * @Github: https://github.com/ly525/luban-h5
  8 + * @Description:
  9 + * @Copyright 2018 - 2019 luban-h5. All Rights Reserved
  10 + */
1 'use strict'; 11 'use strict';
2 const request = require('request'); 12 const request = require('request');
3 13
@@ -10,7 +20,8 @@ module.exports = { @@ -10,7 +20,8 @@ module.exports = {
10 // GET /previewOne 20 // GET /previewOne
11 // strapi-hook-ejs: https://github.com/strapi/strapi/tree/master/packages/strapi-hook-ejs 21 // strapi-hook-ejs: https://github.com/strapi/strapi/tree/master/packages/strapi-hook-ejs
12 previewOne: async (ctx) => { 22 previewOne: async (ctx) => {
13 - const work = await strapi.services.work.findOne(ctx.params); 23 + let work = await strapi.services.work.findOne(ctx.params);
  24 + work = work.toJSON();
14 return ctx.render('engine', { work }); 25 return ctx.render('engine', { work });
15 }, 26 },
16 submitForm: async (ctx) => { 27 submitForm: async (ctx) => {
back-end/h5-api/views/engine.ejs
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 * @Author: ly525 2 * @Author: ly525
3 * @Date: 2019-12-04 20:24:04 3 * @Date: 2019-12-04 20:24:04
4 * @LastEditors: ly525 4 * @LastEditors: ly525
5 - * @LastEditTime: 2019-12-14 21:46:01 5 + * @LastEditTime: 2019-12-14 21:46:23
6 * @FilePath: /luban-h5/back-end/h5-api/views/engine.ejs 6 * @FilePath: /luban-h5/back-end/h5-api/views/engine.ejs
7 * @Github: https://github.com/ly525/luban-h5 7 * @Github: https://github.com/ly525/luban-h5
8 * @Description: 手机端预览模板 8 * @Description: 手机端预览模板
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 13
14 <head> 14 <head>
15 <meta charset="UTF-8"> 15 <meta charset="UTF-8">
16 - <title>work.html</title> 16 + <title><%= work.title %></title>
17 <meta name="viewport" id="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"> 17 <meta name="viewport" id="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
18 <meta content="yes" name="apple-mobile-web-app-capable"> 18 <meta content="yes" name="apple-mobile-web-app-capable">
19 <meta content="black" name="apple-mobile-web-app-status-bar-style"> 19 <meta content="black" name="apple-mobile-web-app-status-bar-style">