|
@@ -9,8 +9,10 @@ import org.apache.shiro.SecurityUtils;
|
|
import org.jeecg.common.api.dto.message.TemplateMessageDTO;
|
|
import org.jeecg.common.api.dto.message.TemplateMessageDTO;
|
|
import org.jeecg.common.config.mqtoken.UserTokenContext;
|
|
import org.jeecg.common.config.mqtoken.UserTokenContext;
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
|
|
+import org.jeecg.common.system.query.QueryGenerator;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
import org.jeecg.common.util.RedisUtil;
|
|
import org.jeecg.common.util.RedisUtil;
|
|
|
|
+import org.jeecg.common.util.oConvertUtils;
|
|
import org.jeecg.modules.base.service.BaseCommonService;
|
|
import org.jeecg.modules.base.service.BaseCommonService;
|
|
import org.jeecg.modules.client.AppManage.WorkFlowClient;
|
|
import org.jeecg.modules.client.AppManage.WorkFlowClient;
|
|
import org.jeecg.modules.system.controller.SysUserController;
|
|
import org.jeecg.modules.system.controller.SysUserController;
|
|
@@ -651,6 +653,29 @@ public class AppmanageServiceImpl implements AppmanageService {
|
|
return loginUser.getId().equals(baseInfo.getAdmin());
|
|
return loginUser.getId().equals(baseInfo.getAdmin());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public List<AppBaseInfo> appList() {
|
|
|
|
+ String sql = QueryGenerator.installAuthJdbc(AppBaseInfo.class);
|
|
|
|
+ LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
+ Boolean isAdmin = loginUser.getUsername().equals("admin");
|
|
|
|
+ if (isAdmin) return baseInfoMapper.appList("");
|
|
|
|
+ if (oConvertUtils.isNotEmpty(sql)){
|
|
|
|
+ //对sql进行处理避免注入
|
|
|
|
+ if (sql.startsWith(" and id in (")&& sql.endsWith(")")){
|
|
|
|
+ StringBuilder inSql = new StringBuilder("AND id IN (");
|
|
|
|
+ String inClause = sql.substring(" and id in (".length(), sql.length() - 1);
|
|
|
|
+ List<String> ids = Arrays.asList(inClause.split(","));
|
|
|
|
+ if (!ids.isEmpty()){
|
|
|
|
+ ids.forEach(id -> inSql.append(id).append(","));
|
|
|
|
+ inSql.deleteCharAt(inSql.length() - 1);
|
|
|
|
+ }else inSql.append(inClause);
|
|
|
|
+ inSql .append(") ");
|
|
|
|
+ return baseInfoMapper.appList(inSql.toString());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return new ArrayList<>();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
// 应用审核通过后一系列创建应用一级菜单、默认角色、授权操作(完整注册时)
|
|
// 应用审核通过后一系列创建应用一级菜单、默认角色、授权操作(完整注册时)
|
|
public void afterAppCheckPass(String appid) {
|
|
public void afterAppCheckPass(String appid) {
|