Authored by 毕凯

Merge branch 'feature/newQrcode' into 'release/6.1'

删除uid加密解密



See merge request !902
'use strict';
const _ = require('lodash');
const camelCase = global.yoho.camelCase;
const api = global.yoho.API;
const crypto = global.yoho.crypto;
const PASSWORD = 'yoho9646yoho9646';
class newQrcode extends global.yoho.BaseModel {
constructor(ctx) {
... ... @@ -38,20 +35,9 @@ class newQrcode extends global.yoho.BaseModel {
}
getToken(params) {
let uidNum = parseInt(params.uid, 10);
let token = uidNum ? crypto.encryption(PASSWORD, uidNum + '') : '';
let uid = '';
try {
uid = crypto.decrypt(PASSWORD, decodeURIComponent(token));
uid = parseInt(uid, 10);
} catch (e) {
uid = token;
}
return api.get('', {
method: 'app.twoDimen.getCode',
uid: uid,
uid: params.uid,
}).then(result => {
return (result && result.data && result.data.code) || '';
});
... ... @@ -66,7 +52,7 @@ class newQrcode extends global.yoho.BaseModel {
let resu = {};
if (_.get(result, '[0]data')) {
resu = camelCase(result[0].data);
resu = result[0].data;
}
if (_.get(result, '[1]data')) {
resu.trendWord = result[1].data.trendWord;
... ...
... ... @@ -2,8 +2,8 @@
<div class="qrcode-body">
<div class="toper">
<div class="user-pic">
<div class="avatar user-avatar"{{#if headIco}} style="background-image:url({{image2 headIco mode=2 h=100 w=100 q=90}})"{{/if}}></div>
<div class="level level-{{vipInfo/curLevel}}"></div>
<div class="avatar user-avatar"{{#if head_ico}} style="background-image:url({{image2 head_ico mode=2 h=100 w=100 q=90}})"{{/if}}></div>
<div class="level level-{{vip_info/cur_level}}"></div>
</div>
<div class="user-info">
<div class="name eps">{{nickname}}</div>
... ... @@ -23,7 +23,7 @@
</div>
</div>
<div class="qrcode-pic" data-qr="{{token}}">
<div class="qrcode-avatar user-avatar"{{#if headIco}} style="background-image:url({{image2 headIco mode=2 h=100 w=100 q=90}})"{{/if}}></div>
<div class="qrcode-avatar user-avatar"{{#if head_ico}} style="background-image:url({{image2 head_ico mode=2 h=100 w=100 q=90}})"{{/if}}></div>
</div>
<div class="invite hide">
<span>邀请好友扫一扫完成注册,现金券赚不停</span>
... ...