|
@@ -64,7 +64,7 @@ module.exports = app => {
|
|
|
};
|
|
|
await this.layout('sp_setting/category.ejs', renderData, 'sp_setting/category_modal.ejs');
|
|
|
} catch (error) {
|
|
|
- console.log(error);
|
|
|
+ ctx.log(error);
|
|
|
ctx.redirect(`/sp/${ctx.subProject.id}/dashboard`);
|
|
|
}
|
|
|
}
|
|
@@ -89,7 +89,7 @@ module.exports = app => {
|
|
|
responseData.data = await ctx.service.category.addCategory(ctx.subProject, data.name, settingConst.cType.key.dropDown);
|
|
|
ctx.body = responseData;
|
|
|
} catch (err) {
|
|
|
- this.log(err);
|
|
|
+ ctx.log(err);
|
|
|
ctx.body = {err: 1, msg: err.toString(), data: null};
|
|
|
}
|
|
|
}
|
|
@@ -124,7 +124,7 @@ module.exports = app => {
|
|
|
|
|
|
ctx.body = responseData;
|
|
|
} catch (err) {
|
|
|
- this.log(err);
|
|
|
+ ctx.log(err);
|
|
|
ctx.body = {err: 1, msg: err.toString(), data: null};
|
|
|
}
|
|
|
}
|
|
@@ -145,7 +145,7 @@ module.exports = app => {
|
|
|
|
|
|
ctx.body = responseData;
|
|
|
} catch (err) {
|
|
|
- this.log(err);
|
|
|
+ ctx.log(err);
|
|
|
ctx.body = {err: 1, msg: err instanceof String ? err : '提交数据失败', data: null};
|
|
|
}
|
|
|
}
|
|
@@ -171,7 +171,7 @@ module.exports = app => {
|
|
|
|
|
|
ctx.body = responseData;
|
|
|
} catch (err) {
|
|
|
- this.log(err);
|
|
|
+ ctx.log(err);
|
|
|
ctx.body = {err: 1, msg: err.toString(), data: null};
|
|
|
}
|
|
|
}
|
|
@@ -193,7 +193,7 @@ module.exports = app => {
|
|
|
responseData.data = await ctx.service.category.getAllCategory(ctx.subProject);
|
|
|
ctx.body = responseData;
|
|
|
} catch (err) {
|
|
|
- this.log(err);
|
|
|
+ ctx.log(err);
|
|
|
ctx.body = {err: 1, msg: err.toString(), data: null};
|
|
|
}
|
|
|
}
|
|
@@ -261,7 +261,7 @@ module.exports = app => {
|
|
|
};
|
|
|
await this.layout('sp_setting/user.ejs', renderData, 'sp_setting/user_modal.ejs');
|
|
|
} catch (error) {
|
|
|
- console.log(error);
|
|
|
+ ctx.log(error);
|
|
|
ctx.redirect(`/sp/${ctx.subProject.id}/dashboard`);
|
|
|
}
|
|
|
}
|
|
@@ -294,6 +294,7 @@ module.exports = app => {
|
|
|
}).filter(x => { return x.groupList.length > 0; });
|
|
|
const renderData = {
|
|
|
ptype: ctx.query.ptype,
|
|
|
+ ptypeStr: permissionConst[ctx.query.ptype].title,
|
|
|
accountGroup,
|
|
|
subProjectAccountList,
|
|
|
subProjectAllAccountList,
|
|
@@ -305,7 +306,7 @@ module.exports = app => {
|
|
|
};
|
|
|
await this.layout('sp_setting/permission.ejs', renderData, 'sp_setting/user_modal.ejs');
|
|
|
} catch (error) {
|
|
|
- console.log(error);
|
|
|
+ ctx.log(error);
|
|
|
ctx.redirect(`/sp/${ctx.subProject.id}/dashboard`);
|
|
|
}
|
|
|
}
|
|
@@ -336,7 +337,7 @@ module.exports = app => {
|
|
|
};
|
|
|
await this.layout('sp_setting/logs.ejs', renderData);
|
|
|
} catch (error) {
|
|
|
- console.log(error);
|
|
|
+ ctx.log(error);
|
|
|
ctx.redirect(`/sp/${ctx.subProject.id}/dashboard`);
|
|
|
}
|
|
|
}
|
|
@@ -353,7 +354,7 @@ module.exports = app => {
|
|
|
funSet: fun_set,
|
|
|
}, 'sp_setting/fun_modal.ejs');
|
|
|
} catch (error) {
|
|
|
- ctx.helper.log(error);
|
|
|
+ ctx.log(error);
|
|
|
ctx.redirect(`/sp/${ctx.subProject.id}/dashboard`);
|
|
|
}
|
|
|
}
|
|
@@ -395,7 +396,7 @@ module.exports = app => {
|
|
|
|
|
|
ctx.body = {err: 0, msg: '', data: null};
|
|
|
} catch (error) {
|
|
|
- ctx.helper.log(error);
|
|
|
+ ctx.log(error);
|
|
|
this.ajaxErrorBody(error, '保存数据失败');
|
|
|
}
|
|
|
}
|
|
@@ -439,7 +440,7 @@ module.exports = app => {
|
|
|
}
|
|
|
await this.layout('sp_setting/datacollect.ejs', renderData, 'sp_setting/datacollect_modal.ejs');
|
|
|
} catch (error) {
|
|
|
- ctx.helper.log(error);
|
|
|
+ ctx.log(error);
|
|
|
ctx.session.postError = error.toString();
|
|
|
ctx.redirect(`/sp/${ctx.subProject.id}/dashboard`);
|
|
|
}
|
|
@@ -528,7 +529,7 @@ module.exports = app => {
|
|
|
}
|
|
|
ctx.body = responseData;
|
|
|
} catch (err) {
|
|
|
- this.log(err);
|
|
|
+ ctx.log(err);
|
|
|
ctx.body = {err: 1, msg: err.toString(), data: null};
|
|
|
}
|
|
|
}
|
|
@@ -587,7 +588,7 @@ module.exports = app => {
|
|
|
renderData.selfCategoryLevel = await this.ctx.service.projectAccount.getSelfCategoryLevel(this.ctx.session.sessionUser.accountId);
|
|
|
await this.layout('sp_setting/manage.ejs', renderData, 'sp_setting/manage_modal.ejs');
|
|
|
} catch (error) {
|
|
|
- ctx.helper.log(error);
|
|
|
+ ctx.log(error);
|
|
|
ctx.redirect(`/sp/${ctx.subProject.id}/dashboard`);
|
|
|
}
|
|
|
}
|
|
@@ -671,7 +672,7 @@ module.exports = app => {
|
|
|
}
|
|
|
ctx.body = responseData;
|
|
|
} catch (err) {
|
|
|
- this.log(err);
|
|
|
+ ctx.log(err);
|
|
|
ctx.body = { err: 1, msg: err.toString(), data: null };
|
|
|
}
|
|
|
}
|