添加网站登录校验

This commit is contained in:
wans 2021-07-07 15:27:41 +08:00
parent c240d620b6
commit 8fb1131729
2 changed files with 35 additions and 21 deletions

View File

@ -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("机构用户请在首页选择机构登录进行登录");
}
}
}

View File

@ -91,27 +91,7 @@
[
{type:'checkbox', fixed: 'left'},
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
{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='<ul id="'+row['institutionId']+'">';
var datas = rowData.split(',');
for(var i = 0, item = datas[i]; item = datas[i++];) {
value += '<li><img style="height: 80px;width: 80px;" src="route/file/download/false/'+ item +'" alt="暂无"></li>';
}
value += '</ul>';
setTimeout(function() {
new Viewer(document.getElementById(row['institutionId']),{
loop:true
});
}, 50);
return value;
}
},
{field: 'institutionName', width: 180, title: '机构名称', align:'center',
{field: 'institutionName', width: 260, title: '机构名称', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {