Commit e9c714ff authored by 李尚科's avatar 李尚科

fix

parent dd401208
Pipeline #16589 passed with stage
in 48 seconds
...@@ -432,6 +432,25 @@ module.exports = { ...@@ -432,6 +432,25 @@ module.exports = {
formatUrl = baseUrl + '/' + url; formatUrl = baseUrl + '/' + url;
} }
return formatUrl; return formatUrl;
},
decodeUserSid(code) {
const rand = 'OU1WjLvZCrRJ7Yo0gE2XDjuuaSAUuaH1bhHPuMymcdfEeKz0igRhXQkMuLTm1';
const begin = code.slice(0, 1);
let rtn = '';
const codelen = rand.slice(0, 11);
const codenums = rand.slice(11, 23);
let len = codelen.indexOf(begin);
if (len > -1) {
len++;
const arrnums = code.slice(-len).split('');
for (const v of arrnums) {
rtn += String(codenums.indexOf(v));
}
}
return parseInt(rtn) >> 2;
} }
}; };
...@@ -30,6 +30,7 @@ class UserService extends Service { ...@@ -30,6 +30,7 @@ class UserService extends Service {
} }
} }
//根据主键查找用户信息 //根据主键查找用户信息
userSid = isNaN(userSid) ? ctx.helper.decodeUserSid(userSid) : userSid;
let filter = { where: { sid: userSid } }; let filter = { where: { sid: userSid } };
let userInfo = await ctx.gjjModel.SysUser.one(filter); let userInfo = await ctx.gjjModel.SysUser.one(filter);
ctx.logger.info('get_phone_by_user_sid:' + JSON.stringify(userInfo)); ctx.logger.info('get_phone_by_user_sid:' + JSON.stringify(userInfo));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment