字体文件
This commit is contained in:
parent
10e0399f60
commit
c6c91515f7
@ -11,6 +11,7 @@ import helmet from 'helmet';
|
|||||||
import FileStreamRotator from 'file-stream-rotator';
|
import FileStreamRotator from 'file-stream-rotator';
|
||||||
import morgan from 'morgan';
|
import morgan from 'morgan';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
import path from 'path';
|
||||||
import logger from './../utils/logger';
|
import logger from './../utils/logger';
|
||||||
import expressUtils from './../utils/express-utils';
|
import expressUtils from './../utils/express-utils';
|
||||||
import config from './../../config/config';
|
import config from './../../config/config';
|
||||||
@ -97,12 +98,14 @@ app.get('/robots.txt', function(req, res) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// TODO: 待删 字体测试用
|
// TODO: 待删 字体测试用
|
||||||
app.use('/get_font', async (req, res, next) => {
|
app.get('/get_font', async (req, res, next) => {
|
||||||
const query = req.query;
|
const query = req.query;
|
||||||
const font_name = query.font_name;
|
const font_name = query.font_name;
|
||||||
const ext = query.ext;
|
const ext = query.ext;
|
||||||
|
const fontPath = path.join(__dirname, `../fonts/${font_name}.${ext}`)
|
||||||
|
console.log(path)
|
||||||
|
|
||||||
res.download(`fonts/${font_name}.${ext}`);
|
res.download(fontPath);
|
||||||
});
|
});
|
||||||
|
|
||||||
// -- We don't want to serve sessions for static resources
|
// -- We don't want to serve sessions for static resources
|
||||||
|
@ -8,6 +8,7 @@ import config from '../../../config/config';
|
|||||||
|
|
||||||
const router = new Router();
|
const router = new Router();
|
||||||
|
|
||||||
|
// 生成预览图
|
||||||
router.post('/get_pic', async (req, res, next) => {
|
router.post('/get_pic', async (req, res, next) => {
|
||||||
const body = req.body;
|
const body = req.body;
|
||||||
const opt = body.opt;
|
const opt = body.opt;
|
||||||
@ -47,4 +48,29 @@ router.post('/get_pic', async (req, res, next) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// 保存模板
|
||||||
|
router.post('/save_tpl', async (req, res, next) => {
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// 修改模板
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 删除模板
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 查询单个模板
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 获取模板列表
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
24
src/models/mp_share/Template.js
Normal file
24
src/models/mp_share/Template.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
'use strict';
|
||||||
|
import mongoose from 'mongoose';
|
||||||
|
|
||||||
|
const Schema = mongoose.Schema;
|
||||||
|
const ObjectId = Schema.Types.ObjectId;
|
||||||
|
/**
|
||||||
|
* 操作日志
|
||||||
|
*/
|
||||||
|
const OpLog = new mongoose.Schema({
|
||||||
|
// 游戏id
|
||||||
|
tpl_name: {type: String},
|
||||||
|
tpl_id: {type: String},
|
||||||
|
prev_url: {type: String},
|
||||||
|
base_style: {type: Object},
|
||||||
|
views: [{type: Object}],
|
||||||
|
comment: {type: String},
|
||||||
|
createdBy: {type: String}
|
||||||
|
}, {
|
||||||
|
collection: 'template',
|
||||||
|
timestamps: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default mongoose.model('Template', Template);
|
||||||
|
|
@ -101,7 +101,6 @@ function _drawBg(ctx, info) {
|
|||||||
ctx.fillStyle = bg
|
ctx.fillStyle = bg
|
||||||
ctx.fillRect(0, 0, w, h)
|
ctx.fillRect(0, 0, w, h)
|
||||||
}
|
}
|
||||||
// TODO: 渐变填充
|
|
||||||
ctx.restore()
|
ctx.restore()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user