Преглед изворни кода

feat:优化租户信息配置工具端、客户端单独配置

韩帛霖 пре 1 година
родитељ
комит
d4424f534e

+ 18 - 25
zkqy-admin/src/main/java/com/zkqy/web/controller/system/LoginPageConfigurationController.java

@@ -34,19 +34,17 @@ import com.zkqy.common.core.page.TableDataInfo;
 @RestController
 @RequestMapping("/system/configuration")
 @Api(value = "/system/configuration", description = "登录页面配置信息-接口")
-public class LoginPageConfigurationController extends BaseController
-{
+public class LoginPageConfigurationController extends BaseController {
     @Autowired
     private ILoginPageConfigurationService loginPageConfigurationService;
 
-/**
- * 查询登录页面配置信息列表
- */
-@PreAuthorize("@ss.hasPermi('system:configuration:list')")
-@GetMapping("/list")
-@ApiOperation(value = "查询登录页面配置信息列表")
-    public TableDataInfo list(LoginPageConfiguration loginPageConfiguration)
-    {
+    /**
+     * 查询登录页面配置信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:configuration:list')")
+    @GetMapping("/list")
+    @ApiOperation(value = "查询登录页面配置信息列表")
+    public TableDataInfo list(LoginPageConfiguration loginPageConfiguration) {
         startPage();
         List<LoginPageConfiguration> list = loginPageConfigurationService.selectLoginPageConfigurationList(loginPageConfiguration);
         return getDataTable(list);
@@ -59,8 +57,7 @@ public class LoginPageConfigurationController extends BaseController
     @Log(title = "登录页面配置信息", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     @ApiOperation(value = "导出登录页面配置信息列表")
-    public void export(HttpServletResponse response, LoginPageConfiguration loginPageConfiguration)
-    {
+    public void export(HttpServletResponse response, LoginPageConfiguration loginPageConfiguration) {
         List<LoginPageConfiguration> list = loginPageConfigurationService.selectLoginPageConfigurationList(loginPageConfiguration);
         ExcelUtil<LoginPageConfiguration> util = new ExcelUtil<LoginPageConfiguration>(LoginPageConfiguration.class);
         util.exportExcel(response, list, "登录页面配置信息数据");
@@ -70,20 +67,19 @@ public class LoginPageConfigurationController extends BaseController
      * 获取登录页面配置信息详细信息
      */
     @PreAuthorize("@ss.hasPermi('system:configuration:query')")
-    @GetMapping(value = "/{tenantId}")
+    @GetMapping(value = "getInfoByTenantId")
     @ApiOperation(value = "获取登录页面配置信息详细信息")
-    public AjaxResult getInfo(@PathVariable("tenantId") Long tenantId)
-    {
-        return success(loginPageConfigurationService.selectLoginPageConfigurationByTenantId(tenantId));
+    public AjaxResult getInfo(Long tenantId, String loginType) {
+        return success(loginPageConfigurationService.selectLoginPageConfigurationByTenantId(tenantId, loginType));
     }
 
     /**
      * 根据登录编号查询详细信息
      */
     @Anonymous
-    @GetMapping("/queryLoginPageConfigurationInfo/{loginPageNumber}")
-    public AjaxResult queryLoginPageConfigurationInfo(@PathVariable("loginPageNumber") String loginPageNumber){
-        return success(loginPageConfigurationService.selectLoginPageConfigurationByLoginPageNumber(loginPageNumber));
+    @GetMapping("/queryLoginPageConfigurationInfo")
+    public AjaxResult queryLoginPageConfigurationInfo(String loginPageNumber, String loginType) {
+        return success(loginPageConfigurationService.selectLoginPageConfigurationByLoginPageNumber(loginPageNumber, loginType));
     }
 
     /**
@@ -93,8 +89,7 @@ public class LoginPageConfigurationController extends BaseController
     @Log(title = "登录页面配置信息", businessType = BusinessType.INSERT)
     @PostMapping
     @ApiOperation(value = "新增登录页面配置信息")
-    public AjaxResult add(@RequestBody LoginPageConfiguration loginPageConfiguration)
-    {
+    public AjaxResult add(@RequestBody LoginPageConfiguration loginPageConfiguration) {
         return toAjax(loginPageConfigurationService.insertLoginPageConfiguration(loginPageConfiguration));
     }
 
@@ -105,8 +100,7 @@ public class LoginPageConfigurationController extends BaseController
     @Log(title = "登录页面配置信息", businessType = BusinessType.UPDATE)
     @PutMapping
     @ApiOperation(value = "修改登录页面配置信息")
-    public AjaxResult edit(@RequestBody LoginPageConfiguration loginPageConfiguration)
-    {
+    public AjaxResult edit(@RequestBody LoginPageConfiguration loginPageConfiguration) {
         return toAjax(loginPageConfigurationService.updateLoginPageConfiguration(loginPageConfiguration));
     }
 
@@ -117,8 +111,7 @@ public class LoginPageConfigurationController extends BaseController
     @Log(title = "登录页面配置信息", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     @ApiOperation(value = "删除登录页面配置信息")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(loginPageConfigurationService.deleteLoginPageConfigurationByIds(ids));
     }
 }

+ 1 - 1
zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysLoginController.java

@@ -122,7 +122,7 @@ public class SysLoginController {
     public AjaxResult isTenantExist(String tenantCode) {
         SysTenant sysTenantInfo = iSysTenantService.selectSysTenantByTenantCode(tenantCode);
         if (sysTenantInfo != null) {
-            sysTenantInfo.setLoginPageConfiguration(loginPageConfigurationService.selectLoginPageConfigurationByLoginPageNumber(tenantCode));
+            sysTenantInfo.setLoginPageConfiguration(loginPageConfigurationService.selectLoginPageConfigurationByLoginPageNumber(tenantCode, "tool"));
             return AjaxResult.success(sysTenantInfo);
         }
         return AjaxResult.error("租户不存在");

+ 2 - 1
zkqy-admin/src/main/java/com/zkqy/web/controller/system/SysTenantController.java

@@ -111,7 +111,8 @@ public class SysTenantController extends BaseController {
     @PutMapping
     public AjaxResult edit(@RequestBody SysTenant sysTenant) {
         // 校验租户编码是否唯一
-        if (!sysTenantService.selectSysTenantByTenantCode(sysTenant.getTenantCode()).getTenantId().equals(sysTenant.getTenantId())) {
+        SysTenant sysTenant1 = sysTenantService.selectSysTenantByTenantCode(sysTenant.getTenantCode());
+        if (sysTenant1 != null && !sysTenant1.getTenantId().equals(sysTenant.getTenantId())) {
             return AjaxResult.warn("修改租户失败,租户编码已存在");
         }
         return toAjax(sysTenantService.updateSysTenant(sysTenant));

+ 105 - 82
zkqy-system/src/main/java/com/zkqy/system/domain/LoginPageConfiguration.java

@@ -7,189 +7,212 @@ import com.zkqy.common.annotation.Excel;
 
 /**
  * 登录页面配置信息对象 login_page_configuration
- * 
+ *
  * @author zkqy
  * @date 2024-01-22
  */
-public class LoginPageConfiguration extends BaseEntity
-{
+public class LoginPageConfiguration extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 编号 */
+    /**
+     * 编号
+     */
     private Long id;
 
-    /** 登录页面编号 */
+    /**
+     * 登录页面编号
+     */
     @Excel(name = "登录页面编号")
     private String loginPageNumber;
 
-    /** 登录页面标题 */
+    /**
+     * 登录页面标题
+     */
     @Excel(name = "登录页面标题")
     private String loginPageTitle;
 
-    /** 登录页面描述 */
+    /**
+     * 登录页面描述
+     */
     @Excel(name = "登录页面描述")
     private String loginPageDescription;
 
-    /** 登录页面logo路径 */
+    /**
+     * 登录页面logo路径
+     */
     @Excel(name = "登录页面logo路径")
     private String loginPageLogo;
 
-    /** 登录页面背景图路径 */
+    /**
+     * 登录页面背景图路径
+     */
     @Excel(name = "登录页面背景图路径")
     private String loginPageBackgroundImage;
 
-    /** 窗口标题 */
+    /**
+     * 窗口标题
+     */
     @Excel(name = "窗口标题")
     private String windowTitle;
 
-    /** 窗口logo路径 */
+    /**
+     * 窗口logo路径
+     */
     @Excel(name = "窗口logo路径")
     private String windowLogo;
 
-    /** 租户编号 */
+    /**
+     * 租户编号
+     */
     @Excel(name = "租户编号")
     private Long tenantId;
 
-    /** 创建者ID */
+    /**
+     * 创建者ID
+     */
     @Excel(name = "创建者ID")
     private Long createById;
 
-    /** 更新者ID */
+    /**
+     * 更新者ID
+     */
     @Excel(name = "更新者ID")
     private Long updateById;
 
-    /** 删除标志(0:否;2:是) */
+    /**
+     * 配置页类型
+     */
+    private String loginType;
+
+    /**
+     * 删除标志(0:否;2:是)
+     */
     private String delFlag;
 
-    public void setId(Long id) 
-    {
+    public String getLoginType() {
+        return loginType;
+    }
+
+    public void setLoginType(String loginType) {
+        this.loginType = loginType;
+    }
+
+    public void setId(Long id) {
         this.id = id;
     }
 
-    public Long getId() 
-    {
+    public Long getId() {
         return id;
     }
-    public void setLoginPageNumber(String loginPageNumber) 
-    {
+
+    public void setLoginPageNumber(String loginPageNumber) {
         this.loginPageNumber = loginPageNumber;
     }
 
-    public String getLoginPageNumber() 
-    {
+    public String getLoginPageNumber() {
         return loginPageNumber;
     }
-    public void setLoginPageTitle(String loginPageTitle) 
-    {
+
+    public void setLoginPageTitle(String loginPageTitle) {
         this.loginPageTitle = loginPageTitle;
     }
 
-    public String getLoginPageTitle() 
-    {
+    public String getLoginPageTitle() {
         return loginPageTitle;
     }
-    public void setLoginPageDescription(String loginPageDescription) 
-    {
+
+    public void setLoginPageDescription(String loginPageDescription) {
         this.loginPageDescription = loginPageDescription;
     }
 
-    public String getLoginPageDescription() 
-    {
+    public String getLoginPageDescription() {
         return loginPageDescription;
     }
-    public void setLoginPageLogo(String loginPageLogo) 
-    {
+
+    public void setLoginPageLogo(String loginPageLogo) {
         this.loginPageLogo = loginPageLogo;
     }
 
-    public String getLoginPageLogo() 
-    {
+    public String getLoginPageLogo() {
         return loginPageLogo;
     }
-    public void setLoginPageBackgroundImage(String loginPageBackgroundImage) 
-    {
+
+    public void setLoginPageBackgroundImage(String loginPageBackgroundImage) {
         this.loginPageBackgroundImage = loginPageBackgroundImage;
     }
 
-    public String getLoginPageBackgroundImage() 
-    {
+    public String getLoginPageBackgroundImage() {
         return loginPageBackgroundImage;
     }
-    public void setWindowTitle(String windowTitle) 
-    {
+
+    public void setWindowTitle(String windowTitle) {
         this.windowTitle = windowTitle;
     }
 
-    public String getWindowTitle() 
-    {
+    public String getWindowTitle() {
         return windowTitle;
     }
-    public void setWindowLogo(String windowLogo) 
-    {
+
+    public void setWindowLogo(String windowLogo) {
         this.windowLogo = windowLogo;
     }
 
-    public String getWindowLogo() 
-    {
+    public String getWindowLogo() {
         return windowLogo;
     }
-    public void setTenantId(Long tenantId) 
-    {
+
+    public void setTenantId(Long tenantId) {
         this.tenantId = tenantId;
     }
 
-    public Long getTenantId() 
-    {
+    public Long getTenantId() {
         return tenantId;
     }
-    public void setCreateById(Long createById) 
-    {
+
+    public void setCreateById(Long createById) {
         this.createById = createById;
     }
 
-    public Long getCreateById() 
-    {
+    public Long getCreateById() {
         return createById;
     }
-    public void setUpdateById(Long updateById) 
-    {
+
+    public void setUpdateById(Long updateById) {
         this.updateById = updateById;
     }
 
-    public Long getUpdateById() 
-    {
+    public Long getUpdateById() {
         return updateById;
     }
-    public void setDelFlag(String delFlag) 
-    {
+
+    public void setDelFlag(String delFlag) {
         this.delFlag = delFlag;
     }
 
-    public String getDelFlag() 
-    {
+    public String getDelFlag() {
         return delFlag;
     }
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("loginPageNumber", getLoginPageNumber())
-            .append("loginPageTitle", getLoginPageTitle())
-            .append("loginPageDescription", getLoginPageDescription())
-            .append("loginPageLogo", getLoginPageLogo())
-            .append("loginPageBackgroundImage", getLoginPageBackgroundImage())
-            .append("windowTitle", getWindowTitle())
-            .append("windowLogo", getWindowLogo())
-            .append("tenantId", getTenantId())
-            .append("remark", getRemark())
-            .append("createBy", getCreateBy())
-            .append("createById", getCreateById())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateById", getUpdateById())
-            .append("updateTime", getUpdateTime())
-            .append("delFlag", getDelFlag())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("loginPageNumber", getLoginPageNumber())
+                .append("loginPageTitle", getLoginPageTitle())
+                .append("loginPageDescription", getLoginPageDescription())
+                .append("loginPageLogo", getLoginPageLogo())
+                .append("loginPageBackgroundImage", getLoginPageBackgroundImage())
+                .append("windowTitle", getWindowTitle())
+                .append("windowLogo", getWindowLogo())
+                .append("tenantId", getTenantId())
+                .append("remark", getRemark())
+                .append("createBy", getCreateBy())
+                .append("createById", getCreateById())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateById", getUpdateById())
+                .append("updateTime", getUpdateTime())
+                .append("delFlag", getDelFlag())
+                .toString();
     }
 }

+ 13 - 12
zkqy-system/src/main/java/com/zkqy/system/mapper/LoginPageConfigurationMapper.java

@@ -1,35 +1,37 @@
 package com.zkqy.system.mapper;
 
 import java.util.List;
+
 import com.zkqy.system.domain.LoginPageConfiguration;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 登录页面配置信息Mapper接口
- * 
+ *
  * @author zkqy
  * @date 2024-01-22
  */
-public interface LoginPageConfigurationMapper 
-{
+public interface LoginPageConfigurationMapper {
     /**
      * 查询登录页面配置信息
-     * 
+     *
      * @param tenantId 租户编号
      * @return 登录页面配置信息
      */
-    LoginPageConfiguration selectLoginPageConfigurationByTenantId(Long tenantId);
+    LoginPageConfiguration selectLoginPageConfigurationByTenantId(@Param("tenantId")Long tenantId, @Param("loginType") String loginType);
 
     /**
      * 查询登录页面配置信息
      *
      * @param loginPageNumber 登录页面配置信息编号
+     * @param loginType       登录类型
      * @return 登录页面配置信息
      */
-    LoginPageConfiguration selectLoginPageConfigurationByLoginPageNumber(String loginPageNumber);
+    LoginPageConfiguration selectLoginPageConfigurationByLoginPageNumber(@Param("loginPageNumber") String loginPageNumber, @Param("loginType") String loginType);
 
     /**
      * 查询登录页面配置信息列表
-     * 
+     *
      * @param loginPageConfiguration 登录页面配置信息
      * @return 登录页面配置信息集合
      */
@@ -37,7 +39,7 @@ public interface LoginPageConfigurationMapper
 
     /**
      * 新增登录页面配置信息
-     * 
+     *
      * @param loginPageConfiguration 登录页面配置信息
      * @return 结果
      */
@@ -45,7 +47,7 @@ public interface LoginPageConfigurationMapper
 
     /**
      * 修改登录页面配置信息
-     * 
+     *
      * @param loginPageConfiguration 登录页面配置信息
      * @return 结果
      */
@@ -53,7 +55,7 @@ public interface LoginPageConfigurationMapper
 
     /**
      * 删除登录页面配置信息
-     * 
+     *
      * @param id 登录页面配置信息主键
      * @return 结果
      */
@@ -61,12 +63,11 @@ public interface LoginPageConfigurationMapper
 
     /**
      * 批量删除登录页面配置信息
-     * 
+     *
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */
     int deleteLoginPageConfigurationByIds(Long[] ids);
 
 
-
 }

+ 12 - 11
zkqy-system/src/main/java/com/zkqy/system/service/ILoginPageConfigurationService.java

@@ -1,35 +1,36 @@
 package com.zkqy.system.service;
 
 import java.util.List;
+
 import com.zkqy.system.domain.LoginPageConfiguration;
 
 /**
  * 登录页面配置信息Service接口
- * 
+ *
  * @author zkqy
  * @date 2024-01-22
  */
-public interface ILoginPageConfigurationService 
-{
+public interface ILoginPageConfigurationService {
     /**
      * 查询登录页面配置信息
-     * 
+     *
      * @param tenantId 登录页面配置信息主键
      * @return 登录页面配置信息
      */
-    LoginPageConfiguration selectLoginPageConfigurationByTenantId(Long tenantId);
+    LoginPageConfiguration selectLoginPageConfigurationByTenantId(Long tenantId, String loginType);
 
     /**
      * 查询登录页面配置信息
      *
      * @param loginPageNumber 登录页面配置信息编号
+     * @param loginType       登录类型
      * @return 登录页面配置信息
      */
-    LoginPageConfiguration selectLoginPageConfigurationByLoginPageNumber(String loginPageNumber);
+    LoginPageConfiguration selectLoginPageConfigurationByLoginPageNumber(String loginPageNumber, String loginType);
 
     /**
      * 查询登录页面配置信息列表
-     * 
+     *
      * @param loginPageConfiguration 登录页面配置信息
      * @return 登录页面配置信息集合
      */
@@ -37,7 +38,7 @@ public interface ILoginPageConfigurationService
 
     /**
      * 新增登录页面配置信息
-     * 
+     *
      * @param loginPageConfiguration 登录页面配置信息
      * @return 结果
      */
@@ -45,7 +46,7 @@ public interface ILoginPageConfigurationService
 
     /**
      * 修改登录页面配置信息
-     * 
+     *
      * @param loginPageConfiguration 登录页面配置信息
      * @return 结果
      */
@@ -53,7 +54,7 @@ public interface ILoginPageConfigurationService
 
     /**
      * 批量删除登录页面配置信息
-     * 
+     *
      * @param ids 需要删除的登录页面配置信息主键集合
      * @return 结果
      */
@@ -61,7 +62,7 @@ public interface ILoginPageConfigurationService
 
     /**
      * 删除登录页面配置信息信息
-     * 
+     *
      * @param id 登录页面配置信息主键
      * @return 结果
      */

+ 18 - 24
zkqy-system/src/main/java/com/zkqy/system/service/impl/LoginPageConfigurationServiceImpl.java

@@ -1,6 +1,7 @@
 package com.zkqy.system.service.impl;
 
 import java.util.List;
+
 import com.zkqy.common.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -10,92 +11,85 @@ import com.zkqy.system.service.ILoginPageConfigurationService;
 
 /**
  * 登录页面配置信息Service业务层处理
- * 
+ *
  * @author zkqy
  * @date 2024-01-22
  */
 @Service
-public class LoginPageConfigurationServiceImpl implements ILoginPageConfigurationService 
-{
+public class LoginPageConfigurationServiceImpl implements ILoginPageConfigurationService {
     @Autowired
     private LoginPageConfigurationMapper loginPageConfigurationMapper;
 
     /**
      * 查询登录页面配置信息
-     * 
+     *
      * @param tenantId 登录页面配置信息主键
      * @return 登录页面配置信息
      */
     @Override
-    public LoginPageConfiguration selectLoginPageConfigurationByTenantId(Long tenantId)
-    {
-        return loginPageConfigurationMapper.selectLoginPageConfigurationByTenantId(tenantId);
+    public LoginPageConfiguration selectLoginPageConfigurationByTenantId(Long tenantId, String loginType) {
+        return loginPageConfigurationMapper.selectLoginPageConfigurationByTenantId(tenantId, loginType);
     }
 
     @Override
-    public LoginPageConfiguration selectLoginPageConfigurationByLoginPageNumber(String loginPageNumber) {
-        return loginPageConfigurationMapper.selectLoginPageConfigurationByLoginPageNumber(loginPageNumber);
+    public LoginPageConfiguration selectLoginPageConfigurationByLoginPageNumber(String loginPageNumber, String loginType) {
+        return loginPageConfigurationMapper.selectLoginPageConfigurationByLoginPageNumber(loginPageNumber, loginType);
     }
 
     /**
      * 查询登录页面配置信息列表
-     * 
+     *
      * @param loginPageConfiguration 登录页面配置信息
      * @return 登录页面配置信息
      */
     @Override
-    public List<LoginPageConfiguration> selectLoginPageConfigurationList(LoginPageConfiguration loginPageConfiguration)
-    {
+    public List<LoginPageConfiguration> selectLoginPageConfigurationList(LoginPageConfiguration loginPageConfiguration) {
         return loginPageConfigurationMapper.selectLoginPageConfigurationList(loginPageConfiguration);
     }
 
     /**
      * 新增登录页面配置信息
-     * 
+     *
      * @param loginPageConfiguration 登录页面配置信息
      * @return 结果
      */
     @Override
-    public int insertLoginPageConfiguration(LoginPageConfiguration loginPageConfiguration)
-    {
+    public int insertLoginPageConfiguration(LoginPageConfiguration loginPageConfiguration) {
         loginPageConfiguration.setCreateTime(DateUtils.getNowDate());
         return loginPageConfigurationMapper.insertLoginPageConfiguration(loginPageConfiguration);
     }
 
     /**
      * 修改登录页面配置信息
-     * 
+     *
      * @param loginPageConfiguration 登录页面配置信息
      * @return 结果
      */
     @Override
-    public int updateLoginPageConfiguration(LoginPageConfiguration loginPageConfiguration)
-    {
+    public int updateLoginPageConfiguration(LoginPageConfiguration loginPageConfiguration) {
         loginPageConfiguration.setUpdateTime(DateUtils.getNowDate());
         return loginPageConfigurationMapper.updateLoginPageConfiguration(loginPageConfiguration);
     }
 
     /**
      * 批量删除登录页面配置信息
-     * 
+     *
      * @param ids 需要删除的登录页面配置信息主键
      * @return 结果
      */
     @Override
-    public int deleteLoginPageConfigurationByIds(Long[] ids)
-    {
+    public int deleteLoginPageConfigurationByIds(Long[] ids) {
         return loginPageConfigurationMapper.deleteLoginPageConfigurationByIds(ids);
     }
 
     /**
      * 删除登录页面配置信息信息
-     * 
+     *
      * @param id 登录页面配置信息主键
      * @return 结果
      */
     @Override
-    public int deleteLoginPageConfigurationById(Long id)
-    {
+    public int deleteLoginPageConfigurationById(Long id) {
         return loginPageConfigurationMapper.deleteLoginPageConfigurationById(id);
     }
 }

+ 70 - 39
zkqy-system/src/main/resources/mapper/system/LoginPageConfigurationMapper.xml

@@ -1,60 +1,87 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.zkqy.system.mapper.LoginPageConfigurationMapper">
-    
+
     <resultMap type="LoginPageConfiguration" id="LoginPageConfigurationResult">
-        <result property="id"    column="id"    />
-        <result property="loginPageNumber"    column="login_page_number"    />
-        <result property="loginPageTitle"    column="login_page_title"    />
-        <result property="loginPageDescription"    column="login_page_description"    />
-        <result property="loginPageLogo"    column="login_page_logo"    />
-        <result property="loginPageBackgroundImage"    column="login_page_background_image"    />
-        <result property="windowTitle"    column="window_title"    />
-        <result property="windowLogo"    column="window_logo"    />
-        <result property="tenantId"    column="tenant_id"    />
-        <result property="remark"    column="remark"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createById"    column="create_by_id"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateById"    column="update_by_id"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="delFlag"    column="del_flag"    />
+        <result property="id" column="id"/>
+        <result property="loginPageNumber" column="login_page_number"/>
+        <result property="loginPageTitle" column="login_page_title"/>
+        <result property="loginPageDescription" column="login_page_description"/>
+        <result property="loginPageLogo" column="login_page_logo"/>
+        <result property="loginPageBackgroundImage" column="login_page_background_image"/>
+        <result property="windowTitle" column="window_title"/>
+        <result property="windowLogo" column="window_logo"/>
+        <result property="tenantId" column="tenant_id"/>
+        <result property="remark" column="remark"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createById" column="create_by_id"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateById" column="update_by_id"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="loginType" column="login_type"/>
     </resultMap>
 
     <sql id="selectLoginPageConfigurationVo">
-        select id, login_page_number, login_page_title, login_page_description, login_page_logo, login_page_background_image, window_title, window_logo, tenant_id, remark, create_by, create_by_id, create_time, update_by, update_by_id, update_time, del_flag from login_page_configuration
+        select id,
+               login_page_number,
+               login_page_title,
+               login_page_description,
+               login_page_logo,
+               login_page_background_image,
+               window_title,
+               window_logo,
+               tenant_id,
+               remark,
+               create_by,
+               create_by_id,
+               create_time,
+               update_by,
+               update_by_id,
+               update_time,
+               del_flag,
+               login_type
+        from login_page_configuration
     </sql>
 
-    <select id="selectLoginPageConfigurationList" parameterType="LoginPageConfiguration" resultMap="LoginPageConfigurationResult">
+    <select id="selectLoginPageConfigurationList" parameterType="LoginPageConfiguration"
+            resultMap="LoginPageConfigurationResult">
         <include refid="selectLoginPageConfigurationVo"/>
-          where del_flag = '0'
-            <if test="loginPageNumber != null  and loginPageNumber != ''"> and login_page_number = #{loginPageNumber}</if>
-            <if test="loginPageTitle != null  and loginPageTitle != ''"> and login_page_title = #{loginPageTitle}</if>
-            <if test="loginPageDescription != null  and loginPageDescription != ''"> and login_page_description = #{loginPageDescription}</if>
-            <if test="loginPageLogo != null  and loginPageLogo != ''"> and login_page_logo = #{loginPageLogo}</if>
-            <if test="loginPageBackgroundImage != null  and loginPageBackgroundImage != ''"> and login_page_background_image = #{loginPageBackgroundImage}</if>
-            <if test="windowTitle != null  and windowTitle != ''"> and window_title = #{windowTitle}</if>
-            <if test="windowLogo != null  and windowLogo != ''"> and window_logo = #{windowLogo}</if>
-            <if test="tenantId != null "> and tenant_id = #{tenantId}</if>
+        where del_flag = '0'
+        <if test="loginPageNumber != null  and loginPageNumber != ''">and login_page_number = #{loginPageNumber}</if>
+        <if test="loginType != null  and loginType != ''">and login_type = #{loginType}</if>
+        <if test="loginPageTitle != null  and loginPageTitle != ''">and login_page_title = #{loginPageTitle}</if>
+        <if test="loginPageDescription != null  and loginPageDescription != ''">and login_page_description =
+            #{loginPageDescription}
+        </if>
+        <if test="loginPageLogo != null  and loginPageLogo != ''">and login_page_logo = #{loginPageLogo}</if>
+        <if test="loginPageBackgroundImage != null  and loginPageBackgroundImage != ''">and login_page_background_image
+            = #{loginPageBackgroundImage}
+        </if>
+        <if test="windowTitle != null  and windowTitle != ''">and window_title = #{windowTitle}</if>
+        <if test="windowLogo != null  and windowLogo != ''">and window_logo = #{windowLogo}</if>
+        <if test="tenantId != null ">and tenant_id = #{tenantId}</if>
     </select>
-    
+
     <select id="selectLoginPageConfigurationByTenantId" parameterType="Long" resultMap="LoginPageConfigurationResult">
         <include refid="selectLoginPageConfigurationVo"/>
-        where tenant_id = #{tenantId}
+        where tenant_id = #{tenantId} and login_type = #{loginType}
     </select>
 
-    <select id="selectLoginPageConfigurationByLoginPageNumber" parameterType="string" resultMap="LoginPageConfigurationResult">
+    <select id="selectLoginPageConfigurationByLoginPageNumber" parameterType="string"
+            resultMap="LoginPageConfigurationResult">
         <include refid="selectLoginPageConfigurationVo"/>
-        where login_page_number = #{loginPageNumber}
+        where login_page_number = #{loginPageNumber} and login_type = #{loginType}
     </select>
-        
+
     <insert id="insertLoginPageConfiguration" parameterType="LoginPageConfiguration">
         insert into login_page_configuration
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="loginPageNumber != null">login_page_number,</if>
+            <if test="loginType != null">login_type,</if>
             <if test="loginPageTitle != null">login_page_title,</if>
             <if test="loginPageDescription != null">login_page_description,</if>
             <if test="loginPageLogo != null">login_page_logo,</if>
@@ -67,9 +94,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createById != null">create_by_id,</if>
             <if test="createTime != null">create_time,</if>
             del_flag
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="loginPageNumber != null">#{loginPageNumber},</if>
+            <if test="loginType != null">#{loginType},</if>
             <if test="loginPageTitle != null">#{loginPageTitle},</if>
             <if test="loginPageDescription != null">#{loginPageDescription},</if>
             <if test="loginPageLogo != null">#{loginPageLogo},</if>
@@ -82,13 +110,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createById != null">#{createById},</if>
             <if test="createTime != null">#{createTime},</if>
             '0'
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateLoginPageConfiguration" parameterType="LoginPageConfiguration">
         update login_page_configuration
         <trim prefix="SET" suffixOverrides=",">
             <if test="loginPageNumber != null">login_page_number = #{loginPageNumber},</if>
+            <if test="loginType != null">login_type = #{loginType},</if>
             <if test="loginPageTitle != null">login_page_title = #{loginPageTitle},</if>
             <if test="loginPageDescription != null">login_page_description = #{loginPageDescription},</if>
             <if test="loginPageLogo != null">login_page_logo = #{loginPageLogo},</if>
@@ -106,7 +135,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <delete id="deleteLoginPageConfigurationById" parameterType="Long">
-        update login_page_configuration set del_flag = '2' where id = #{id}
+        update login_page_configuration
+        set del_flag = '2'
+        where id = #{id}
     </delete>
 
     <delete id="deleteLoginPageConfigurationByIds" parameterType="String">

+ 7 - 5
zkqy-ui/src/api/system/configuration.js

@@ -10,10 +10,11 @@ export function listConfiguration(query) {
 }
 
 // 查询登录页面配置信息详细
-export function getConfiguration(id) {
+export function getConfiguration(params) {
   return request({
-    url: '/system/configuration/' + id,
-    method: 'get'
+    url: '/system/configuration/getInfoByTenantId',
+    method: 'get',
+    params: params
   })
 }
 
@@ -46,7 +47,8 @@ export function delConfiguration(id) {
 // 登录页查询配置接口
 export function getLoginPageConfigurationInfo(params) {
   return request({
-    url: `/system/configuration/queryLoginPageConfigurationInfo/${params}`,
-    method: 'get'
+    url: `/system/configuration/queryLoginPageConfigurationInfo`,
+    method: 'get',
+    params: params
   })
 }

+ 9 - 9
zkqy-ui/src/permission.js

@@ -1,14 +1,14 @@
 import router from './router'
 import store from './store'
-import { Message } from 'element-ui'
+import {Message} from 'element-ui'
 import NProgress from 'nprogress'
 import 'nprogress/nprogress.css'
-import { getToken } from '@/utils/auth'
-import { isRelogin } from '@/utils/request'
+import {getToken} from '@/utils/auth'
+import {isRelogin} from '@/utils/request'
 
-NProgress.configure({ showSpinner: false })
+NProgress.configure({showSpinner: false})
 
-const whiteList = ['/login', '/register', '/404']
+const whiteList = ['/login', '/register', '/404', '/adminLogin']
 
 router.beforeEach((to, from, next) => {
   NProgress.start()
@@ -16,7 +16,7 @@ router.beforeEach((to, from, next) => {
     to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
     /* has token*/
     if (to.path === '/login') {
-      next({ path: '/' })
+      next({path: '/'})
       NProgress.done()
     } else {
       if (store.getters.roles.length === 0) {
@@ -27,12 +27,12 @@ router.beforeEach((to, from, next) => {
           store.dispatch('GenerateRoutes').then(accessRoutes => {
             // 根据roles权限生成可访问的路由表
             router.addRoutes(accessRoutes) // 动态添加可访问路由表
-            next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
+            next({...to, replace: true}) // hack方法 确保addRoutes已完成
           })
         }).catch(err => {
           store.dispatch('LogOut').then(() => {
             Message.error(err)
-            next({ path: '/' })
+            next({path: '/'})
           })
         })
       } else {
@@ -45,7 +45,7 @@ router.beforeEach((to, from, next) => {
       // 在免登录白名单,直接进入
       next()
     } else {
-      next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
+      next(`/adminLogin?redirect=${to.fullPath}`) // 否则全部重定向到登录页
       NProgress.done()
     }
   }

+ 28 - 21
zkqy-ui/src/router/index.js

@@ -1,6 +1,6 @@
 import Vue from 'vue'
 import Router from 'vue-router'
-import { getQueryParams } from '@/utils/other'
+import {getQueryParams} from '@/utils/other'
 
 Vue.use(Router)
 
@@ -21,12 +21,12 @@ import Layout from '@/layout'
  * roles: ['admin', 'common']       // 访问路由的角色权限
  * permissions: ['a:a:a', 'b:b:b']  // 访问路由的菜单权限
  * meta : {
-    noCache: true                   // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
-    title: 'title'                  // 设置该路由在侧边栏和面包屑中展示的名字
-    icon: 'svg-name'                // 设置该路由的图标,对应路径src/assets/icons/svg
-    breadcrumb: false               // 如果设置为false,则不会在breadcrumb面包屑中显示
-    activeMenu: '/system/user'      // 当路由设置了该属性,则会高亮相对应的侧边栏。
-  }
+ noCache: true                   // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
+ title: 'title'                  // 设置该路由在侧边栏和面包屑中展示的名字
+ icon: 'svg-name'                // 设置该路由的图标,对应路径src/assets/icons/svg
+ breadcrumb: false               // 如果设置为false,则不会在breadcrumb面包屑中显示
+ activeMenu: '/system/user'      // 当路由设置了该属性,则会高亮相对应的侧边栏。
+ }
  */
 
 // 公共路由
@@ -156,17 +156,24 @@ export const constantRoutes = [
       var url = new URL(window.location.href);
       var params = new URLSearchParams(url.search);
       let temp = params.get('tenantCode')
-      console.log(temp);
       if (temp) {
         return import('@/views/login')
       } else {
-        return import('@/views/adminLogin')
-        // return import('@/views/login')
+        // return import('@/views/adminLogin')
+        return import('@/views/error/401')
       }
 
     },
     hidden: true
   },
+  {
+    path: '/adminLogin',
+    component: () => {
+      var url = new URL(window.location.href);
+      return import('@/views/adminLogin')
+    },
+    hidden: true
+  },
   {
     path: '/register',
     component: () => import('@/views/register'),
@@ -191,7 +198,7 @@ export const constantRoutes = [
         path: 'index',
         component: () => import('@/views/index'),
         name: 'Index',
-        meta: { title: '首页', icon: 'dashboard', affix: true }
+        meta: {title: '首页', icon: 'dashboard', affix: true}
       }
     ]
   },
@@ -205,7 +212,7 @@ export const constantRoutes = [
         path: 'profile',
         component: () => import('@/views/system/user/profile/index'),
         name: 'Profile',
-        meta: { title: '个人中心', icon: 'user' }
+        meta: {title: '个人中心', icon: 'user'}
       }
     ]
   },
@@ -225,7 +232,7 @@ export const dynamicRoutes = [
         component: () => import('@/views/system/data/index'),
         // component: (resolve) => require(['@/views/system/data/index'], resolve),
         name: 'AuthRole',
-        meta: { title: '数据源配置', activeMenu: '/system/data' }
+        meta: {title: '数据源配置', activeMenu: '/system/data'}
       }
     ]
   },
@@ -240,7 +247,7 @@ export const dynamicRoutes = [
         component: () => import('@/views/system/user/authRole'),
         // component: (resolve) => require(['@/views/system/user/authRole'], resolve),
         name: 'AuthRole',
-        meta: { title: '分配角色', activeMenu: '/system/user' }
+        meta: {title: '分配角色', activeMenu: '/system/user'}
       }
     ]
   },
@@ -255,7 +262,7 @@ export const dynamicRoutes = [
         component: () => import('@/views/system/fromModel/index'),
         // component: (resolve) => require(['@/views/system/fromModel/index'], resolve),
         name: 'fromModel',
-        meta: { title: '表单建模', activeMenu: '/system/fromModel/index' }
+        meta: {title: '表单建模', activeMenu: '/system/fromModel/index'}
       },
       // {
       //   path: '/fromModel/:index',
@@ -277,7 +284,7 @@ export const dynamicRoutes = [
         component: () => import('@/views/system/role/authUser'),
         // component: (resolve) => require(['@/views/system/role/authUser'], resolve),
         name: 'AuthUser',
-        meta: { title: '分配用户', activeMenu: '/system/role' }
+        meta: {title: '分配用户', activeMenu: '/system/role'}
       }
     ]
   },
@@ -292,7 +299,7 @@ export const dynamicRoutes = [
         component: () => import('@/views/system/dict/data'),
         // component: (resolve) => require(['@/views/system/dict/data'], resolve),
         name: 'Data',
-        meta: { title: '字典数据', activeMenu: '/system/dict' }
+        meta: {title: '字典数据', activeMenu: '/system/dict'}
       }
     ]
   },
@@ -308,7 +315,7 @@ export const dynamicRoutes = [
         component: () => import('@/views/system/tenant/dict/data'),
         // component: (resolve) => require(['@/views/system/tenant/dict/data'], resolve),
         name: 'TenantData',
-        meta: { title: '字典数据', activeMenu: '/system/tenant/dict' }
+        meta: {title: '字典数据', activeMenu: '/system/tenant/dict'}
       }
     ]
   },
@@ -324,7 +331,7 @@ export const dynamicRoutes = [
         component: () => import('@/views/monitor/job/log'),
         // component: (resolve) => require(['@/views/monitor/job/log'], resolve),
         name: 'JobLog',
-        meta: { title: '调度日志', activeMenu: '/monitor/job' }
+        meta: {title: '调度日志', activeMenu: '/monitor/job'}
       }
     ]
   },
@@ -340,7 +347,7 @@ export const dynamicRoutes = [
 
         // component: (resolve) => require(['@/views/tool/gen/editTable'], resolve),
         name: 'GenEdit',
-        meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
+        meta: {title: '修改生成配置', activeMenu: '/tool/gen'}
       }
     ]
   }
@@ -361,6 +368,6 @@ Router.prototype.replace = function push(location) {
 
 export default new Router({
   mode: 'history', // 去掉url中的#
-  scrollBehavior: () => ({ y: 0 }),
+  scrollBehavior: () => ({y: 0}),
   routes: constantRoutes
 })

+ 2 - 1
zkqy-ui/src/store/modules/user.js

@@ -119,7 +119,7 @@ const user = {
       return new Promise((resolve, reject) => {
         logout(state.token).then(() => {
           if (state.userId == 1) {  // 如果当前用户是admin的话
-            location.href = "/login"
+            location.href = "/adminLogin"
           } else {
             location.href = state.tenant.tenantToolLoginUrl
           }
@@ -132,6 +132,7 @@ const user = {
           commit('SET_TENANT', {})
           removeToken()
           localStorage.clear();
+          sessionStorage.clear();
           resolve()
         })
       })

+ 90 - 162
zkqy-ui/src/views/system/tenant/index.vue

@@ -54,10 +54,10 @@
           icon="el-icon-search"
           size="mini"
           @click="handleQuery"
-          >搜索
+        >搜索
         </el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
-          >重置
+        >重置
         </el-button>
       </el-form-item>
     </el-form>
@@ -71,7 +71,7 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['system:tenant:add']"
-          >新增
+        >新增
         </el-button>
       </el-col>
       <el-col :span="1.5">
@@ -83,7 +83,7 @@
           size="mini"
           @click="handleExport"
           v-hasPermi="['system:tenant:export']"
-          >导出
+        >导出
         </el-button>
         <ExcelDownLoad
           v-else
@@ -111,12 +111,12 @@
       :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
       @cell-dblclick="copyText"
     >
-      <el-table-column label="租户ID" align="center" prop="tenantId" />
-      <el-table-column label="租户编号" align="center" prop="tenantCode" />
-      <el-table-column label="租户名称" align="center" prop="tenantName" />
-      <el-table-column label="联系方式" align="center" prop="contactInfo" />
-      <el-table-column label="租户地址" align="center" prop="address" />
-      <el-table-column label="负责人" align="center" prop="owner" />
+      <el-table-column label="租户ID" align="center" prop="tenantId"/>
+      <el-table-column label="租户编号" align="center" prop="tenantCode"/>
+      <el-table-column label="租户名称" align="center" prop="tenantName"/>
+      <el-table-column label="联系方式" align="center" prop="contactInfo"/>
+      <el-table-column label="租户地址" align="center" prop="address"/>
+      <el-table-column label="负责人" align="center" prop="owner"/>
       <!--      <el-table-column label="租户父级ID" align="center" prop="tenantParentId"/>-->
       <el-table-column
         label="客户端访问地址"
@@ -152,7 +152,7 @@
                   icon="el-icon-edit"
                   @click="handleUpdate(scope.row)"
                   v-hasPermi="['system:tenant:edit']"
-                  >修改
+                >修改
                 </el-button>
               </el-dropdown-item>
               <el-dropdown-item>
@@ -162,7 +162,7 @@
                   icon="el-icon-delete"
                   @click="handleDelete(scope.row)"
                   v-hasPermi="['system:tenant:remove']"
-                  >删除
+                >删除
                 </el-button>
               </el-dropdown-item>
               <el-dropdown-item>
@@ -172,7 +172,7 @@
                   icon="el-icon-position"
                   @click="bindDatasource(scope.row)"
                   v-show="scope.row.datasourceId == null"
-                  >绑定数据源
+                >绑定数据源
                 </el-button>
               </el-dropdown-item>
               <el-dropdown-item>
@@ -182,7 +182,7 @@
                   icon="el-icon-s-custom"
                   @click="openTenantExpirationTime(scope.row)"
                   v-hasPermi="['system:tenant:remove']"
-                  >激活租户
+                >激活租户
                 </el-button>
               </el-dropdown-item>
               <el-dropdown-item>
@@ -190,9 +190,19 @@
                   size="mini"
                   type="text"
                   icon="el-icon-s-open"
-                  @click="openLoginConfig(scope.row)"
+                  @click="openLoginConfig(scope.row,'client')"
                   v-hasPermi="['system:tenant:remove']"
-                  >配置登录页
+                >客户端登录信息
+                </el-button>
+              </el-dropdown-item>
+              <el-dropdown-item>
+                <el-button
+                  size="mini"
+                  type="text"
+                  icon="el-icon-s-open"
+                  @click="openLoginConfig(scope.row,'tool')"
+                  v-hasPermi="['system:tenant:remove']"
+                >工具端登录信息
                 </el-button>
               </el-dropdown-item>
             </el-dropdown-menu>
@@ -245,7 +255,7 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="租户地址" prop="address">
-              <el-input v-model="form.address" placeholder="请输入地址" />
+              <el-input v-model="form.address" placeholder="请输入地址"/>
             </el-form-item>
             <el-form-item label="联系方式" prop="contactInfo">
               <el-input
@@ -254,7 +264,7 @@
               />
             </el-form-item>
             <el-form-item label="负责人" prop="owner">
-              <el-input v-model="form.owner" placeholder="请输入负责人" />
+              <el-input v-model="form.owner" placeholder="请输入负责人"/>
             </el-form-item>
           </el-col>
 
@@ -362,7 +372,7 @@
           @click="submitForm1"
           :disabled="dialogLoading"
           :loading="dialogLoading"
-          >{{ dialogLoading ? "绑定中" : "确 定" }}
+        >{{ dialogLoading ? "绑定中" : "确 定" }}
         </el-button>
         <el-button @click="cancel1">取 消</el-button>
       </div>
@@ -395,7 +405,7 @@
           <el-button
             type="primary"
             @click="activationOperationMethod('tenantExpirationTimeFrom')"
-            >确 定
+          >确 定
           </el-button>
           <el-button @click="tanentCancel">取 消</el-button>
         </el-form-item>
@@ -403,49 +413,28 @@
     </el-dialog>
     <!-- 登录页面配置信息列表 -->
     <el-dialog
-      title="配置登录页"
+      :title="login_title"
       width="800px"
       :visible.sync="loginOpen"
-      append-to-body
-    >
-      <el-form
-        ref="loginFormRef"
-        :model="loginForm"
-        :inline="true"
-        :rules="rules"
-        label-width="80px"
-      >
-        <el-form-item prop="loginPageNumber">
-          <span slot="label">
-            <el-tooltip
-              content="请在登录时的url后拼接参数:tenantId={编号}"
-              placement="top"
-            >
-              <i class="el-icon-question"></i>
-            </el-tooltip>
-            编号:
-          </span>
-          <el-input
-            v-model="loginForm.loginPageNumber"
-            placeholder="请输入登录页面编号"
-            disabled
-          />
-        </el-form-item>
-        <!-- <el-col :span="8"> -->
+      append-to-body>
+
+      <el-form ref="loginFormRef"
+               :model="loginForm"
+               :inline="true"
+               :rules="rules"
+               label-width="80px">
+
         <el-form-item label="标题:" prop="loginPageTitle">
           <el-input
             v-model="loginForm.loginPageTitle"
-            placeholder="请输入登录页面标题"
-          />
+            placeholder="请输入登录页面标题"/>
         </el-form-item>
-        <!-- </el-col> -->
-        <!-- <el-col :span="8"> -->
+
         <el-form-item label="描述:" prop="loginPageDescription">
           <span slot="label">
             <el-tooltip
               content="推荐长度为8个汉字,可使用<br/>换行"
-              placement="top"
-            >
+              placement="top">
               <i class="el-icon-question"></i>
             </el-tooltip>
             描述:
@@ -453,19 +442,13 @@
           <el-input
             v-model="loginForm.loginPageDescription"
             type="textarea"
-            placeholder="请输入内容"
-          />
+            placeholder="请输入内容"/>
         </el-form-item>
-        <!-- </el-col>
-        <el-col :span="8"> -->
         <el-form-item label="窗口标题:" prop="windowTitle">
           <el-input
             v-model="loginForm.windowTitle"
-            placeholder="请输入窗口标题"
-          />
+            placeholder="请输入窗口标题"/>
         </el-form-item>
-        <!-- </el-col> -->
-        <!-- <el-col :span="8"> -->
         <el-form-item prop="loginPageLogo">
           <span slot="label">
             <el-tooltip content="推荐图片大小为194*64px" placement="top">
@@ -473,10 +456,8 @@
             </el-tooltip>
             logo:
           </span>
-          <image-upload :limit="1" v-model="loginForm.loginPageLogo" />
+          <image-upload :limit="1" v-model="loginForm.loginPageLogo"/>
         </el-form-item>
-        <!-- </el-col> -->
-        <!-- <el-col :span="8"> -->
         <el-form-item prop="loginPageBackgroundImage">
           <span slot="label">
             <el-tooltip content="推荐图片大小为1400*900px" placement="top">
@@ -486,21 +467,11 @@
           </span>
           <image-upload
             :limit="1"
-            v-model="loginForm.loginPageBackgroundImage"
-          />
+            v-model="loginForm.loginPageBackgroundImage"/>
         </el-form-item>
-        <!-- </el-col> -->
-        <!-- <el-col :span="8"> -->
-        <!-- <el-form-item label="窗口logo:" prop="windowLogo">
-          <image-upload
-            :fileType="['png']"
-            :limit="1"
-            :uploadUrl="'/common/uploadAndConvert'"
-            v-model="loginForm.windowLogo"
-          />
-        </el-form-item> -->
-        <!-- </el-col> -->
       </el-form>
+
+
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitLoginForm">确 定</el-button>
         <el-button @click="cancelLoginForm">取 消</el-button>
@@ -524,18 +495,14 @@ import {
   getTenantChildrenInfo,
   getTenantAllList,
 } from "@/api/system/tenant";
-import { getDataSourceInfo, insertDataSource } from "@/api/system/data";
+import {getDataSourceInfo, insertDataSource} from "@/api/system/data";
 import {
-  listConfiguration,
-  getConfiguration,
-  delConfiguration,
   addConfiguration,
-  updateConfiguration,
+  updateConfiguration, getLoginPageConfigurationInfo,
 } from "@/api/system/configuration";
-import { servicesLoading } from "@/utils/zkqy";
-import { getIsExistUser } from "@/api/system/user";
+import {getIsExistUser} from "@/api/system/user";
 import ExcelDownLoad from "@/components/ExcelDownLoad/index.vue";
-import { mapState } from "vuex";
+import {mapState} from "vuex";
 
 export default {
   name: "Tenant",
@@ -558,6 +525,7 @@ export default {
       // 登录页面数据
       isEdit: false,
       loginOpen: false,
+      login_title: "",
       loginForm: {
         loginPageNumber: "",
         loginPageTitle: "",
@@ -618,14 +586,14 @@ export default {
       // 表单校验
       rules: {
         tenantName: [
-          { required: true, message: "租户名称不能为空", trigger: "blur" },
+          {required: true, message: "租户名称不能为空", trigger: "blur"},
         ],
         tenantCode: [
-          { required: true, message: "租户编号不能为空", trigger: "blur" },
+          {required: true, message: "租户编号不能为空", trigger: "blur"},
         ],
         tenantParentId: [
-          { required: true, message: "请选择上级租户", trigger: "blur" },
-          { validator: this.checkTenantParentId, trigger: "change" },
+          {required: true, message: "请选择上级租户", trigger: "blur"},
+          {validator: this.checkTenantParentId, trigger: "change"},
         ],
       },
       //数据源表单参数
@@ -644,11 +612,11 @@ export default {
       fromTenantId: null,
       dataSourceFormRules: {
         databaseType: [
-          { required: true, message: "数据源类型不能为空", trigger: "change" },
+          {required: true, message: "数据源类型不能为空", trigger: "change"},
         ],
         databaseName: [
-          { required: true, message: "数据库名不能为空", trigger: "blur" },
-          { validator: this.databaseNameValidator, trigger: "blur" },
+          {required: true, message: "数据库名不能为空", trigger: "blur"},
+          {validator: this.databaseNameValidator, trigger: "blur"},
         ],
         tenantAccount: [
           {
@@ -656,19 +624,19 @@ export default {
             message: "租户管理员账号不能为空",
             trigger: "change",
           },
-          { validator: this.tenantAccountValidator, trigger: "blur" },
+          {validator: this.tenantAccountValidator, trigger: "blur"},
         ],
         databaseIp: [
-          { required: true, message: "数据库IP不能为空", trigger: "blur" },
+          {required: true, message: "数据库IP不能为空", trigger: "blur"},
         ],
         username: [
-          { required: true, message: "用户名不能为空", trigger: "blur" },
+          {required: true, message: "用户名不能为空", trigger: "blur"},
         ],
         password: [
-          { required: true, message: "密码不能为空", trigger: "blur" },
+          {required: true, message: "密码不能为空", trigger: "blur"},
         ],
         portNumber: [
-          { required: true, message: "端口号不能为空", trigger: "blur" },
+          {required: true, message: "端口号不能为空", trigger: "blur"},
         ],
       },
       //租户激活码弹窗表单
@@ -681,7 +649,7 @@ export default {
       //租户激活码规则验证
       rulesTenantExpirationTime: {
         tenantExpirationTime: [
-          { required: true, message: "请输入租户激活码", trigger: "blur" },
+          {required: true, message: "请输入租户激活码", trigger: "blur"},
         ],
       },
       currentPage: "",
@@ -761,7 +729,7 @@ export default {
         "tenantParentId"
       );
       this.tenantAllList = [
-        { tenantId: 0, tenantName: "顶级租户" },
+        {tenantId: 0, tenantName: "顶级租户"},
         ...tenantAllListOne,
       ];
     },
@@ -773,52 +741,12 @@ export default {
         children: this.buildTree(data, child.tenantId), // 将 child.tenant_id 作为下一层的 parentId
       }));
     },
-    transformTenantsToCascaderOptions(tenants) {
-      console.log(tenants);
-      const options = [];
-      const map = {}; // 用于存储每个tenant的引用,以便后续添加children
-
-      tenants.forEach((tenant) => {
-        const { tenantId, tenantName, tenantParentId } = tenant;
-        const option = {
-          value: tenantId,
-          label: tenantName,
-          children: [], // 初始化children数组
-        };
-
-        if (tenantParentId === null) {
-          // 如果没有父级,说明是顶级租户,直接添加到options中
-          options.push(option);
-        } else {
-          // 如果有父级,则先查找父级租户在map中的引用,并添加到其children数组中
-          if (!map[tenantParentId]) {
-            // 如果父级租户还没被处理过,先创建一个空的引用
-            map[tenantParentId] = { children: [] };
-          }
-          map[tenantParentId].children.push(option);
-        }
-        // 将当前租户添加到map中,方便后续查找
-        map[tenantId] = option;
-      });
-
-      // 遍历map,将顶级租户的children填充完整
-      Object.values(map).forEach((option) => {
-        if (!options.includes(option)) {
-          // 如果这个选项不是顶级租户,则将其添加到某个顶级租户的children中
-          const parentOption = options.find((o) => o.children.includes(option));
-          if (parentOption) {
-            parentOption.children.push(option);
-          }
-        }
-      });
-      console.log(options);
-      return options;
-    },
     // 提交登录页配置数据
     submitLoginForm() {
+      // return console.log(this.loginForm)
+      // 客户端
       this.$refs.loginFormRef?.validate(async (valid) => {
         if (valid) {
-          console.log(this.loginForm);
           let res = {},
             msg = "";
           if (this.isEdit) {
@@ -835,19 +763,21 @@ export default {
             this.$message.error(`${msg}失败,请检查网络`);
           }
         } else {
-          console.log(`${msg}失败,请检查网络`);
           return false;
         }
       });
+
+
     },
     // 取消登录页配置
     cancelLoginForm() {
       this.loginOpen = false;
     },
     // 编辑租户登录页配置
-    async openLoginConfig(row) {
+    async openLoginConfig(row, loginType) {
       try {
-        let res = await getConfiguration(row.tenantId);
+        let res = await getLoginPageConfigurationInfo({"loginPageNumber": row.tenantCode, "loginType": loginType});
+        console.log(res);
         if (res.code == 200) {
           if (res.data) {
             this.loginForm = res.data;
@@ -859,11 +789,18 @@ export default {
           // 目前一个租户只能有一个配置项故使用租户唯一编码
           this.loginForm.loginPageNumber = row.tenantCode;
           this.loginForm.tenantId = row.tenantId;
+          this.loginForm.loginType = loginType;
           this.loginOpen = true;
+          if (loginType == 'client') {
+            this.login_title = '配置客户端';
+          } else {
+            this.login_title = '配置工具端';
+          }
         } else {
           this.$message.error("网络异常,请稍后再试");
         }
-      } catch (error) {}
+      } catch (error) {
+      }
     },
     // 获取所用用户名,作校验用
     async selectAllUser() {
@@ -896,7 +833,7 @@ export default {
       //   callback();
       // }
       if (value) {
-        await getIsExistUser({ userName: value }).then((res) => {
+        await getIsExistUser({userName: value}).then((res) => {
           if (res.code == 200) {
             if (res.data) {
               callback();
@@ -969,7 +906,7 @@ export default {
       input.select(); // 选中输入框的内容
       document.execCommand("copy"); // 执行复制操作
       document.body.removeChild(input); // 移除临时的输入框
-      this.$message({ message: "复制成功", type: "success" }); // 提示
+      this.$message({message: "复制成功", type: "success"}); // 提示
     },
     /** 查询租户信息列表 */
     getList() {
@@ -1098,23 +1035,13 @@ export default {
     /** 提交按钮 */
     async submitForm() {
       let valid = await this.$refs.form.validate();
-      // console.log(valid);
-      // return;
       if (!valid) return;
       if (this.form.tenantParentId.length >= 0) {
         // 处理当前租户的上级租户id
-        this.form.tenantParentId =
-          this.form.tenantParentId[this.form.tenantParentId.length - 1] !=
-          undefined
-            ? this.form.tenantParentId[this.form.tenantParentId.length - 1]
-            : "";
+        this.form.tenantParentId = this.form.tenantParentId[this.form.tenantParentId.length - 1] != undefined ? this.form.tenantParentId[this.form.tenantParentId.length - 1] : "";
       }
-      this.form.tenantClientLoginUrl = this.dict.type.system_login_url
-        .find((item) => item.label == "client_login_url")
-        ?.value.replace("#{val}", this.form.tenantCode);
-      this.form.tenantToolLoginUrl = this.dict.type.system_login_url
-        .find((item) => item.label == "crm_login_url")
-        ?.value.replace("#{val}", this.form.tenantCode);
+      this.form.tenantClientLoginUrl = this.dict.type.system_login_url.find((item) => item.label == "client_login_url")?.value.replace("#{val}", this.form.tenantCode + "client");
+      this.form.tenantToolLoginUrl = this.dict.type.system_login_url.find((item) => item.label == "crm_login_url")?.value.replace("#{val}", this.form.tenantCode + "tool");
       this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.tenantId != null) {
@@ -1205,7 +1132,8 @@ export default {
           this.getList();
           this.$modal.msgSuccess("删除成功");
         })
-        .catch(() => {});
+        .catch(() => {
+        });
     },
     /** 导出按钮操作 */
     handleExport() {
@@ -1232,7 +1160,7 @@ export default {
         qar[item.label] = item.value;
       });
       if (this.dataSourceType) {
-        let { databaseIp, password, portNumber, username } = qar;
+        let {databaseIp, password, portNumber, username} = qar;
         Object.assign(this.dataSourceForm, {
           databaseIp,
           password,

+ 3 - 2
zkqy-ui/src/views/system/tenant/tenantIndex.vue

@@ -457,8 +457,7 @@
       title="配置登录页"
       width="800px"
       :visible.sync="loginOpen"
-      append-to-body
-    >
+      append-to-body>
       <el-form
         ref="loginFormRef"
         :model="loginForm"
@@ -466,6 +465,8 @@
         :rules="rules"
         label-width="80px"
       >
+
+
         <el-form-item prop="loginPageNumber">
           <span slot="label">
             <el-tooltip