明树Git Lab

Commit 76135aeb authored by zfp1's avatar zfp1

update

parent 7bcae37c
Pipeline #104367 passed with stage
in 3 seconds
...@@ -106,6 +106,9 @@ async function getRole(req, res, next) { ...@@ -106,6 +106,9 @@ async function getRole(req, res, next) {
} }
] ]
}); });
if(!ret) {
return res.sendError(errorMessage.resourceNotFound);
}
ret = ret.toJSON(); ret = ret.toJSON();
if(ret && ret.menus && ret.menus.length) { if(ret && ret.menus && ret.menus.length) {
// ret.menus = utils.buildTree(ret.menus); // ret.menus = utils.buildTree(ret.menus);
......
...@@ -56,10 +56,10 @@ async function login(req, res, next) { ...@@ -56,10 +56,10 @@ async function login(req, res, next) {
] ]
}); });
// console.log('this is user login', user) // console.log('this is user login', user)
user = user.toJSON();
if (!user) { if (!user) {
return res.sendError(errorMessage.loginError); return res.sendError(errorMessage.loginError);
} }
user = user.toJSON();
//判断删除状态 ,暂时不加 //判断删除状态 ,暂时不加
const check = utils.checkUserPassword({ const check = utils.checkUserPassword({
reqPw: password, reqPw: password,
......
...@@ -150,6 +150,9 @@ async function getProjectInfo({id}) { ...@@ -150,6 +150,9 @@ async function getProjectInfo({id}) {
], ],
// raw: true // raw: true
}); });
if(!project) {
return res.sendError(errorMessage.resourceNotFound);
}
project = project.toJSON(); project = project.toJSON();
project.projectXmtzzes = utils.buildTree2(project.projectXmtzzes, 'xh', 'parentXh'); project.projectXmtzzes = utils.buildTree2(project.projectXmtzzes, 'xh', 'parentXh');
......
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