Authored by huangyi

领券

... ... @@ -147,6 +147,24 @@ const couponController = {
next;
}
},
downloadTpl(req, res) {
let conf = {
name: 'mysheet',
cols: [
{
caption: 'couponNo',
type: 'String'
}
],
rows: []
};
let exportFile = excelExport.execute(conf);
res.setHeader('Content-Type', 'application/vnd.openxmlformats');
res.setHeader('Content-Disposition', 'attachment; filename=couponNoTpl.xlsx');
res.end(exportFile, 'binary');
},
downloadNoList(req, res, next) {
const couponId = req.query.id;
... ...
... ... @@ -67,6 +67,7 @@ router.post('/api/coupon/modify', coupon.modifyCoupon);
router.post('/api/coupon/batchAddNo', mutilpartMiddleware, coupon.loadCouponNoList);
router.get('/api/coupon/downloadNo', coupon.downloadNoList);
router.get('/api/coupon/delete', coupon.deleteCoupon);
router.get('/api/coupon/downloadTpl', coupon.downloadTpl);
// 用户管理[ajax]
router.post('/api/user/delete', user.deleteUser);
... ...
... ... @@ -6,6 +6,7 @@
<div class="x_panel">
<div class="x_title">
<a href="/admin/coupon/option" class="btn btn-primary">创建券</a>
<a href="/admin/api/coupon/downloadTpl" class="btn btn-primary">下载导入券码模版</a>
<div class="btn-group" style="vertical-align: top">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span id="dropdown-toggle-txt">全部 </span> <span class="caret"></span>
... ...
... ... @@ -73,9 +73,9 @@ module.exports = {
},
redis: {
connect: {
// host: '127.0.0.1',
host: '127.0.0.1',
host: '192.168.102.49',
//host: '192.168.102.49',
port: '6379',
enable_offline_queue: false,
retry_strategy(options) {
... ... @@ -95,10 +95,10 @@ module.exports = {
},
mysql: {
connect: {
host: 'localhost',
host: '0.0.0.0',
port: '3306',
user: 'root',
password: ''
password: '123456'
},
database: 'yoho_activity_platform',
},
... ... @@ -192,10 +192,10 @@ if (isProduction) {
useCache: true,
mysql: {
connect: {
host: 'localhost',
host: '0.0.0.0',
port: '3306',
user: 'root',
password: ''
password: '123456'
},
database: 'yoho_activity_platform',
}
... ...