Commit 040c18cd by Sxy

fix: appcode

parent c80a3219
......@@ -28,6 +28,25 @@ module.exports = function (app) {
console.log(cooktoken)
let tv = cooktoken
let sourceUser = System.verify(tv, settings.publickey())
// { id: '5f8faf05787b88000a2e178b',
// name: '张华',
// employee: '5f8faf05787b88000a2e178c',
// phone: 'd1htypf8Sme3fvcXP20R+w==',
// orgid: '5bcfe95cb0a01f0009284bc3',
// roles: [ '员工', '资质宝业务员', '资质宝交付员' ],
// platform: '8cdf558c8645c7031f164dc23a55a28f',
// unionid: '',
// jti: 'gaBQQKKO6ZLNXNfA',
// exp: 1605083401,
// iat: 1604478601
// }
/**
* TODO:
* 1. 建立 磐农角色
* 2. 建立组织结构 获取 磐农组织结构路径
* 3. 获取角色id 设置
*/
let openid = sourceUser.employee
let userName = openid
let nickName = sourceUser.name
......@@ -90,8 +109,15 @@ module.exports = function (app) {
app.post("/entService/*", async function (req, res, next) {
try {
let channel;
const APPCODENUM = {
ali: "ali",
baidu: "baidu",
baiduqifu: "baidu",
zc360: "zc360",
pannong: "pannong"
}
const appcode = req.headers && req.headers.appcode;
let sourceHost = appcode || "aliCloud";
let sourceHost = APPCODENUM[appcode] || "ali";
if (sourceHost in channelCache) {
channel = channelCache[sourceHost];
} else {
......
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