From 8fb113172974841bc74ac70581e2af85b40fc68b Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Wed, 7 Jul 2021 15:27:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BD=91=E7=AB=99=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../loginappservice/LoginAppServiceImpl.java | 34 +++++++++++++++++++ .../route/traininginstitution/list.html | 22 +----------- 2 files changed, 35 insertions(+), 21 deletions(-) create mode 100644 src/main/java/cn/com/tenlion/service/loginappservice/LoginAppServiceImpl.java diff --git a/src/main/java/cn/com/tenlion/service/loginappservice/LoginAppServiceImpl.java b/src/main/java/cn/com/tenlion/service/loginappservice/LoginAppServiceImpl.java new file mode 100644 index 0000000..fb69e7b --- /dev/null +++ b/src/main/java/cn/com/tenlion/service/loginappservice/LoginAppServiceImpl.java @@ -0,0 +1,34 @@ +package cn.com.tenlion.service.loginappservice; + +import cn.com.tenlion.institutionmanagement.pojo.dtos.institution.InstitutionDTO; +import cn.com.tenlion.service.traininginstitutionuser.ITrainingInstitutionUserService; +import ink.wgink.common.base.DefaultBaseService; +import ink.wgink.interfaces.expand.login.ILoginAppHandlerService; +import ink.wgink.pojo.bos.LoginAppUser; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Primary; +import org.springframework.stereotype.Service; + +/** + * @author xwangs + * @create 2021-07-07 14:24 + * @description + */ +@Service +@Primary +public class LoginAppServiceImpl extends DefaultBaseService implements ILoginAppHandlerService { + + @Autowired + private ITrainingInstitutionUserService orgUserService; + + @Override + public void handle(LoginAppUser loginAppUser) throws Exception { + // 查询当前用户是否为机构用户 + // 如果是机构用户,则抛出异常 + InstitutionDTO orgInfo = orgUserService.getByUserId(loginAppUser.getUserId()); + if(orgInfo.getInstitutionId() != null + && !"".equals(orgInfo.getInstitutionId())){ + throw new Exception("机构用户请在首页选择机构登录进行登录"); + } + } +} diff --git a/src/main/resources/static/route/traininginstitution/list.html b/src/main/resources/static/route/traininginstitution/list.html index 0076228..693cf3d 100644 --- a/src/main/resources/static/route/traininginstitution/list.html +++ b/src/main/resources/static/route/traininginstitution/list.html @@ -91,27 +91,7 @@ [ {type:'checkbox', fixed: 'left'}, {field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '{{d.LAY_INDEX}}'}, - {field: 'institutionImage', width: 180, title: '机构图片', align:'center', - templet: function(row) { - var rowData = row[this.field]; - if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { - return '-'; - } - var value='