...
|
...
|
@@ -4,20 +4,28 @@ const api = global.yoho.API; |
|
|
const crypto = global.yoho.crypto;
|
|
|
const PASSWORD = 'yoho9646yoho9646';
|
|
|
|
|
|
exports.getQr = (params) => {
|
|
|
let uid = '';
|
|
|
class qrcodeModel extends global.yoho.BaseModel {
|
|
|
constructor(ctx) {
|
|
|
super(ctx);
|
|
|
}
|
|
|
|
|
|
getQr(params) {
|
|
|
let uid = '';
|
|
|
|
|
|
try {
|
|
|
uid = crypto.decrypt(PASSWORD, decodeURIComponent(params.token));
|
|
|
uid = parseInt(uid, 10);
|
|
|
} catch (e) {
|
|
|
uid = params.token;
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
uid = crypto.decrypt(PASSWORD, decodeURIComponent(params.token));
|
|
|
uid = parseInt(uid, 10);
|
|
|
} catch (e) {
|
|
|
uid = params.token;
|
|
|
return api.get('', {
|
|
|
method: 'app.twoDimen.getCode',
|
|
|
uid: uid,
|
|
|
}).then(result => {
|
|
|
return (result && result.data && result.data.code) || '';
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return api.get('', {
|
|
|
method: 'app.twoDimen.getCode',
|
|
|
uid: uid,
|
|
|
}).then(result => {
|
|
|
return (result && result.data && result.data.code) || '';
|
|
|
});
|
|
|
}; |
|
|
module.exports = qrcodeModel; |
...
|
...
|
|