Authored by 陈峰

Merge branch 'hotfix/fix-appSecret' into 'master'

Hotfix/fix app secret



See merge request !94
... ... @@ -7,10 +7,10 @@ const xlsx = require('xlsx');
const mail = require('nodemailer');
const moment = require('moment');
const smtpTransport = require('nodemailer-smtp-transport');
const depart_names = ['创意', '活动', '技术', '零售', '媒体', '品牌', '上游资源', '市场会员', '运维', '战略发展'];
const depart_names = ['活动', '技术', '零售', '媒体', '品牌', '上游资源', '市场会员', '运维', '战略发展'];
const ActivityModel = require('../../admin/models/activity');
let results = [[], [], [], [], [], [], [], [], [], []];
let results = [[], [], [], [], [], [], [], [], []];
let loadExcel = function(path) {
let workbook = xlsx.readFile(path);
... ... @@ -76,9 +76,9 @@ const excelLoader = {
* @returns {Promise.<T>|*}
*/
excelToXml(req, res, next) {
return loadExcel('public/docs/user.xlsx').then(ret => {
return loadExcel('public/docs/users2019.xlsx').then(ret => {
_.each(ret, item => {
let depart_1 = item.depart_1; // 第一级部门
let depart_1 = item.block; // 第一级部门
for (let i = 0; i < depart_names.length; i++) { // 按部门归入相应的数组
if (depart_1.indexOf(depart_names[i]) >= 0) {
... ... @@ -92,7 +92,8 @@ const excelLoader = {
'\t<data>\n';
_.each(results, item_arr => {
let xml_dep_f = '\t\t<department depid="0" name="' + item_arr[0].depart_1 +
console.log(item_arr.length);
let xml_dep_f = '\t\t<department depid="0" name="' + item_arr[0].block +
'" total="' + item_arr.length + '" prizes="0">\n';
let xml_person = '';
... ... @@ -101,14 +102,14 @@ const excelLoader = {
let xml_person_e = '\t\t\t</person>\n';
let depart_arr = [];
if (item.depart_1) {
depart_arr.push(item.depart_1);
if (item.block) {
depart_arr.push(item.block);
}
if (item.depart_2) {
depart_arr.push(item.depart_2);
if (item.center) {
depart_arr.push(item.center);
}
if (item.depart_3) {
depart_arr.push(item.depart_3);
if (item.depart) {
depart_arr.push(item.depart.replace(/\d/g, ''));
}
if (item.depart_4) {
depart_arr.push(item.depart_4);
... ... @@ -125,7 +126,6 @@ const excelLoader = {
'\t\t\t\t<level>0</level>\n';
xml_person += xml_person_f + xml_person_content + xml_person_e;
});
let xml_dep_e = '\t\t</department>\n';
... ... @@ -140,7 +140,7 @@ const excelLoader = {
},
getExcelData(req, res) {
console.log(req);
return loadExcel('public/docs/user.xlsx').then(ret => {
return loadExcel('public/docs/users2019.xlsx').then(ret => {
res.json(ret);
});
},
... ...
... ... @@ -147,7 +147,6 @@ class ActWheelSurfModelRedis extends global.yoho.BaseModel {
async goPrize(obj) {
try {
// 校验有效活动时间
// 兼容线上活动
if (+obj.act_id !== 44) {
try {
... ...
... ... @@ -27,7 +27,8 @@ router.post('/prize/getNewPrize', prize.getNewPrize);
router.post('/prize/updatePrize', prize.updatePrize);
router.post('/info/saveUserInfo', prize.saveUserInfo);
// router.get('/excel/xml', excel.excelToXml);
router.get('/excel/xml', excel.excelToXml);
// router.get('/excel/sendMail', excel.sendMail);
router.get('/excel/load', excel.getExcelData);
router.get('/excel/loady100', excel.getY100Data);
... ...
... ... @@ -608,9 +608,6 @@ const article = {
const voteCase = req.body.vcase || 0;
let vote_num = 1;
console.log(actId, articleId);
let vote = function() {
if (voteCase) {
vote_num = 1 + Math.floor(Math.random() * 3);
... ...
... ... @@ -40,6 +40,7 @@ module.exports = {
corsAllowOrigin: [
'http://localhost:8081',
'http://localhost:8888',
'http://localhost:8080',
'http://localhost:1234',
'http://localhost:63342',
'http://huodong.yoho.cn',
... ... @@ -127,7 +128,7 @@ module.exports = {
yohoSecret: '3bd815162342d9733f06ab6811082c64',
wechat: {
appID: 'wx1fe49f08f41b6c26', // jsapi 用
appSecret: '1360c4a89275e1a4a4bbc8f6c5e44587',
appSecret: '9c2c0b889337f96e53350149f5985497',
token: 'weixin',
prefix: 'https://api.weixin.qq.com/cgi-bin/',
mpPrefix: 'https://api.weixin.qq.com/cgi-bin/',
... ... @@ -135,6 +136,9 @@ module.exports = {
wechatLogin: {
appID: 'wxb785b12717bc31e9',
appSecret: 'fb0bc348577b1e38576c6fe654da5135',
token: 'weixin',
prefix: 'https://api.weixin.qq.com/cgi-bin/',
mpPrefix: 'https://api.weixin.qq.com/cgi-bin/',
}
};
... ...
No preview for this file type