|
|
'use strict';
|
|
|
|
|
|
const crypto = global.yoho.crypto;
|
|
|
const model = require('../models/myqrcode');
|
|
|
|
|
|
exports.index = (req, res, next) => {
|
|
|
let params = req.query;
|
|
|
params.token = crypto.encryption('yoho9646yoho9646', JSON.stringify({
|
|
|
tk: params.token,
|
|
|
ct: Math.floor(Date.now()/1000),
|
|
|
}));
|
|
|
console.log(params.token);
|
|
|
console.log(crypto.decrypt('yoho9646yoho9646', params.token));
|
|
|
|
|
|
res.render('myqrcode', {
|
|
|
title: '查看二维码',
|
|
|
module: 'home',
|
|
|
page: 'myqrcode',
|
|
|
isPassportPage: true,
|
|
|
data: params,
|
|
|
});
|
|
|
model.getQr({
|
|
|
token: params.token,
|
|
|
}).then(result => {
|
|
|
params.token = result;
|
|
|
res.render('myqrcode', {
|
|
|
title: '查看二维码',
|
|
|
module: 'home',
|
|
|
page: 'myqrcode',
|
|
|
isPassportPage: true,
|
|
|
data: params,
|
|
|
});
|
|
|
}).catch(next);
|
|
|
}; |
...
|
...
|
|