...
|
...
|
@@ -17,19 +17,30 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
|
|
|
gen(id) {
|
|
|
if (id) {
|
|
|
let qsstr = qs.stringify({
|
|
|
let params = {
|
|
|
udid: id,
|
|
|
fromPage: PAGE,
|
|
|
client_type: config.app,
|
|
|
app_version: config.appVersion
|
|
|
});
|
|
|
};
|
|
|
const headers = {};
|
|
|
|
|
|
if (!global.isProduction && config.yohoVerifyUdid) {
|
|
|
params.udid = global.yoho.verify.udid;
|
|
|
params = global.yoho.sign.apiSign(params);
|
|
|
const verifySign = global.yoho.verify ? global.yoho.verify.sign(params) : '';
|
|
|
|
|
|
return Promise.resolve({
|
|
|
headers['x-yoho-verify'] = verifySign;
|
|
|
}
|
|
|
const result = {
|
|
|
code: 200,
|
|
|
data: {
|
|
|
url: `${apiUrl}passport/img-check?${qsstr}`
|
|
|
}
|
|
|
});
|
|
|
url: `${apiUrl}passport/img-check?${qs.stringify(params)}`
|
|
|
},
|
|
|
headers
|
|
|
};
|
|
|
|
|
|
return Promise.resolve(result);
|
|
|
} else {
|
|
|
return Promise.reject({
|
|
|
code: 400,
|
...
|
...
|
|