Skip to content

Commit e8e0117

Browse files
committed
feat(preview): set page title for released page; (zh) 为发布的作品设置页面标题
1 parent 91525f0 commit e8e0117

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

back-end/h5-api/api/work/controllers/Work.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
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+
*/
111
'use strict';
212
const request = require('request');
313

@@ -10,7 +20,8 @@ module.exports = {
1020
// GET /previewOne
1121
// strapi-hook-ejs: https://github.com/strapi/strapi/tree/master/packages/strapi-hook-ejs
1222
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();
1425
return ctx.render('engine', { work });
1526
},
1627
submitForm: async (ctx) => {

back-end/h5-api/views/engine.ejs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @Author: ly525
33
* @Date: 2019-12-04 20:24:04
44
* @LastEditors: ly525
5-
* @LastEditTime: 2019-12-14 21:46:01
5+
* @LastEditTime: 2019-12-14 21:46:23
66
* @FilePath: /luban-h5/back-end/h5-api/views/engine.ejs
77
* @Github: https://github.com/ly525/luban-h5
88
* @Description: 手机端预览模板
@@ -13,7 +13,7 @@
1313

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

0 commit comments

Comments
 (0)