|
@@ -177,9 +177,10 @@ module.exports = app => {
|
|
|
throw '用户名或密码错误';
|
|
|
}
|
|
|
|
|
|
+ // 查找项目数据
|
|
|
+ const projectData = await this.ctx.service.project.getProjectByCode(ctx.request.body.project.toString().trim());
|
|
|
+ const subProject = await ctx.service.subProject.getAllDataByCondition({ where: {project_id: projectData.id}});
|
|
|
if (result === 2) {
|
|
|
- // 查找项目数据
|
|
|
- const projectData = await this.ctx.service.project.getProjectByCode(ctx.request.body.project.toString().trim());
|
|
|
// 判断是否有设置停用提示,有则展示
|
|
|
const msg = await ctx.service.projectStopmsg.getMsg(projectData.id);
|
|
|
throw msg;
|
|
@@ -190,7 +191,7 @@ module.exports = app => {
|
|
|
|
|
|
// 判断是否已经有对应用户信息,没有则跳转初始化页面
|
|
|
const needBoot = await ctx.service.customer.isNeedBoot(ctx.request.body);
|
|
|
- const url = needBoot ? '/boot' : '/dashboard';
|
|
|
+ const url = needBoot ? '/boot' : (subProject && subProject.length === 1 ? `/sp/${subProject[0].id}/dashboard` : '/dashboard');
|
|
|
|
|
|
const query = URL.parse(ctx.request.header.referer, true).query;
|
|
|
ctx.redirect(query.referer ? query.referer : url);
|