1901010417 vor 4 Jahren
Commit
3e314cb203
73 geänderte Dateien mit 1182 neuen und 0 gelöschten Zeilen
  1. BIN
      .gradle/6.7.1/executionHistory/executionHistory.bin
  2. BIN
      .gradle/6.7.1/executionHistory/executionHistory.lock
  3. BIN
      .gradle/6.7.1/fileChanges/last-build.bin
  4. BIN
      .gradle/6.7.1/fileHashes/fileHashes.bin
  5. BIN
      .gradle/6.7.1/fileHashes/fileHashes.lock
  6. 0 0
      .gradle/6.7.1/gc.properties
  7. BIN
      .gradle/6.7.1/javaCompile/classAnalysis.bin
  8. BIN
      .gradle/6.7.1/javaCompile/javaCompile.lock
  9. BIN
      .gradle/6.7.1/javaCompile/taskHistory.bin
  10. BIN
      .gradle/buildOutputCleanup/buildOutputCleanup.lock
  11. 2 0
      .gradle/buildOutputCleanup/cache.properties
  12. BIN
      .gradle/buildOutputCleanup/outputFiles.bin
  13. BIN
      .gradle/checksums/checksums.lock
  14. BIN
      .gradle/checksums/md5-checksums.bin
  15. BIN
      .gradle/checksums/sha1-checksums.bin
  16. 0 0
      .gradle/configuration-cache/gc.properties
  17. 0 0
      .gradle/vcs-1/gc.properties
  18. 15 0
      .idea/compiler.xml
  19. 6 0
      .idea/encodings.xml
  20. 40 0
      .idea/gradle.xml
  21. 16 0
      .idea/inspectionProfiles/Project_Default.xml
  22. 30 0
      .idea/jarRepositories.xml
  23. 7 0
      .idea/misc.xml
  24. 124 0
      .idea/uiDesigner.xml
  25. 368 0
      .idea/workspace.xml
  26. 37 0
      build.gradle
  27. 6 0
      settings.gradle
  28. 0 0
      sso-cart/build.gradle
  29. BIN
      sso-cart/build/classes/java/main/com/sso/cart/CartApp.class
  30. BIN
      sso-cart/build/classes/java/main/com/sso/cart/controller/ViewController.class
  31. 2 0
      sso-cart/build/resources/main/application.yml
  32. 18 0
      sso-cart/build/resources/main/templates/index.html
  33. 4 0
      sso-cart/build/tmp/compileJava/source-classes-mapping.txt
  34. 20 0
      sso-cart/src/main/java/com/sso/cart/CartApp.java
  35. 36 0
      sso-cart/src/main/java/com/sso/cart/controller/ViewController.java
  36. 2 0
      sso-cart/src/main/resources/application.yml
  37. 18 0
      sso-cart/src/main/resources/templates/index.html
  38. 0 0
      sso-login/build.gradle
  39. BIN
      sso-login/build/classes/java/main/com/sso/login/LoginApp.class
  40. BIN
      sso-login/build/classes/java/main/com/sso/login/controller/LoginController.class
  41. BIN
      sso-login/build/classes/java/main/com/sso/login/controller/ViewController.class
  42. BIN
      sso-login/build/classes/java/main/com/sso/login/pojo/User.class
  43. BIN
      sso-login/build/classes/java/main/com/sso/login/utils/LoginCacheUtil.class
  44. 3 0
      sso-login/build/resources/main/application.yml
  45. 17 0
      sso-login/build/resources/main/templates/login.html
  46. 10 0
      sso-login/build/tmp/compileJava/source-classes-mapping.txt
  47. 11 0
      sso-login/src/main/java/com/sso/login/LoginApp.java
  48. 65 0
      sso-login/src/main/java/com/sso/login/controller/LoginController.java
  49. 44 0
      sso-login/src/main/java/com/sso/login/controller/ViewController.java
  50. 53 0
      sso-login/src/main/java/com/sso/login/pojo/User.java
  51. 12 0
      sso-login/src/main/java/com/sso/login/utils/LoginCacheUtil.java
  52. 3 0
      sso-login/src/main/resources/application.yml
  53. 17 0
      sso-login/src/main/resources/templates/login.html
  54. 0 0
      sso-main/build.gradle
  55. BIN
      sso-main/build/classes/java/main/com/sso/main/MainApp.class
  56. BIN
      sso-main/build/classes/java/main/com/sso/main/controller/ViewController.class
  57. 3 0
      sso-main/build/resources/main/application.yml
  58. 20 0
      sso-main/build/resources/main/templates/index.html
  59. 4 0
      sso-main/build/tmp/compileJava/source-classes-mapping.txt
  60. 17 0
      sso-main/src/main/java/com/sso/main/MainApp.java
  61. 34 0
      sso-main/src/main/java/com/sso/main/controller/ViewController.java
  62. 3 0
      sso-main/src/main/resources/application.yml
  63. 20 0
      sso-main/src/main/resources/templates/index.html
  64. 1 0
      sso-vip/build.gradle
  65. BIN
      sso-vip/build/classes/java/main/com/sso/vip/VipApp.class
  66. BIN
      sso-vip/build/classes/java/main/com/sso/vip/controller/ViewController.class
  67. 2 0
      sso-vip/build/resources/main/application.yml
  68. 17 0
      sso-vip/build/resources/main/templates/index.html
  69. 4 0
      sso-vip/build/tmp/compileJava/source-classes-mapping.txt
  70. 17 0
      sso-vip/src/main/java/com/sso/vip/VipApp.java
  71. 35 0
      sso-vip/src/main/java/com/sso/vip/controller/ViewController.java
  72. 2 0
      sso-vip/src/main/resources/application.yml
  73. 17 0
      sso-vip/src/main/resources/templates/index.html

BIN
.gradle/6.7.1/executionHistory/executionHistory.bin


BIN
.gradle/6.7.1/executionHistory/executionHistory.lock


BIN
.gradle/6.7.1/fileChanges/last-build.bin


BIN
.gradle/6.7.1/fileHashes/fileHashes.bin


BIN
.gradle/6.7.1/fileHashes/fileHashes.lock


+ 0 - 0
.gradle/6.7.1/gc.properties


BIN
.gradle/6.7.1/javaCompile/classAnalysis.bin


BIN
.gradle/6.7.1/javaCompile/javaCompile.lock


BIN
.gradle/6.7.1/javaCompile/taskHistory.bin


BIN
.gradle/buildOutputCleanup/buildOutputCleanup.lock


+ 2 - 0
.gradle/buildOutputCleanup/cache.properties

@@ -0,0 +1,2 @@
+#Tue Dec 22 10:22:12 CST 2020
+gradle.version=6.7.1

BIN
.gradle/buildOutputCleanup/outputFiles.bin


BIN
.gradle/checksums/checksums.lock


BIN
.gradle/checksums/md5-checksums.bin


BIN
.gradle/checksums/sha1-checksums.bin


+ 0 - 0
.gradle/configuration-cache/gc.properties


+ 0 - 0
.gradle/vcs-1/gc.properties


+ 15 - 0
.idea/compiler.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <annotationProcessing>
+      <profile default="true" name="Default" enabled="true" />
+      <profile name="Gradle Imported" enabled="true">
+        <outputRelativeToContentRoot value="true" />
+        <processorPath useClasspath="false">
+          <entry name="D:/gradle_home/caches/modules-2/files-2.1/org.projectlombok/lombok/1.18.2/524e0a697e9d62950b2f763d88d35cd8dc82a9a1/lombok-1.18.2.jar" />
+        </processorPath>
+        <module name="sso_wd_01.sso-vip.main" />
+      </profile>
+    </annotationProcessing>
+  </component>
+</project>

+ 6 - 0
.idea/encodings.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
+    <file url="PROJECT" charset="UTF-8" />
+  </component>
+</project>

+ 40 - 0
.idea/gradle.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="GradleMigrationSettings" migrationVersion="1" />
+  <component name="GradleSettings">
+    <option name="linkedExternalProjectsSettings">
+      <GradleProjectSettings>
+        <option name="delegatedBuild" value="true" />
+        <option name="testRunner" value="GRADLE" />
+        <option name="distributionType" value="DEFAULT_WRAPPED" />
+        <option name="externalProjectPath" value="$PROJECT_DIR$/../sso-vip" />
+        <option name="gradleHome" value="D:/gradle/gradle-6.7.1-all/gradle-6.7.1" />
+        <option name="modules">
+          <set>
+            <option value="$PROJECT_DIR$/../sso-vip" />
+          </set>
+        </option>
+        <option name="resolveExternalAnnotations" value="false" />
+        <option name="useQualifiedModuleNames" value="true" />
+      </GradleProjectSettings>
+      <GradleProjectSettings>
+        <option name="delegatedBuild" value="true" />
+        <option name="testRunner" value="GRADLE" />
+        <option name="distributionType" value="LOCAL" />
+        <option name="externalProjectPath" value="$PROJECT_DIR$" />
+        <option name="gradleHome" value="D:/gradle/gradle-6.7.1-all/gradle-6.7.1" />
+        <option name="modules">
+          <set>
+            <option value="$PROJECT_DIR$" />
+            <option value="$PROJECT_DIR$/sso-cart" />
+            <option value="$PROJECT_DIR$/sso-login" />
+            <option value="$PROJECT_DIR$/sso-main" />
+            <option value="$PROJECT_DIR$/sso-vip" />
+          </set>
+        </option>
+        <option name="useAutoImport" value="true" />
+        <option name="useQualifiedModuleNames" value="true" />
+      </GradleProjectSettings>
+    </option>
+  </component>
+</project>

+ 16 - 0
.idea/inspectionProfiles/Project_Default.xml

@@ -0,0 +1,16 @@
+<component name="InspectionProjectProfileManager">
+  <profile version="1.0">
+    <option name="myName" value="Project Default" />
+    <inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="myValues">
+        <value>
+          <list size="2">
+            <item index="0" class="java.lang.String" itemvalue="th:text" />
+            <item index="1" class="java.lang.String" itemvalue="th:if" />
+          </list>
+        </value>
+      </option>
+      <option name="myCustomValuesEnabled" value="true" />
+    </inspection_tool>
+  </profile>
+</component>

+ 30 - 0
.idea/jarRepositories.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RemoteRepositoriesConfiguration">
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Maven Central repository" />
+      <option name="url" value="https://repo1.maven.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jboss.community" />
+      <option name="name" value="JBoss Community repository" />
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven" />
+      <option name="name" value="maven" />
+      <option name="url" value="http://maven.aliyun.com/nexus/content/repositories/jcenter" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="MavenRepo" />
+      <option name="name" value="MavenRepo" />
+      <option name="url" value="https://repo.maven.apache.org/maven2/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="MavenLocal" />
+      <option name="name" value="MavenLocal" />
+      <option name="url" value="file:/$MAVEN_REPOSITORY$/" />
+    </remote-repository>
+  </component>
+</project>

+ 7 - 0
.idea/misc.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>

+ 124 - 0
.idea/uiDesigner.xml

@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Palette2">
+    <group name="Swing">
+      <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
+      </item>
+      <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
+        <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
+        <initial-values>
+          <property name="text" value="Button" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="RadioButton" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="CheckBox" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
+        <initial-values>
+          <property name="text" value="Label" />
+        </initial-values>
+      </item>
+      <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
+          <preferred-size width="150" height="-1" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
+          <preferred-size width="150" height="50" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
+          <preferred-size width="200" height="200" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
+      </item>
+      <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
+      </item>
+      <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
+          <preferred-size width="-1" height="20" />
+        </default-constraints>
+      </item>
+      <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
+        <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
+      </item>
+      <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
+        <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
+      </item>
+    </group>
+  </component>
+</project>

+ 368 - 0
.idea/workspace.xml

@@ -0,0 +1,368 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ChangeListManager">
+    <list default="true" id="967fc17b-984f-4cf8-90bd-651b5cc2fdb5" name="Default Changelist" comment="" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="ExternalProjectsData">
+    <projectState path="$PROJECT_DIR$/../sso-vip">
+      <ProjectState />
+    </projectState>
+    <projectState path="$PROJECT_DIR$">
+      <ProjectState />
+    </projectState>
+  </component>
+  <component name="ExternalProjectsManager">
+    <system id="GRADLE">
+      <state>
+        <task path="$PROJECT_DIR$/sso-vip">
+          <activation />
+        </task>
+        <projects_view>
+          <tree_state>
+            <expand>
+              <path>
+                <item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
+                <item name="sso_wd_01" type="f1a62948:ProjectNode" />
+              </path>
+            </expand>
+            <select />
+          </tree_state>
+        </projects_view>
+      </state>
+    </system>
+  </component>
+  <component name="FileTemplateManagerImpl">
+    <option name="RECENT_TEMPLATES">
+      <list>
+        <option value="HTML File" />
+        <option value="Class" />
+      </list>
+    </option>
+  </component>
+  <component name="Git.Settings">
+    <option name="ROOT_SYNC" value="DONT_SYNC" />
+  </component>
+  <component name="MavenImportPreferences">
+    <option name="generalSettings">
+      <MavenGeneralSettings>
+        <option name="localRepository" value="D:\myrep" />
+        <option name="mavenHome" value="C:/apache-maven-3.6.3" />
+        <option name="userSettingsFile" value="C:\apache-maven-3.6.3\conf\settings.xml" />
+      </MavenGeneralSettings>
+    </option>
+    <option name="importingSettings">
+      <MavenImportingSettings>
+        <option name="downloadDocsAutomatically" value="true" />
+        <option name="downloadSourcesAutomatically" value="true" />
+        <option name="importAutomatically" value="true" />
+        <option name="jdkForImporter" value="1.8" />
+        <option name="vmOptionsForImporter" value="-Xmx768m" />
+      </MavenImportingSettings>
+    </option>
+  </component>
+  <component name="MavenRunner">
+    <option name="jreName" value="1.8" />
+    <option name="vmOptions" value="-DarchetypeCatalog=internal" />
+  </component>
+  <component name="ProjectId" id="1lzch3jMPAwG5bK9mN4yqjBZlwy" />
+  <component name="ProjectViewState">
+    <option name="showExcludedFiles" value="true" />
+    <option name="showLibraryContents" value="true" />
+  </component>
+  <component name="PropertiesComponent">
+    <property name="DefaultHtmlFileTemplate" value="HTML File" />
+    <property name="ExpandSpringBootJavaOptionsPanel" value="true" />
+    <property name="RequestMappingsPanelOrder0" value="0" />
+    <property name="RequestMappingsPanelOrder1" value="1" />
+    <property name="RequestMappingsPanelWidth0" value="75" />
+    <property name="RequestMappingsPanelWidth1" value="75" />
+    <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
+    <property name="WebServerToolWindowFactoryState" value="false" />
+    <property name="aspect.path.notification.shown" value="true" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/sso-login" />
+    <property name="node.js.detected.package.eslint" value="true" />
+    <property name="node.js.detected.package.tslint" value="true" />
+    <property name="node.js.path.for.package.eslint" value="project" />
+    <property name="node.js.path.for.package.tslint" value="project" />
+    <property name="node.js.selected.package.eslint" value="(autodetect)" />
+    <property name="node.js.selected.package.tslint" value="(autodetect)" />
+    <property name="project.structure.last.edited" value="模块" />
+    <property name="project.structure.proportion" value="0.15390626" />
+    <property name="project.structure.side.proportion" value="0.2" />
+    <property name="settings.editor.selected.configurable" value="reference.settingsdialog.project.gradle" />
+  </component>
+  <component name="RecentsManager">
+    <key name="CopyClassDialog.RECENTS_KEY">
+      <recent name="com.sso.login.controller" />
+      <recent name="com.sso.vip.controller" />
+      <recent name="com.sso.cart.controller" />
+      <recent name="com.sso.cart.com.sso.vip" />
+      <recent name="com.sso.vip" />
+    </key>
+    <key name="CopyFile.RECENT_KEYS">
+      <recent name="D:\idea2019_Test\sso_wd_01\sso-cart\src\main\resources" />
+      <recent name="D:\idea2019_Test\sso_wd_01\sso-main\src\main\resources" />
+      <recent name="D:\idea2019_Test\sso_wd_01\sso-login\src\main\resources" />
+      <recent name="D:\idea2019_Test\sso_wd_01\sso-login\src\main\java\com\sso\login" />
+    </key>
+  </component>
+  <component name="RunDashboard">
+    <option name="configurationTypes">
+      <set>
+        <option value="SpringBootApplicationConfigurationType" />
+      </set>
+    </option>
+  </component>
+  <component name="RunManager" selected="Spring Boot.LoginApp">
+    <configuration name="CartApp" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" temporary="true" nameIsGenerated="true">
+      <module name="sso_wd_01.sso-cart.main" />
+      <extension name="coverage">
+        <pattern>
+          <option name="PATTERN" value="com.sso.cart.*" />
+          <option name="ENABLED" value="true" />
+        </pattern>
+      </extension>
+      <option name="SPRING_BOOT_MAIN_CLASS" value="com.sso.cart.CartApp" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
+    <configuration name="LoginApp (1)" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" temporary="true" nameIsGenerated="true">
+      <module name="sso_wd_01.sso-login.main" />
+      <extension name="coverage">
+        <pattern>
+          <option name="PATTERN" value="com.sso.login.*" />
+          <option name="ENABLED" value="true" />
+        </pattern>
+      </extension>
+      <option name="SPRING_BOOT_MAIN_CLASS" value="com.sso.login.LoginApp" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
+    <configuration name="LoginApp" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" temporary="true" nameIsGenerated="true">
+      <module name="sso_wd_01.sso-login.main" />
+      <extension name="coverage">
+        <pattern>
+          <option name="PATTERN" value="com.sso.login.*" />
+          <option name="ENABLED" value="true" />
+        </pattern>
+      </extension>
+      <option name="SPRING_BOOT_MAIN_CLASS" value="com.sso.login.LoginApp" />
+      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/sso-login" />
+      <option name="ALTERNATIVE_JRE_PATH" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
+    <configuration name="LoginApp" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" temporary="true" nameIsGenerated="true">
+      <module name="sso_wd_01.sso-login.main" />
+      <extension name="coverage">
+        <pattern>
+          <option name="PATTERN" value="com.sso.login.*" />
+          <option name="ENABLED" value="true" />
+        </pattern>
+      </extension>
+      <option name="SPRING_BOOT_MAIN_CLASS" value="com.sso.login.LoginApp" />
+      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/sso-login" />
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
+      <option name="ALTERNATIVE_JRE_PATH" value="1.8" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
+    <configuration name="MainApp" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" temporary="true" nameIsGenerated="true">
+      <module name="sso_wd_01.sso-main.main" />
+      <extension name="coverage">
+        <pattern>
+          <option name="PATTERN" value="com.sso.main.*" />
+          <option name="ENABLED" value="true" />
+        </pattern>
+      </extension>
+      <option name="SPRING_BOOT_MAIN_CLASS" value="com.sso.main.MainApp" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
+    <configuration name="VipApp" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" temporary="true" nameIsGenerated="true">
+      <module name="sso_wd_01.sso-vip.main" />
+      <extension name="coverage">
+        <pattern>
+          <option name="PATTERN" value="com.sso.vip.*" />
+          <option name="ENABLED" value="true" />
+        </pattern>
+      </extension>
+      <option name="SPRING_BOOT_MAIN_CLASS" value="com.sso.vip.VipApp" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
+    <list>
+      <item itemvalue="Spring Boot.LoginApp" />
+      <item itemvalue="Spring Boot.MainApp" />
+      <item itemvalue="Spring Boot.VipApp" />
+      <item itemvalue="Spring Boot.CartApp" />
+      <item itemvalue="Spring Boot.LoginApp (1)" />
+    </list>
+    <recent_temporary>
+      <list>
+        <item itemvalue="Spring Boot.CartApp" />
+        <item itemvalue="Spring Boot.VipApp" />
+        <item itemvalue="Spring Boot.MainApp" />
+        <item itemvalue="Spring Boot.LoginApp" />
+        <item itemvalue="Spring Boot.LoginApp (1)" />
+      </list>
+    </recent_temporary>
+  </component>
+  <component name="ServiceViewManager">
+    <option name="viewStates">
+      <list>
+        <serviceView>
+          <option name="contentProportion" value="0.24" />
+          <treeState>
+            <expand>
+              <path>
+                <item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
+                <item name="Spring Boot" type="7427dc5b:ServiceModel$ServiceGroupNode" />
+              </path>
+              <path>
+                <item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
+                <item name="Spring Boot" type="7427dc5b:ServiceModel$ServiceGroupNode" />
+                <item name="配置" type="7427dc5b:ServiceModel$ServiceGroupNode" />
+              </path>
+            </expand>
+            <select />
+          </treeState>
+        </serviceView>
+      </list>
+    </option>
+  </component>
+  <component name="SvnConfiguration">
+    <configuration />
+  </component>
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="967fc17b-984f-4cf8-90bd-651b5cc2fdb5" name="Default Changelist" comment="" />
+      <created>1608603475887</created>
+      <option name="number" value="Default" />
+      <option name="presentableId" value="Default" />
+      <updated>1608603475887</updated>
+      <workItem from="1608603477228" duration="208000" />
+      <workItem from="1608603725735" duration="3482000" />
+      <workItem from="1608609734617" duration="90000" />
+      <workItem from="1608683465994" duration="10492000" />
+      <workItem from="1608701359290" duration="5043000" />
+      <workItem from="1608714875698" duration="9567000" />
+      <workItem from="1608769703311" duration="4373000" />
+      <workItem from="1608774096655" duration="919000" />
+      <workItem from="1608778001121" duration="227000" />
+      <workItem from="1609116373942" duration="1171000" />
+    </task>
+    <servers />
+  </component>
+  <component name="TypeScriptGeneratedFilesManager">
+    <option name="version" value="1" />
+  </component>
+  <component name="WindowStateProjectService">
+    <state x="654" y="0" width="744" height="824" key="#CartApp" timestamp="1608687906064">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state x="654" y="0" width="744" height="824" key="#CartApp/0.0.1536.824@0.0.1536.824" timestamp="1608687906064" />
+    <state x="194" y="49" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1608719176899">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state x="194" y="49" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1536.824@0.0.1536.824" timestamp="1608719176899" />
+    <state x="196" y="193" key="#com.intellij.ide.util.MemberChooser" timestamp="1608722111605">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state x="196" y="193" key="#com.intellij.ide.util.MemberChooser/0.0.1536.824@0.0.1536.824" timestamp="1608722111605" />
+    <state x="750" y="180" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog" timestamp="1608687390196">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state x="750" y="180" key="#com.intellij.refactoring.safeDelete.UnsafeUsagesDialog/0.0.1536.824@0.0.1536.824" timestamp="1608687390196" />
+    <state x="553" y="93" key="#项目结构" timestamp="1608686450164">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state x="553" y="93" key="#项目结构/0.0.1536.824@0.0.1536.824" timestamp="1608686450164" />
+    <state x="975" y="190" key="FileChooserDialogImpl" timestamp="1608719174829">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state x="975" y="190" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1608719174829" />
+    <state width="762" height="238" key="GridCell.Tab.0.bottom" timestamp="1608778227874">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state width="762" height="238" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1608778227874" />
+    <state width="762" height="238" key="GridCell.Tab.0.center" timestamp="1608778227874">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state width="762" height="238" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1608778227874" />
+    <state width="762" height="238" key="GridCell.Tab.0.left" timestamp="1608778227874">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state width="762" height="238" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1608778227874" />
+    <state width="762" height="238" key="GridCell.Tab.0.right" timestamp="1608778227874">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state width="762" height="238" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1608778227874" />
+    <state width="762" height="238" key="GridCell.Tab.1.bottom" timestamp="1608778227874">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state width="762" height="238" key="GridCell.Tab.1.bottom/0.0.1536.824@0.0.1536.824" timestamp="1608778227874" />
+    <state width="762" height="238" key="GridCell.Tab.1.center" timestamp="1608778227874">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state width="762" height="238" key="GridCell.Tab.1.center/0.0.1536.824@0.0.1536.824" timestamp="1608778227874" />
+    <state width="762" height="238" key="GridCell.Tab.1.left" timestamp="1608778227874">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state width="762" height="238" key="GridCell.Tab.1.left/0.0.1536.824@0.0.1536.824" timestamp="1608778227874" />
+    <state width="762" height="238" key="GridCell.Tab.1.right" timestamp="1608778227874">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state width="762" height="238" key="GridCell.Tab.1.right/0.0.1536.824@0.0.1536.824" timestamp="1608778227874" />
+    <state x="593" y="161" key="IDE.errors.dialog" timestamp="1608603740527">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state x="593" y="161" key="IDE.errors.dialog/0.0.1536.824@0.0.1536.824" timestamp="1608603740527" />
+    <state x="355" y="38" key="SettingsEditor" timestamp="1608609757073">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state x="355" y="38" key="SettingsEditor/0.0.1536.824@0.0.1536.824" timestamp="1608609757073" />
+    <state x="751" y="332" key="com.intellij.ide.util.TipDialog" timestamp="1608774244312">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state x="751" y="332" key="com.intellij.ide.util.TipDialog/0.0.1536.824@0.0.1536.824" timestamp="1608774244312" />
+    <state x="108" y="190" width="1373" height="574" key="dock-window-1" timestamp="1608775015981">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state x="108" y="190" width="1373" height="574" key="dock-window-1/0.0.1536.824@0.0.1536.824" timestamp="1608775015981" />
+    <state x="142" y="222" width="961" height="637" key="dock-window-2" timestamp="1608772545452">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state x="142" y="222" width="961" height="637" key="dock-window-2/0.0.1536.824@0.0.1536.824" timestamp="1608772545452" />
+    <state x="93" y="205" width="1232" height="619" key="dock-window-3" timestamp="1608773340101">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state x="93" y="205" width="1232" height="619" key="dock-window-3/0.0.1536.824@0.0.1536.824" timestamp="1608773340101" />
+    <state x="239" y="133" width="694" height="522" key="dock-window-4" timestamp="1608773459812">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state x="239" y="133" width="694" height="522" key="dock-window-4/0.0.1536.824@0.0.1536.824" timestamp="1608773459812" />
+    <state x="454" y="54" width="832" height="688" key="new project wizard" timestamp="1608604192506">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state x="454" y="54" width="832" height="688" key="new project wizard/0.0.1536.824@0.0.1536.824" timestamp="1608604192506" />
+    <state x="360" y="341" key="run.anything.popup" timestamp="1608718954377">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state x="360" y="341" key="run.anything.popup/0.0.1536.824@0.0.1536.824" timestamp="1608718954377" />
+    <state x="820" y="145" width="672" height="678" key="search.everywhere.popup" timestamp="1608717766034">
+      <screen x="0" y="0" width="1536" height="824" />
+    </state>
+    <state x="820" y="145" width="672" height="678" key="search.everywhere.popup/0.0.1536.824@0.0.1536.824" timestamp="1608717766034" />
+  </component>
+</project>

+ 37 - 0
build.gradle

@@ -0,0 +1,37 @@
+buildscript {
+    repositories {
+        mavenLocal()
+        mavenCentral()
+    }
+    ext{
+        springBootVersion = '2.1.3.RELEASE'
+    }
+    dependencies {
+        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
+    }
+}
+//子工程的(都可使用)
+subprojects {
+    group'com.weidong'
+    version '1.0-SNAPSHOT'
+    apply plugin:'java'
+    apply plugin: 'io.spring.dependency-management'
+    apply plugin: 'org.springframework.boot'
+
+    repositories {
+        mavenLocal()
+        mavenCentral()
+    }
+
+    dependencies {
+        compile 'org.springframework.boot:spring-boot-starter-web'
+        annotationProcessor 'org.projectlombok:lombok:1.18.2'
+        compileOnly 'org.projectlombok:lombok:1.18.2'
+        compile 'org.springframework.boot:spring-boot-starter-thymeleaf'
+        compile("org.springframework.boot:spring-boot-devtools")
+
+    }
+}
+
+
+

+ 6 - 0
settings.gradle

@@ -0,0 +1,6 @@
+rootProject.name = 'sso_wd_01'
+include 'sso-main'
+include 'sso-vip'
+include 'sso-cart'
+include 'sso-login'
+

+ 0 - 0
sso-cart/build.gradle


BIN
sso-cart/build/classes/java/main/com/sso/cart/CartApp.class


BIN
sso-cart/build/classes/java/main/com/sso/cart/controller/ViewController.class


+ 2 - 0
sso-cart/build/resources/main/application.yml

@@ -0,0 +1,2 @@
+server:
+  port: 9012

+ 18 - 0
sso-cart/build/resources/main/templates/index.html

@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
+<head>
+    <meta charset="UTF-8">
+    <title>Cart</title>
+</head>
+<body>
+    <h2>欢迎Cart页面</h2>
+<!--    <a href="http://login.codeshop.com:9000/view/login?target=http://cart.codeshop.com:9012/view/index">登录</a>-->
+    <span>
+        <a th:if="${session.loginUser == null}" href="http://login.codeshop.com:9000/view/login?target=http://cart.codeshop.com:9012/view/index">登录</a>
+        <a th:unless="${session.loginUser == null}" href="#">退出</a>
+    </span>
+    <p th:unless="${session.loginUser == null}">
+        <span style="color: deepskyblue;" th:text="${session.loginUser.username}"></span>已登录
+    </p>
+</body>
+</html>

+ 4 - 0
sso-cart/build/tmp/compileJava/source-classes-mapping.txt

@@ -0,0 +1,4 @@
+com/sso/cart/CartApp.java
+ com.sso.cart.CartApp
+com/sso/cart/controller/ViewController.java
+ com.sso.cart.controller.ViewController

+ 20 - 0
sso-cart/src/main/java/com/sso/cart/CartApp.java

@@ -0,0 +1,20 @@
+package com.sso.cart;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.Calendar;
+
+@SpringBootApplication
+public class CartApp {
+    public static void main(String[] args) {
+        SpringApplication.run(CartApp.class,args);
+    }
+    @Bean
+    public RestTemplate restTemplate(){
+        return new RestTemplate();
+    }
+
+}

+ 36 - 0
sso-cart/src/main/java/com/sso/cart/controller/ViewController.java

@@ -0,0 +1,36 @@
+package com.sso.cart.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.CookieValue;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.client.RestTemplate;
+import org.thymeleaf.util.StringUtils;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpSession;
+import java.util.Map;
+
+@Controller
+@RequestMapping("/view")
+public class ViewController {
+    @Autowired
+    private RestTemplate restTemplate;
+    private final String USER_INFO_ADDRESS="http://login.codeshop.com:9000/login/info?token=";
+    @GetMapping("/index")
+    public String toIndex(@CookieValue(required = false,value = "TOKEN") Cookie cookie,
+                          HttpSession session){
+        if(cookie != null){
+            String token = cookie.getValue();
+            if(!StringUtils.isEmpty(token)){
+                Map result = restTemplate.getForObject(USER_INFO_ADDRESS + token,
+                        Map.class);
+                session.setAttribute("loginUser",result);
+            }
+        }
+
+        return "index";
+    }
+
+}

+ 2 - 0
sso-cart/src/main/resources/application.yml

@@ -0,0 +1,2 @@
+server:
+  port: 9012

+ 18 - 0
sso-cart/src/main/resources/templates/index.html

@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
+<head>
+    <meta charset="UTF-8">
+    <title>Cart</title>
+</head>
+<body>
+    <h2>欢迎Cart页面</h2>
+<!--    <a href="http://login.codeshop.com:9000/view/login?target=http://cart.codeshop.com:9012/view/index">登录</a>-->
+    <span>
+        <a th:if="${session.loginUser == null}" href="http://login.codeshop.com:9000/view/login?target=http://cart.codeshop.com:9012/view/index">登录</a>
+        <a th:unless="${session.loginUser == null}" href="#">退出</a>
+    </span>
+    <p th:unless="${session.loginUser == null}">
+        <span style="color: deepskyblue;" th:text="${session.loginUser.username}"></span>已登录
+    </p>
+</body>
+</html>

+ 0 - 0
sso-login/build.gradle


BIN
sso-login/build/classes/java/main/com/sso/login/LoginApp.class


BIN
sso-login/build/classes/java/main/com/sso/login/controller/LoginController.class


BIN
sso-login/build/classes/java/main/com/sso/login/controller/ViewController.class


BIN
sso-login/build/classes/java/main/com/sso/login/pojo/User.class


BIN
sso-login/build/classes/java/main/com/sso/login/utils/LoginCacheUtil.class


+ 3 - 0
sso-login/build/resources/main/application.yml

@@ -0,0 +1,3 @@
+#登录模块的端口
+server:
+  port: 9000

+ 17 - 0
sso-login/build/resources/main/templates/login.html

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
+<head>
+    <meta charset="UTF-8">
+    <title>Login</title>
+</head>
+<body>
+    <h2>登录页面</h2>
+    <p style="color: red;" th:text="${session.msg}"></p>
+    <form action="/login" method="POST">
+        用户名:<input name="username" value="">
+        密码:<input name="password" value=""><br>
+        <button type="submit">登录</button>
+    </form>
+
+</body>
+</html>

+ 10 - 0
sso-login/build/tmp/compileJava/source-classes-mapping.txt

@@ -0,0 +1,10 @@
+com/sso/login/LoginApp.java
+ com.sso.login.LoginApp
+com/sso/login/utils/LoginCacheUtil.java
+ com.sso.login.utils.LoginCacheUtil
+com/sso/login/controller/ViewController.java
+ com.sso.login.controller.ViewController
+com/sso/login/pojo/User.java
+ com.sso.login.pojo.User
+com/sso/login/controller/LoginController.java
+ com.sso.login.controller.LoginController

+ 11 - 0
sso-login/src/main/java/com/sso/login/LoginApp.java

@@ -0,0 +1,11 @@
+package com.sso.login;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class LoginApp {
+    public static void main(String[] args) {
+        SpringApplication.run(LoginApp.class,args);
+    }
+}

+ 65 - 0
sso-login/src/main/java/com/sso/login/controller/LoginController.java

@@ -0,0 +1,65 @@
+package com.sso.login.controller;
+
+import com.sso.login.pojo.User;
+import com.sso.login.utils.LoginCacheUtil;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+import org.thymeleaf.util.StringUtils;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.util.*;
+
+@Controller
+//映射
+@RequestMapping("/login")
+public class LoginController {
+    private static Set<User> dbUsers;
+    static {
+        dbUsers = new HashSet<>();
+        dbUsers.add(new User(0,"zhangsan","12345"));
+        dbUsers.add(new User(1,"lisi","123456"));
+        dbUsers.add(new User(2,"wangwu","1234567"));
+    }
+    @PostMapping
+    public String doLogin(User user, HttpSession session, HttpServletResponse response){
+
+        //获取重定向页面
+        String target = (String) session.getAttribute("target");
+        //模拟从数据库通过登录的用户名和密码去查找数据库中的用户
+        Optional<User> first = dbUsers.stream().filter(dbUser -> dbUser.getUsername().equals(user.getUsername()) &&
+                dbUser.getPassword().equals(user.getPassword()))
+                .findFirst();
+        //判断用户是否登录
+        if(first.isPresent()){
+            //保存用户信息
+            String token = UUID.randomUUID().toString();
+            Cookie cookie = new Cookie("TOKEN",token);
+            cookie.setDomain("codeshop.com");
+            response.addCookie(cookie);
+            LoginCacheUtil.loginUser.put(token,first.get());
+        } else {
+            //登录失败
+            session.setAttribute("msg","用户名或密码错误");
+            return "login";
+        }
+        //重定向到target地址
+        return "redirect:"+target;
+    }
+
+    @GetMapping("info")
+    @ResponseBody
+    public ResponseEntity<User> getUserInfo(String token){
+        if (!StringUtils.isEmpty(token)){
+            User user = LoginCacheUtil.loginUser.get(token);
+            return ResponseEntity.ok(user);
+
+        }else {
+            return new ResponseEntity<>(null, HttpStatus.BAD_GATEWAY);
+        }
+    }
+
+}

+ 44 - 0
sso-login/src/main/java/com/sso/login/controller/ViewController.java

@@ -0,0 +1,44 @@
+package com.sso.login.controller;
+
+import com.sso.login.pojo.User;
+import com.sso.login.utils.LoginCacheUtil;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.CookieValue;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.thymeleaf.util.StringUtils;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpSession;
+
+@Controller
+@RequestMapping("/view")
+public class ViewController {
+    @GetMapping("/login")
+    public String toLogin(@RequestParam(required = false, defaultValue = "") String target,
+                          HttpSession session,
+                          @CookieValue(required = false, value = "TOkEN") Cookie cookie) {
+
+        //判断target是否为空
+        if (StringUtils.isEmpty(target)) {
+
+            target = "http://www.codeshop.com:9010";
+        }
+        //如果是已经登录的用户再次访问登录系统时,就重定向
+        if (cookie != null) {
+
+            String value = cookie.getValue();
+            User user = LoginCacheUtil.loginUser.get(value);
+            if (user != null) {
+                return "redirect:" + target;
+            }
+
+        }
+        //将地址存储起来(重定义地址)
+        session.setAttribute("target", target);
+
+        return "login";
+    }
+
+}

+ 53 - 0
sso-login/src/main/java/com/sso/login/pojo/User.java

@@ -0,0 +1,53 @@
+package com.sso.login.pojo;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+/**
+ * @Data //添加getter/setter
+ * @NoArgsConstructor  //添加无参构造器
+ * @AllArgsConstructor //添加全参构造器
+ * @Accessors(chain = true) //添加链式调用
+ */
+
+public class User {
+    private Integer id;
+    private String username;
+    private String password;
+
+    public User(Integer id, String username, String password) {
+        this.id = id;
+        this.username = username;
+        this.password = password;
+    }
+
+    public User() {
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+}
+

+ 12 - 0
sso-login/src/main/java/com/sso/login/utils/LoginCacheUtil.java

@@ -0,0 +1,12 @@
+package com.sso.login.utils;
+
+
+import com.sso.login.pojo.User;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class LoginCacheUtil {
+    public static Map<String, User> loginUser = new HashMap<>();
+
+}

+ 3 - 0
sso-login/src/main/resources/application.yml

@@ -0,0 +1,3 @@
+#登录模块的端口
+server:
+  port: 9000

+ 17 - 0
sso-login/src/main/resources/templates/login.html

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
+<head>
+    <meta charset="UTF-8">
+    <title>Login</title>
+</head>
+<body>
+    <h2>登录页面</h2>
+    <p style="color: red;" th:text="${session.msg}"></p>
+    <form action="/login" method="POST">
+        用户名:<input name="username" value="">
+        密码:<input name="password" value=""><br>
+        <button type="submit">登录</button>
+    </form>
+
+</body>
+</html>

+ 0 - 0
sso-main/build.gradle


BIN
sso-main/build/classes/java/main/com/sso/main/MainApp.class


BIN
sso-main/build/classes/java/main/com/sso/main/controller/ViewController.class


+ 3 - 0
sso-main/build/resources/main/application.yml

@@ -0,0 +1,3 @@
+#登录模块的端口
+server:
+  port: 9010

+ 20 - 0
sso-main/build/resources/main/templates/index.html

@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
+<head>
+    <meta charset="UTF-8">
+    <title>Login Module</title>
+</head>
+<body>
+    <h1> 首页 </h1>
+    <span>
+        <!--  target:从哪跳转过来  -->
+        <a th:if="${session.loginUser == null}" href="http://login.codeshop.com:9000/view/login?target=http://www.codeshop.com:9010/view/index">登录</a>
+        <a th:unless="${session.loginUser == null}" href="#">退出</a>
+    </span>
+
+    <P th:unless="${session.loginUser == null}">
+        <span style="color: blue" th:text="${session.loginUser.username}"></span>已登录
+    </P>
+
+</body>
+</html>

+ 4 - 0
sso-main/build/tmp/compileJava/source-classes-mapping.txt

@@ -0,0 +1,4 @@
+com/sso/main/MainApp.java
+ com.sso.main.MainApp
+com/sso/main/controller/ViewController.java
+ com.sso.main.controller.ViewController

+ 17 - 0
sso-main/src/main/java/com/sso/main/MainApp.java

@@ -0,0 +1,17 @@
+package com.sso.main;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.web.client.RestTemplate;
+
+@SpringBootApplication
+public class MainApp {
+    public static void main(String[] args) {
+        SpringApplication.run(MainApp.class,args);
+    }
+    @Bean
+    public RestTemplate restTemplate(){
+        return new RestTemplate();
+    }
+}

+ 34 - 0
sso-main/src/main/java/com/sso/main/controller/ViewController.java

@@ -0,0 +1,34 @@
+package com.sso.main.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.CookieValue;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.client.RestTemplate;
+import org.thymeleaf.util.StringUtils;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpSession;
+import java.util.Map;
+
+@Controller
+@RequestMapping("/view")
+public class ViewController {
+    @Autowired
+    private RestTemplate restTemplate;
+    private final String LOGIN_INFO_ADDRESS = "http://login.codeshop.com:9000/login/info?token=";
+
+    @GetMapping("/index")
+    public String toIndex(@CookieValue(required = false,value = "TOKEN") Cookie cookie, HttpSession session){
+        if(cookie != null){
+            String token = cookie.getValue();
+            if(!StringUtils.isEmpty(token)){
+                Map result = restTemplate.getForObject(LOGIN_INFO_ADDRESS + token, Map.class);
+                session.setAttribute("loginUser",result);
+            }
+        }
+        return "index";
+    }
+
+}

+ 3 - 0
sso-main/src/main/resources/application.yml

@@ -0,0 +1,3 @@
+#登录模块的端口
+server:
+  port: 9010

+ 20 - 0
sso-main/src/main/resources/templates/index.html

@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
+<head>
+    <meta charset="UTF-8">
+    <title>Login Module</title>
+</head>
+<body>
+    <h1> 首页 </h1>
+    <span>
+        <!--  target:从哪跳转过来  -->
+        <a th:if="${session.loginUser == null}" href="http://login.codeshop.com:9000/view/login?target=http://www.codeshop.com:9010/view/index">登录</a>
+        <a th:unless="${session.loginUser == null}" href="#">退出</a>
+    </span>
+
+    <P th:unless="${session.loginUser == null}">
+        <span style="color: blue" th:text="${session.loginUser.username}"></span>已登录
+    </P>
+
+</body>
+</html>

+ 1 - 0
sso-vip/build.gradle

@@ -0,0 +1 @@
+

BIN
sso-vip/build/classes/java/main/com/sso/vip/VipApp.class


BIN
sso-vip/build/classes/java/main/com/sso/vip/controller/ViewController.class


+ 2 - 0
sso-vip/build/resources/main/application.yml

@@ -0,0 +1,2 @@
+server:
+  port: 9011

+ 17 - 0
sso-vip/build/resources/main/templates/index.html

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
+<head>
+    <meta charset="UTF-8">
+    <title>Vip</title>
+</head>
+<body>
+    <h2>欢迎vip</h2>
+    <span>
+        <a th:if="${session.loginUser == null}" href="http://login.codeshop.com:9000/view/login?target=http://vip.codeshop.com:9011/view/index">登录</a>
+        <a th:unless="${session.loginUser == null}" href="#">退出</a>
+    </span>
+    <p th:unless="${session.loginUser == null}">
+        <span style="color: deepskyblue;" th:text="${session.loginUser.username}"></span>已登录
+    </p>
+</body>
+</html>

+ 4 - 0
sso-vip/build/tmp/compileJava/source-classes-mapping.txt

@@ -0,0 +1,4 @@
+com/sso/vip/VipApp.java
+ com.sso.vip.VipApp
+com/sso/vip/controller/ViewController.java
+ com.sso.vip.controller.ViewController

+ 17 - 0
sso-vip/src/main/java/com/sso/vip/VipApp.java

@@ -0,0 +1,17 @@
+package com.sso.vip;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.web.client.RestTemplate;
+
+@SpringBootApplication
+public class VipApp {
+    public static void main(String[] args) {
+        SpringApplication.run(VipApp.class,args);
+    }
+    @Bean
+    public RestTemplate restTemplate(){
+        return new RestTemplate();
+    }
+}

+ 35 - 0
sso-vip/src/main/java/com/sso/vip/controller/ViewController.java

@@ -0,0 +1,35 @@
+package com.sso.vip.controller;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.CookieValue;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.client.RestTemplate;
+import org.thymeleaf.util.StringUtils;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpSession;
+import java.util.Map;
+
+@Controller
+@RequestMapping("/view")
+public class ViewController {
+    @Autowired
+    private RestTemplate restTemplate;
+    private final String USER_INFO_ADDRESS = "http://login.codeshop.com:9000/login/info?token=";
+    @GetMapping("/index")
+    public String toIndex(@CookieValue(required = false,value = "TOKEN")Cookie cookie,
+                          HttpSession session){
+        if (cookie != null){
+            String token = cookie.getValue();
+            if(!StringUtils.isEmpty(token)){
+                Map result = restTemplate.getForObject(USER_INFO_ADDRESS + token, Map.class);
+                session.setAttribute("loginUser",result);
+
+            }
+        }
+        return "index";
+    }
+
+}

+ 2 - 0
sso-vip/src/main/resources/application.yml

@@ -0,0 +1,2 @@
+server:
+  port: 9011

+ 17 - 0
sso-vip/src/main/resources/templates/index.html

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
+<head>
+    <meta charset="UTF-8">
+    <title>Vip</title>
+</head>
+<body>
+    <h2>欢迎vip</h2>
+    <span>
+        <a th:if="${session.loginUser == null}" href="http://login.codeshop.com:9000/view/login?target=http://vip.codeshop.com:9011/view/index">登录</a>
+        <a th:unless="${session.loginUser == null}" href="#">退出</a>
+    </span>
+    <p th:unless="${session.loginUser == null}">
+        <span style="color: deepskyblue;" th:text="${session.loginUser.username}"></span>已登录
+    </p>
+</body>
+</html>