myqrcode.js
457 Bytes
'use strict';
const api = global.yoho.API;
const crypto = global.yoho.crypto;
exports.getQr = (params) => {
let uid = '';
try {
uid = crypto.decrypt(undefined, params.token);
} catch (e) {
console.error(e);
uid = params.token;
}
return api.get('', {
method: 'app.twoDimen.getCode',
uid: uid,
}).then(result => {
return (result && result.data && result.data.code) || '';
});
};