浏览代码

项目提交

jindi 1 年之前
父节点
当前提交
759e369ebd

+ 70 - 49
.idea/workspace.xml

@@ -44,9 +44,8 @@
       <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/resources/application.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application.yml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/src/main/resources/templates/login.html" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/templates/login.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/target/classes/application.yml" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/application.yml" 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/templates/login.html" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/templates/login.html" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -100,17 +99,17 @@
     <property name="WebServerToolWindowFactoryState" value="false" />
     <property name="aspect.path.notification.shown" value="true" />
     <property name="last_opened_file_path" value="$PROJECT_DIR$" />
-    <property name="settings.editor.selected.configurable" value="MavenSettings" />
+    <property name="settings.editor.selected.configurable" value="preferences.fileTypes" />
   </component>
   <component name="RecentsManager">
-    <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>
     <key name="CopyClassDialog.RECENTS_KEY">
       <recent name="com.pj.project.sys_user" />
     </key>
-    <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>
   </component>
@@ -183,7 +182,13 @@
       <workItem from="1693809791218" duration="102000" />
       <workItem from="1693883425602" duration="9000" />
       <workItem from="1693898275871" duration="1724000" />
-      <workItem from="1693901275400" duration="234000" />
+      <workItem from="1693901275400" duration="615000" />
+      <workItem from="1693904816662" duration="9019000" />
+      <workItem from="1694053113599" duration="68000" />
+      <workItem from="1694170221068" duration="88000" />
+      <workItem from="1694224377178" duration="4330000" />
+      <workItem from="1694240006247" duration="12587000" />
+      <workItem from="1694394248081" duration="5896000" />
     </task>
     <task id="LOCAL-00001" summary="项目提交">
       <created>1692754671570</created>
@@ -381,7 +386,14 @@
       <option name="project" value="LOCAL" />
       <updated>1693565071897</updated>
     </task>
-    <option name="localTasksCounter" value="29" />
+    <task id="LOCAL-00029" summary="/sso/auth">
+      <created>1693901584746</created>
+      <option name="number" value="00029" />
+      <option name="presentableId" value="LOCAL-00029" />
+      <option name="project" value="LOCAL" />
+      <updated>1693901584746</updated>
+    </task>
+    <option name="localTasksCounter" value="30" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
@@ -405,7 +417,8 @@
     <MESSAGE value="应用端加device_type字段" />
     <MESSAGE value="/sso/Auth接口修改" />
     <MESSAGE value=" /sso/Auth接口修改" />
-    <option name="LAST_COMMIT_MESSAGE" value=" /sso/Auth接口修改" />
+    <MESSAGE value="/sso/auth" />
+    <option name="LAST_COMMIT_MESSAGE" value="/sso/auth" />
   </component>
   <component name="WindowStateProjectService">
     <state x="2685" y="204" key="#com.intellij.ide.util.MemberChooser" timestamp="1692946298826">
@@ -416,101 +429,109 @@
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state x="2610" y="267" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1692090140484" />
-    <state x="2635" y="222" key="#xdebugger.evaluate" timestamp="1693376744606">
+    <state x="2635" y="222" width="1024" height="595" key="#xdebugger.evaluate" timestamp="1694395726578">
       <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="1693376744606" />
-    <state x="2544" y="170" key="CommitChangelistDialog2" timestamp="1693565064523">
+    <state x="2635" y="222" width="1024" height="595" key="#xdebugger.evaluate/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694395726578" />
+    <state x="2544" y="170" key="CommitChangelistDialog2" timestamp="1694400279814">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state x="2544" y="170" key="CommitChangelistDialog2/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693565064523" />
-    <state width="883" height="466" key="DebuggerActiveHint" timestamp="1693384339114">
+    <state x="2544" y="170" key="CommitChangelistDialog2/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694400279814" />
+    <state width="1444" height="466" key="DebuggerActiveHint" timestamp="1694396238468">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="883" height="466" key="DebuggerActiveHint/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693384339114" />
+    <state width="1444" height="466" key="DebuggerActiveHint/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694396238468" />
     <state x="2012" y="92" width="1736" height="856" key="DiffContextDialog" timestamp="1693013173565">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state x="2012" y="92" width="1736" height="856" key="DiffContextDialog/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693013173565" />
-    <state x="2660" y="275" key="FileChooserDialogImpl" timestamp="1692754343375">
+    <state x="2660" y="275" key="FileChooserDialogImpl" timestamp="1694249944928">
       <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="220" key="GridCell.Tab.0.bottom" timestamp="1693901505229">
+    <state x="2660" y="275" key="FileChooserDialogImpl/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694249944928" />
+    <state width="1877" height="220" key="GridCell.Tab.0.bottom" timestamp="1694400337231">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="220" key="GridCell.Tab.0.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693901505229" />
-    <state width="1877" height="220" key="GridCell.Tab.0.center" timestamp="1693901505228">
+    <state width="1877" height="220" key="GridCell.Tab.0.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694400337231" />
+    <state width="1877" height="220" key="GridCell.Tab.0.center" timestamp="1694400337231">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="220" key="GridCell.Tab.0.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693901505228" />
-    <state width="1877" height="220" key="GridCell.Tab.0.left" timestamp="1693901505228">
+    <state width="1877" height="220" key="GridCell.Tab.0.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694400337231" />
+    <state width="1877" height="220" key="GridCell.Tab.0.left" timestamp="1694400337231">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="220" key="GridCell.Tab.0.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693901505228" />
-    <state width="1877" height="220" key="GridCell.Tab.0.right" timestamp="1693901505229">
+    <state width="1877" height="220" key="GridCell.Tab.0.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694400337231" />
+    <state width="1877" height="220" key="GridCell.Tab.0.right" timestamp="1694400337231">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="220" key="GridCell.Tab.0.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693901505229" />
-    <state width="1877" height="370" key="GridCell.Tab.1.bottom" timestamp="1693900305465">
+    <state width="1877" height="220" key="GridCell.Tab.0.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694400337231" />
+    <state width="1877" height="224" key="GridCell.Tab.1.bottom" timestamp="1694400078866">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="370" key="GridCell.Tab.1.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693900305465" />
-    <state width="1877" height="370" key="GridCell.Tab.1.center" timestamp="1693900305465">
+    <state width="1877" height="224" key="GridCell.Tab.1.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694400078866" />
+    <state width="1877" height="224" key="GridCell.Tab.1.center" timestamp="1694400078866">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="370" key="GridCell.Tab.1.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693900305465" />
-    <state width="1877" height="370" key="GridCell.Tab.1.left" timestamp="1693900305465">
+    <state width="1877" height="224" key="GridCell.Tab.1.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694400078866" />
+    <state width="1877" height="224" key="GridCell.Tab.1.left" timestamp="1694400078866">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="370" key="GridCell.Tab.1.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693900305465" />
-    <state width="1877" height="370" key="GridCell.Tab.1.right" timestamp="1693900305465">
+    <state width="1877" height="224" key="GridCell.Tab.1.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694400078866" />
+    <state width="1877" height="224" key="GridCell.Tab.1.right" timestamp="1694400078866">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="370" key="GridCell.Tab.1.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693900305465" />
-    <state width="1877" height="370" key="GridCell.Tab.2.bottom" timestamp="1693900305465">
+    <state width="1877" height="224" key="GridCell.Tab.1.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694400078866" />
+    <state width="1877" height="224" key="GridCell.Tab.2.bottom" timestamp="1694400078867">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="370" key="GridCell.Tab.2.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693900305465" />
-    <state width="1877" height="370" key="GridCell.Tab.2.center" timestamp="1693900305465">
+    <state width="1877" height="224" key="GridCell.Tab.2.bottom/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694400078867" />
+    <state width="1877" height="224" key="GridCell.Tab.2.center" timestamp="1694400078867">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="370" key="GridCell.Tab.2.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693900305465" />
-    <state width="1877" height="370" key="GridCell.Tab.2.left" timestamp="1693900305465">
+    <state width="1877" height="224" key="GridCell.Tab.2.center/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694400078867" />
+    <state width="1877" height="224" key="GridCell.Tab.2.left" timestamp="1694400078866">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="370" key="GridCell.Tab.2.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693900305465" />
-    <state width="1877" height="370" key="GridCell.Tab.2.right" timestamp="1693900305465">
+    <state width="1877" height="224" key="GridCell.Tab.2.left/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694400078866" />
+    <state width="1877" height="224" key="GridCell.Tab.2.right" timestamp="1694400078867">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state width="1877" height="370" key="GridCell.Tab.2.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693900305465" />
+    <state width="1877" height="224" key="GridCell.Tab.2.right/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694400078867" />
     <state x="2636" y="231" key="RollbackChangesDialog" timestamp="1693013074093">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state x="2636" y="231" key="RollbackChangesDialog/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693013074093" />
-    <state x="2381" y="162" key="SettingsEditor" timestamp="1691549723160">
+    <state x="2381" y="162" key="SettingsEditor" timestamp="1694170307639">
+      <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="1694170307639" />
+    <state x="2472" y="253" key="Vcs.Push.Dialog.v2" timestamp="1693901623669">
       <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="1693565080889">
+    <state x="2472" y="253" key="Vcs.Push.Dialog.v2/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693901623669" />
+    <state width="968" height="528" key="XDebugger.FullValuePopup" timestamp="1693907767752">
       <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="1693565080889" />
-    <state x="2560" y="344" key="com.intellij.ide.util.TipDialog" timestamp="1693808361295">
+    <state width="968" height="528" key="XDebugger.FullValuePopup/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693907767752" />
+    <state x="2560" y="344" key="com.intellij.ide.util.TipDialog" timestamp="1694394251710">
       <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="1693808361295" />
+    <state x="2560" y="344" key="com.intellij.ide.util.TipDialog/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694394251710" />
     <state x="2672" y="437" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1693547334479">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state x="2672" y="437" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693547334479" />
-    <state x="2135" y="81" width="1115" height="669" key="find.popup" timestamp="1693447789165">
+    <state x="2135" y="81" width="1115" height="669" key="find.popup" timestamp="1694399659608">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
-    <state x="2135" y="81" width="1115" height="669" key="find.popup/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1693447789165" />
+    <state x="2135" y="81" width="1115" height="669" key="find.popup/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694399659608" />
     <state x="2581" y="147" key="refactoring.ChangeSignatureDialog" timestamp="1692685608267">
       <screen x="1920" y="0" width="1920" height="1040" />
     </state>
     <state x="2581" y="147" key="refactoring.ChangeSignatureDialog/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1692685608267" />
+    <state x="2536" y="240" key="run.anything.popup" timestamp="1694253658990">
+      <screen x="1920" y="0" width="1920" height="1040" />
+    </state>
+    <state x="2536" y="240" key="run.anything.popup/1920.0.1920.1040/0.0.1920.1040@1920.0.1920.1040" timestamp="1694253658990" />
   </component>
 </project>

+ 40 - 4
src/main/java/com/pj/project/sso/SsoServerController.java

@@ -7,6 +7,7 @@ import cn.dev33.satoken.sso.SaSsoManager;
 import cn.dev33.satoken.sso.SaSsoTemplate;
 import cn.dev33.satoken.sso.name.ParamName;
 import cn.dev33.satoken.stp.StpLogic;
+import cn.dev33.satoken.stp.StpUtil;
 import cn.dev33.satoken.util.SaResult;
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
@@ -17,11 +18,14 @@ import com.pj.project.sys_client_visit.SysClientVisit;
 import com.pj.project.sys_client_visit.SysClientVisitMapper;
 import com.pj.project.sys_user.SysUser;
 import com.pj.project.sys_user.SysUserMapper;
+import com.pj.project.sys_user_acc.*;
 import com.pj.project.sys_user_password.SysUserPasswordService;
 import com.pj.project.sys_user_sync.listen.SspServerListenUtil;
 import com.pj.project4sp.config.SpConfig;
 import com.pj.project4sp.config.SpConfigMapper;
 import com.pj.project4sp.config.SpConfigUtil;
+import com.pj.utils.sg.AjaxError;
+import com.pj.utils.sg.NbUtil;
 import com.pj.utils.so.SoMap;
 import io.netty.util.internal.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,8 +40,6 @@ import com.dtflys.forest.Forest;
 import com.pj.current.satoken.StpUserUtil;
 import com.pj.project.sys_client.SysClientUtil;
 import com.pj.project.sys_client_visit.SysClientVisitUtil;
-import com.pj.project.sys_user_acc.SysUserAccService;
-import com.pj.project.sys_user_acc.SysUserAccUtil;
 import com.pj.utils.sg.AjaxJson;
 
 import cn.dev33.satoken.config.SaSsoConfig;
@@ -84,13 +86,18 @@ public class SsoServerController {
     @Autowired
     private SpConfigMapper spConfigMapper;
 
-    // SSO-Server端:处理所有SSO相关请求 
+    @Autowired
+    private SysUserAccMapper sysUserAccMapper;
+
+
+    //SSO-Server端:处理所有SSO相关请求
     @RequestMapping("/sso/*")
     public Object ssoRequest() {
         return SaSsoProcessor.instance.serverDister();
     }
 
-    // 重写 /sso/auth 统一认证请求处理,增加日志记录 
+
+    // 重写 /sso/auth 统一认证请求处理,增加日志记录
     @RequestMapping("/sso/auth")
     public Object ssoAuth() {
         //查出重定向地址
@@ -169,6 +176,28 @@ public class SsoServerController {
         sso.setNotLoginView(() -> {
             return new ModelAndView("login.html");
         });
+        // 配置:登录处理函数
+//        sso.setDoLoginHandle((name, pwd) -> {
+//            // 此处仅做模拟登录,真实环境应该查询数据进行登录
+//            // 校验参数
+//            if (NbUtil.hasNull(name, pwd)) {
+//                return SaResult.error("请输入账号/密码");
+//            }
+//            //对加密密码进行解密
+//            //pwd = BtoAAtoB.atob(pwd);
+//            // 获取相应用户
+//            SysUserAcc userAcc = sysUserAccMapper.getByUsername(name);
+//
+//            // 2、开始校验
+//            if (userAcc == null) return SaResult.error("无此账号");
+//            if (NbUtil.isNull(userAcc.getPassword())) return SaResult.error("此账号尚未设置密码,无法登陆");
+//            String md5Password = SystemObject.getPasswordMd5Str(userAcc.getId(), pwd);
+//            if (userAcc.getPassword().equals(md5Password) == false) return SaResult.error("密码错误");
+//            if (userAcc.getStatus() == 2) return SaResult.error("此账号已被禁用,如有疑问,请联系管理员");
+//
+//            StpUtil.login(userAcc.getId());
+//            return SaResult.ok("登录成功!").setData(StpUtil.getTokenValue());
+//        });
 
         // 配置 Http 请求处理器 (在模式三的单点注销功能下用到,如不需要可以注释掉) 
         sso.setSendHttp(url -> {
@@ -183,6 +212,13 @@ public class SsoServerController {
         });
     }
 
+    // 将 StpUtil 的 loginType 改为 user
+//    @Autowired
+//    public void setLoginType() {
+//        StpUtil.stpLogic.setLoginType("user");
+//    }
+
+
     // 返回所有在线用户
     @RequestMapping("/sso/getList")
     public AjaxJson getList(@RequestParam(defaultValue = "") String keyword) {

二进制
target/classes/com/pj/project/sso/SsoServerController.class


二进制
xmnk-sso-1.0.jar