1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

创建新的小程序,进出码,体温上报功能迁移基本完成

This commit is contained in:
2023-03-17 04:55:02 +08:00
parent 5b98be9bf9
commit b7bf3bfc15
88 changed files with 4337 additions and 276 deletions

View File

@@ -0,0 +1,29 @@
const ENUM = require('./const.js');
function getUserGroupByRole(userRole) {
const role = ENUM.user.role;
userRole = Number(userRole);
let userGroupDict = {
'visitor': [
role.VISITOR,
].includes(userRole),
'user': [
role.RESIDENTS_OWNER,
role.RESIDENTS_MEMBER,
role.RESIDENTS_TENENT,
].includes(userRole),
'admin': [
role.ADMIN,
role.STAFF,
].includes(userRole)
}
console.log("userGroupDict", userGroupDict, userRole, role)
for (let userGroup of Object.keys(userGroupDict)) {
if (userGroupDict[userGroup]) {
return userGroup;
}
}
return 'unknown';
}
module.exports = getUserGroupByRole;