Sfoglia il codice sorgente

主应用限制唯一性

jindi 1 anno fa
parent
commit
02c67d28f7

+ 47 - 49
.idea/workspace.xml

@@ -42,21 +42,10 @@
       <change afterPath="$PROJECT_DIR$/log/ssp-server/2023_08/2023_08_22/2023_08_22_18(0).log" afterDir="false" />
       <change afterPath="$PROJECT_DIR$/log/ssp-server/2023_08/2023_08_23/2023_08_23_09(0).log" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/pj/project/sso/SsoServerController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/pj/project/sso/SsoServerController.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/pj/project/sys_client/SysClient.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/pj/project/sys_client/SysClient.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/pj/project/sys_client/SysClientController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/pj/project/sys_client/SysClientController.java" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/main/java/com/pj/project/sys_client/SysClientMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/pj/project/sys_client/SysClientMapper.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/pj/project/sys_client/SysClientMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/pj/project/sys_client/SysClientMapper.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/pj/project/sys_client_visit/SysClientVisitMapper.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/pj/project/sys_client_visit/SysClientVisitMapper.java" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/java/com/pj/project/sys_client_visit/SysClientVisitMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/pj/project/sys_client_visit/SysClientVisitMapper.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/pj/project/sso/SsoServerController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/pj/project/sso/SsoServerController.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/pj/project/sys_client/SysClient.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/pj/project/sys_client/SysClient.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/pj/project/sys_client/SysClientController.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/pj/project/sys_client/SysClientController.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/pj/project/sys_client/SysClientMapper.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/pj/project/sys_client/SysClientMapper.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/pj/project/sys_client/SysClientMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/pj/project/sys_client/SysClientMapper.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/pj/project/sys_client_visit/SysClientVisitMapper.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/pj/project/sys_client_visit/SysClientVisitMapper.class" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/pj/project/sys_client_visit/SysClientVisitMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/pj/project/sys_client_visit/SysClientVisitMapper.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/xmnk-sso-1.0.jar" beforeDir="false" afterPath="$PROJECT_DIR$/xmnk-sso-1.0.jar" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/src/main/resources/application.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application.yml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/application.yml" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/application.yml" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -112,14 +101,14 @@
     <property name="settings.editor.selected.configurable" value="MavenSettings" />
   </component>
   <component name="RecentsManager">
-    <key name="MoveFile.RECENT_KEYS">
+    <key name="CopyFile.RECENT_KEYS">
+      <recent name="E:\java\YaoXiangMu\sa-sso-pro\ssp-server" />
       <recent name="E:\java\YaoXiangMu\sa-sso-pro\ssp-server\src\main\resources\static" />
     </key>
     <key name="CopyClassDialog.RECENTS_KEY">
       <recent name="com.pj.project.sys_user" />
     </key>
-    <key name="CopyFile.RECENT_KEYS">
-      <recent name="E:\java\YaoXiangMu\sa-sso-pro\ssp-server" />
+    <key name="MoveFile.RECENT_KEYS">
       <recent name="E:\java\YaoXiangMu\sa-sso-pro\ssp-server\src\main\resources\static" />
     </key>
   </component>
@@ -183,7 +172,8 @@
       <workItem from="1693012205070" duration="946000" />
       <workItem from="1693013189580" duration="18142000" />
       <workItem from="1693184212405" duration="1406000" />
-      <workItem from="1693185743697" duration="30749000" />
+      <workItem from="1693185743697" duration="31304000" />
+      <workItem from="1693357631965" duration="3533000" />
     </task>
     <task id="LOCAL-00001" summary="项目提交">
       <created>1692754671570</created>
@@ -325,7 +315,14 @@
       <option name="project" value="LOCAL" />
       <updated>1693036895718</updated>
     </task>
-    <option name="localTasksCounter" value="21" />
+    <task id="LOCAL-00021" summary="把登录页面分离出去">
+      <created>1693304099852</created>
+      <option name="number" value="00021" />
+      <option name="presentableId" value="LOCAL-00021" />
+      <option name="project" value="LOCAL" />
+      <updated>1693304099852</updated>
+    </task>
+    <option name="localTasksCounter" value="22" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
@@ -341,7 +338,8 @@
     <MESSAGE value="首页修改,对接修改" />
     <MESSAGE value="对接修改响应时间过长" />
     <MESSAGE value="配置项增加背景图and标题" />
-    <option name="LAST_COMMIT_MESSAGE" value="配置项增加背景图and标题" />
+    <MESSAGE value="把登录页面分离出去" />
+    <option name="LAST_COMMIT_MESSAGE" value="把登录页面分离出去" />
   </component>
   <component name="WindowStateProjectService">
     <state x="2685" y="204" key="#com.intellij.ide.util.MemberChooser" timestamp="1692946298826">
@@ -356,10 +354,10 @@
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state x="2635" y="222" key="#xdebugger.evaluate/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693203328017" />
-    <state x="2380" y="112" key="CommitChangelistDialog2" timestamp="1693036888777">
+    <state x="2380" y="112" key="CommitChangelistDialog2" timestamp="1693304092426">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state x="2380" y="112" key="CommitChangelistDialog2/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693036888777" />
+    <state x="2380" y="112" key="CommitChangelistDialog2/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693304092426" />
     <state width="883" height="466" key="DebuggerActiveHint" timestamp="1693271427265">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
@@ -372,54 +370,54 @@
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state x="2660" y="275" key="FileChooserDialogImpl/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1692754343375" />
-    <state width="1877" height="213" key="GridCell.Tab.0.bottom" timestamp="1693303981385">
+    <state width="1877" height="277" key="GridCell.Tab.0.bottom" timestamp="1693362672847">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="213" key="GridCell.Tab.0.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693303981385" />
-    <state width="1877" height="213" key="GridCell.Tab.0.center" timestamp="1693303981385">
+    <state width="1877" height="277" key="GridCell.Tab.0.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693362672847" />
+    <state width="1877" height="277" key="GridCell.Tab.0.center" timestamp="1693362672847">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="213" key="GridCell.Tab.0.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693303981385" />
-    <state width="1877" height="213" key="GridCell.Tab.0.left" timestamp="1693303981385">
+    <state width="1877" height="277" key="GridCell.Tab.0.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693362672847" />
+    <state width="1877" height="277" key="GridCell.Tab.0.left" timestamp="1693362672847">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="213" key="GridCell.Tab.0.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693303981385" />
-    <state width="1877" height="213" key="GridCell.Tab.0.right" timestamp="1693303981385">
+    <state width="1877" height="277" key="GridCell.Tab.0.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693362672847" />
+    <state width="1877" height="277" key="GridCell.Tab.0.right" timestamp="1693362672847">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="213" key="GridCell.Tab.0.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693303981385" />
-    <state width="1877" height="388" key="GridCell.Tab.1.bottom" timestamp="1693303954156">
+    <state width="1877" height="277" key="GridCell.Tab.0.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693362672847" />
+    <state width="1877" height="388" key="GridCell.Tab.1.bottom" timestamp="1693362653040">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="388" key="GridCell.Tab.1.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693303954156" />
-    <state width="1877" height="388" key="GridCell.Tab.1.center" timestamp="1693303954156">
+    <state width="1877" height="388" key="GridCell.Tab.1.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693362653040" />
+    <state width="1877" height="388" key="GridCell.Tab.1.center" timestamp="1693362653040">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="388" key="GridCell.Tab.1.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693303954156" />
-    <state width="1877" height="388" key="GridCell.Tab.1.left" timestamp="1693303954156">
+    <state width="1877" height="388" key="GridCell.Tab.1.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693362653040" />
+    <state width="1877" height="388" key="GridCell.Tab.1.left" timestamp="1693362653040">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="388" key="GridCell.Tab.1.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693303954156" />
-    <state width="1877" height="388" key="GridCell.Tab.1.right" timestamp="1693303954156">
+    <state width="1877" height="388" key="GridCell.Tab.1.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693362653040" />
+    <state width="1877" height="388" key="GridCell.Tab.1.right" timestamp="1693362653040">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="388" key="GridCell.Tab.1.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693303954156" />
-    <state width="1877" height="388" key="GridCell.Tab.2.bottom" timestamp="1693303954156">
+    <state width="1877" height="388" key="GridCell.Tab.1.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693362653040" />
+    <state width="1877" height="388" key="GridCell.Tab.2.bottom" timestamp="1693362653041">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="388" key="GridCell.Tab.2.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693303954156" />
-    <state width="1877" height="388" key="GridCell.Tab.2.center" timestamp="1693303954156">
+    <state width="1877" height="388" key="GridCell.Tab.2.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693362653041" />
+    <state width="1877" height="388" key="GridCell.Tab.2.center" timestamp="1693362653040">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="388" key="GridCell.Tab.2.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693303954156" />
-    <state width="1877" height="388" key="GridCell.Tab.2.left" timestamp="1693303954156">
+    <state width="1877" height="388" key="GridCell.Tab.2.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693362653040" />
+    <state width="1877" height="388" key="GridCell.Tab.2.left" timestamp="1693362653040">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="388" key="GridCell.Tab.2.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693303954156" />
-    <state width="1877" height="388" key="GridCell.Tab.2.right" timestamp="1693303954156">
+    <state width="1877" height="388" key="GridCell.Tab.2.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693362653040" />
+    <state width="1877" height="388" key="GridCell.Tab.2.right" timestamp="1693362653041">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="388" key="GridCell.Tab.2.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693303954156" />
+    <state width="1877" height="388" key="GridCell.Tab.2.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693362653040" />
     <state x="2636" y="231" key="RollbackChangesDialog" timestamp="1693013074093">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
@@ -428,14 +426,14 @@
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state x="2381" y="162" key="SettingsEditor/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1691549723160" />
-    <state x="2472" y="253" key="Vcs.Push.Dialog.v2" timestamp="1693036905456">
+    <state x="2472" y="253" key="Vcs.Push.Dialog.v2" timestamp="1693304120545">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state x="2472" y="253" key="Vcs.Push.Dialog.v2/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693036905456" />
-    <state x="2560" y="344" key="com.intellij.ide.util.TipDialog" timestamp="1693185767652">
+    <state x="2472" y="253" key="Vcs.Push.Dialog.v2/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693304120545" />
+    <state x="2560" y="344" key="com.intellij.ide.util.TipDialog" timestamp="1693357698933">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state x="2560" y="344" key="com.intellij.ide.util.TipDialog/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693185767652" />
+    <state x="2560" y="344" key="com.intellij.ide.util.TipDialog/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693357698933" />
     <state x="2135" y="81" width="1115" height="669" key="find.popup" timestamp="1693302834597">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>

+ 14 - 0
src/main/java/com/pj/project/sys_client/SysClientController.java

@@ -54,6 +54,12 @@ public class SysClientController {
             if (!StringUtil.isNullOrEmpty(s.getLogo())) {
                 s.setLogo(s.getLogo().replaceAll(getDoMain(), ""));
             }
+            //判断主应用的唯一性
+            if (s.getIsMain() == 1) {
+                SysClient isMain = sysClientMapper.getIsMain();
+                if (isMain != null) return AjaxJson.getError("已经存在主应用,不能再次添加");
+            }
+
             sysClientMapper.add(s);
             s = sysClientMapper.getById(SP.publicMapper.getPrimarykey());
             return AjaxJson.getSuccessData(s);
@@ -101,6 +107,14 @@ public class SysClientController {
             if (!StringUtil.isNullOrEmpty(s.getLogo())) {
                 s.setLogo(s.getLogo().replaceAll(getDoMain(), ""));
             }
+            //判断主应用的唯一性
+            if (s.getIsMain() == 1) {
+                SysClient isMain = sysClientMapper.getIsMain();
+                if (isMain != null && !s.getId().equals(isMain.getId())) {
+                    return AjaxJson.getError("已经存在主应用,不能再次添加");
+                }
+            }
+
             int line = sysClientMapper.update(s);
             return AjaxJson.getByLine(line);
         } finally {

+ 0 - 3
src/main/java/com/pj/project/sys_client/SysClientMapper.java

@@ -71,7 +71,4 @@ public interface SysClientMapper {
 	 */
 	SysClient getIsMain();
 
-
-
-
 }

+ 1 - 1
src/main/resources/application.yml

@@ -5,7 +5,7 @@ spring:
         # 启动环境加载,同时加载两个的写法:common,prod  优先级左>右
 #        active: dev
         active: prod
-        
+
 # ================ 公共配置(优先级低于application-xxx.yml)  ================ 
     # mvc设置
     mvc: 

+ 1 - 1
target/classes/application.yml

@@ -5,7 +5,7 @@ spring:
         # 启动环境加载,同时加载两个的写法:common,prod  优先级左>右
 #        active: dev
         active: prod
-        
+
 # ================ 公共配置(优先级低于application-xxx.yml)  ================ 
     # mvc设置
     mvc: 

BIN
target/classes/com/pj/project/sys_client/SysClientController.class


BIN
xmnk-sso-1.0.jar