Browse Source

禁用成员禁止登录

dev
巴林闲侠 2 years ago
parent
commit
580d7a9998
  1. 1
      api/.vscode/launch.json
  2. 2
      api/app/lib/controllers/auth/index.js
  3. 4
      api/app/lib/controllers/organization/index.js

1
api/.vscode/launch.json

@ -29,6 +29,7 @@
// "--qndmn http://resources.anxinyun.cn", // "--qndmn http://resources.anxinyun.cn",
"--qndmn http://rhvqdivo5.hn-bkt.clouddn.com", "--qndmn http://rhvqdivo5.hn-bkt.clouddn.com",
"--clickHouseUrl http://10.8.30.71", "--clickHouseUrl http://10.8.30.71",
// "--clickHouseUrl https://clickhouse01.anxinyun.cn/play",
"--clickHousePort 30123", "--clickHousePort 30123",
"--clickHouseAnxincloud anxinyun", "--clickHouseAnxincloud anxinyun",
"--clickHousePepEmis pepca", "--clickHousePepEmis pepca",

2
api/app/lib/controllers/auth/index.js

@ -29,7 +29,7 @@ async function login (ctx, next) {
if (!pomsRegisterRes) { if (!pomsRegisterRes) {
throw '你还不是飞尚运维中台成员,请联系管理员添加权限' throw '你还不是飞尚运维中台成员,请联系管理员添加权限'
} else if ( } else if (
pomsRegisterRes.disable && (!pomsRegisterRes.role || !pomsRegisterRes.role.includes('admin')) pomsRegisterRes.disabled && !pomsRegisterRes.role.includes('admin')
) { ) {
throw '当前账号已禁用' throw '当前账号已禁用'
} }

4
api/app/lib/controllers/organization/index.js

@ -29,14 +29,14 @@ async function allDeps (ctx) {
async function editUser (ctx) { async function editUser (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { pepUserId, role = [], correlationProject = [] } = ctx.request.body const { pomsUserId, pepUserId, role = [], correlationProject = [] } = ctx.request.body
const existUserRes = await models.User.findOne({ const existUserRes = await models.User.findOne({
where: { where: {
pepUserId pepUserId
} }
}) })
if (existUserRes && !existUserRes.deleted && !pepUserId) { if (existUserRes && !existUserRes.deleted && !pomsUserId) {
// 新增已存在未删除 // 新增已存在未删除
throw '人员账号已添加' throw '人员账号已添加'
} }

Loading…
Cancel
Save