|
|
|
@ -1,7 +1,11 @@
|
|
|
|
|
package com.dsideal.QingLong.Base.Model;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
|
|
import com.dsideal.QingLong.Handler.RepeatIntercetpor;
|
|
|
|
|
import com.dsideal.QingLong.Interceptor.EmptyInterface;
|
|
|
|
|
import com.dsideal.QingLong.Interceptor.IsLoginInterface;
|
|
|
|
|
import com.dsideal.QingLong.Interceptor.IsNumericInterface;
|
|
|
|
|
import com.dsideal.QingLong.Interceptor.IsSysAdminInterface;
|
|
|
|
|
import com.dsideal.QingLong.LoginPerson.Model.LoginPersonModel;
|
|
|
|
|
import com.jfinal.aop.Before;
|
|
|
|
|
import com.jfinal.ext.interceptor.GET;
|
|
|
|
@ -562,8 +566,8 @@ public class BaseModel {
|
|
|
|
|
Page<Record> list = Db.paginate(page, limit, sqlPara);
|
|
|
|
|
for (Record record : list.getList()) {
|
|
|
|
|
record.set("flag", flag);
|
|
|
|
|
if(StrKit.isBlank(record.getStr("area_name"))){
|
|
|
|
|
record.set("area_name","市直");
|
|
|
|
|
if (StrKit.isBlank(record.getStr("area_name"))) {
|
|
|
|
|
record.set("area_name", "市直");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return list;
|
|
|
|
@ -601,4 +605,72 @@ public class BaseModel {
|
|
|
|
|
}
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:增加一个统一认证登录的系统
|
|
|
|
|
*
|
|
|
|
|
* @param system_name
|
|
|
|
|
* @param redirect_url
|
|
|
|
|
*/
|
|
|
|
|
public boolean addSsoSystem(String system_name, String redirect_url) {
|
|
|
|
|
//1、检查是不是系统回调地址与现有的回调地址重复
|
|
|
|
|
if (checkRedirectUrlCongFu(-1, redirect_url)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
//2、不重复则保存
|
|
|
|
|
Record record = new Record();
|
|
|
|
|
record.set("system_name", system_name);
|
|
|
|
|
record.set("redirect_url", redirect_url);
|
|
|
|
|
record.set("b_use", 1);
|
|
|
|
|
Db.save("t_sso_system", "system_id", record);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:检查回调地址是否重复
|
|
|
|
|
*
|
|
|
|
|
* @param system_id
|
|
|
|
|
* @param redirect_url
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public boolean checkRedirectUrlCongFu(int system_id, String redirect_url) {
|
|
|
|
|
String sql = "select count(1) as c from t_sso_system where redirect_url=? and system_id<>?";
|
|
|
|
|
int c = Db.findFirst(sql, redirect_url, system_id).getInt("c");
|
|
|
|
|
return c > 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:删除一个统一认证登录的系统
|
|
|
|
|
*/
|
|
|
|
|
public void delSsoSystem(int system_id) {
|
|
|
|
|
Db.deleteById("t_sso_system", "system_id", system_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:修改一个统一认证系统
|
|
|
|
|
*/
|
|
|
|
|
public boolean updateSsoSystem(int system_id, String system_name, String redirect_url, int b_use) {
|
|
|
|
|
//1、检查是不是系统回调地址与现有的回调地址重复
|
|
|
|
|
if (checkRedirectUrlCongFu(system_id, redirect_url)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
//2、不重复则保存
|
|
|
|
|
Record record = Db.findById("t_sso_system", "system_id", system_id);
|
|
|
|
|
record.set("system_name", system_name);
|
|
|
|
|
record.set("redirect_url", redirect_url);
|
|
|
|
|
record.set("b_use", b_use);
|
|
|
|
|
Db.update("t_sso_system", record);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 功能:获取统一认证系统列表
|
|
|
|
|
*
|
|
|
|
|
* @param page
|
|
|
|
|
* @param limit
|
|
|
|
|
*/
|
|
|
|
|
public Page<Record> listSsoSystem(int page, int limit) {
|
|
|
|
|
String sql = " from t_sso_system order by system_id";
|
|
|
|
|
return Db.paginate(page, limit, "select *", sql);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|