Browse Source

初始提交

taizhimin 5 years ago
commit
3185db206a
31 changed files with 1354 additions and 0 deletions
  1. 25 0
      .gitignore
  2. 66 0
      pom.xml
  3. 25 0
      sys/.gitignore
  4. BIN
      sys/.mvn/wrapper/maven-wrapper.jar
  5. 1 0
      sys/.mvn/wrapper/maven-wrapper.properties
  6. 286 0
      sys/mvnw
  7. 161 0
      sys/mvnw.cmd
  8. 24 0
      sys/pom.xml
  9. 18 0
      sys/src/main/java/com/rxida/xilinedu/sys/SysApplication.java
  10. 43 0
      sys/src/main/java/com/rxida/xilinedu/sys/common/JsonResult.java
  11. 56 0
      sys/src/main/java/com/rxida/xilinedu/sys/common/ShiroConfiguration.java
  12. 62 0
      sys/src/main/java/com/rxida/xilinedu/sys/common/SystemAuthorizingRealm.java
  13. 16 0
      sys/src/main/java/com/rxida/xilinedu/sys/dao/MenuDao.java
  14. 4 0
      sys/src/main/java/com/rxida/xilinedu/sys/dao/RoleDao.java
  15. 18 0
      sys/src/main/java/com/rxida/xilinedu/sys/dao/UserDao.java
  16. 99 0
      sys/src/main/java/com/rxida/xilinedu/sys/entity/Menu.java
  17. 31 0
      sys/src/main/java/com/rxida/xilinedu/sys/entity/Permission.java
  18. 43 0
      sys/src/main/java/com/rxida/xilinedu/sys/entity/Role.java
  19. 70 0
      sys/src/main/java/com/rxida/xilinedu/sys/entity/User.java
  20. 8 0
      sys/src/main/java/com/rxida/xilinedu/sys/service/LoginService.java
  21. 31 0
      sys/src/main/java/com/rxida/xilinedu/sys/service/MenuService.java
  22. 31 0
      sys/src/main/java/com/rxida/xilinedu/sys/service/UserService.java
  23. 13 0
      sys/src/main/java/com/rxida/xilinedu/sys/web/AutherController.java
  24. 53 0
      sys/src/main/java/com/rxida/xilinedu/sys/web/LoginController.java
  25. 36 0
      sys/src/main/java/com/rxida/xilinedu/sys/web/MenuController.java
  26. 31 0
      sys/src/main/java/com/rxida/xilinedu/sys/web/UserController.java
  27. 12 0
      sys/src/main/resources/application.yml
  28. 13 0
      sys/src/main/resources/mapper/sys/MenuDao.xml
  29. 47 0
      sys/src/main/resources/mapper/sys/UserDao.xml
  30. 14 0
      sys/src/main/resources/templates/login.html
  31. 17 0
      sys/src/test/java/com/rxida/xilinedu/sys/SysApplicationTests.java

+ 25 - 0
.gitignore

@@ -0,0 +1,25 @@
+/target/
+!.mvn/wrapper/maven-wrapper.jar
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/build/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/

+ 66 - 0
pom.xml

@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.1.2.RELEASE</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+    <groupId>com.rxida</groupId>
+    <artifactId>xilinedu</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>xilinedu_new</name>
+    <description>Demo project for Spring Boot</description>
+    <packaging>pom</packaging>
+
+    <properties>
+        <java.version>1.8</java.version>
+    </properties>
+
+    <modules>
+        <module>sys</module>
+    </modules>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-thymeleaf</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-jdbc</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.mybatis.spring.boot</groupId>
+            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <version>2.0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

+ 25 - 0
sys/.gitignore

@@ -0,0 +1,25 @@
+/target/
+!.mvn/wrapper/maven-wrapper.jar
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/build/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/

BIN
sys/.mvn/wrapper/maven-wrapper.jar


+ 1 - 0
sys/.mvn/wrapper/maven-wrapper.properties

@@ -0,0 +1 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip

+ 286 - 0
sys/mvnw

@@ -0,0 +1,286 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven2 Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+#   JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+#   M2_HOME - location of maven2's installed home dir
+#   MAVEN_OPTS - parameters passed to the Java VM when running Maven
+#     e.g. to debug Maven itself, use
+#       set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+#   MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# ----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ] ; then
+
+  if [ -f /etc/mavenrc ] ; then
+    . /etc/mavenrc
+  fi
+
+  if [ -f "$HOME/.mavenrc" ] ; then
+    . "$HOME/.mavenrc"
+  fi
+
+fi
+
+# OS specific support.  $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "`uname`" in
+  CYGWIN*) cygwin=true ;;
+  MINGW*) mingw=true;;
+  Darwin*) darwin=true
+    # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+    # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+    if [ -z "$JAVA_HOME" ]; then
+      if [ -x "/usr/libexec/java_home" ]; then
+        export JAVA_HOME="`/usr/libexec/java_home`"
+      else
+        export JAVA_HOME="/Library/Java/Home"
+      fi
+    fi
+    ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+  if [ -r /etc/gentoo-release ] ; then
+    JAVA_HOME=`java-config --jre-home`
+  fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+  ## resolve links - $0 may be a link to maven's home
+  PRG="$0"
+
+  # need this for relative symlinks
+  while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+      PRG="$link"
+    else
+      PRG="`dirname "$PRG"`/$link"
+    fi
+  done
+
+  saveddir=`pwd`
+
+  M2_HOME=`dirname "$PRG"`/..
+
+  # make it fully qualified
+  M2_HOME=`cd "$M2_HOME" && pwd`
+
+  cd "$saveddir"
+  # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME=`cygpath --unix "$M2_HOME"`
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# For Mingw, ensure paths are in UNIX format before anything is touched
+if $mingw ; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME="`(cd "$M2_HOME"; pwd)`"
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
+  # TODO classpath?
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+  javaExecutable="`which javac`"
+  if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
+    # readlink(1) is not available as standard on Solaris 10.
+    readLink=`which readlink`
+    if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
+      if $darwin ; then
+        javaHome="`dirname \"$javaExecutable\"`"
+        javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
+      else
+        javaExecutable="`readlink -f \"$javaExecutable\"`"
+      fi
+      javaHome="`dirname \"$javaExecutable\"`"
+      javaHome=`expr "$javaHome" : '\(.*\)/bin'`
+      JAVA_HOME="$javaHome"
+      export JAVA_HOME
+    fi
+  fi
+fi
+
+if [ -z "$JAVACMD" ] ; then
+  if [ -n "$JAVA_HOME"  ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+      # IBM's JDK on AIX uses strange locations for the executables
+      JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+      JAVACMD="$JAVA_HOME/bin/java"
+    fi
+  else
+    JAVACMD="`which java`"
+  fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+  echo "Error: JAVA_HOME is not defined correctly." >&2
+  echo "  We cannot execute $JAVACMD" >&2
+  exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+  echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+
+  if [ -z "$1" ]
+  then
+    echo "Path not specified to find_maven_basedir"
+    return 1
+  fi
+
+  basedir="$1"
+  wdir="$1"
+  while [ "$wdir" != '/' ] ; do
+    if [ -d "$wdir"/.mvn ] ; then
+      basedir=$wdir
+      break
+    fi
+    # workaround for JBEAP-8937 (on Solaris 10/Sparc)
+    if [ -d "${wdir}" ]; then
+      wdir=`cd "$wdir/.."; pwd`
+    fi
+    # end of workaround
+  done
+  echo "${basedir}"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+  if [ -f "$1" ]; then
+    echo "$(tr -s '\n' ' ' < "$1")"
+  fi
+}
+
+BASE_DIR=`find_maven_basedir "$(pwd)"`
+if [ -z "$BASE_DIR" ]; then
+  exit 1;
+fi
+
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Found .mvn/wrapper/maven-wrapper.jar"
+    fi
+else
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+    fi
+    jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
+    while IFS="=" read key value; do
+      case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
+      esac
+    done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
+    if [ "$MVNW_VERBOSE" = true ]; then
+      echo "Downloading from: $jarUrl"
+    fi
+    wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+
+    if command -v wget > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found wget ... using wget"
+        fi
+        wget "$jarUrl" -O "$wrapperJarPath"
+    elif command -v curl > /dev/null; then
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Found curl ... using curl"
+        fi
+        curl -o "$wrapperJarPath" "$jarUrl"
+    else
+        if [ "$MVNW_VERBOSE" = true ]; then
+          echo "Falling back to using Java to download"
+        fi
+        javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+        if [ -e "$javaClass" ]; then
+            if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+                if [ "$MVNW_VERBOSE" = true ]; then
+                  echo " - Compiling MavenWrapperDownloader.java ..."
+                fi
+                # Compiling the Java class
+                ("$JAVA_HOME/bin/javac" "$javaClass")
+            fi
+            if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+                # Running the downloader
+                if [ "$MVNW_VERBOSE" = true ]; then
+                  echo " - Running MavenWrapperDownloader.java ..."
+                fi
+                ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+            fi
+        fi
+    fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
+if [ "$MVNW_VERBOSE" = true ]; then
+  echo $MAVEN_PROJECTBASEDIR
+fi
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+  [ -n "$M2_HOME" ] &&
+    M2_HOME=`cygpath --path --windows "$M2_HOME"`
+  [ -n "$JAVA_HOME" ] &&
+    JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+  [ -n "$CLASSPATH" ] &&
+    CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+  [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+    MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
+fi
+
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+exec "$JAVACMD" \
+  $MAVEN_OPTS \
+  -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+  "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+  ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

+ 161 - 0
sys/mvnw.cmd

@@ -0,0 +1,161 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements.  See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership.  The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License.  You may obtain a copy of the License at
+@REM
+@REM    http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied.  See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Maven2 Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM     e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on"  echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
+if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
+:skipRcPre
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM To isolate internal variables from possible post scripts, we use another setlocal
+@setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo Error: JAVA_HOME not found in your environment. >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto init
+
+echo.
+echo Error: JAVA_HOME is set to an invalid directory. >&2
+echo JAVA_HOME = "%JAVA_HOME%" >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+@REM ==== END VALIDATION ====
+
+:init
+
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
+@REM Fallback to current working directory if not found.
+
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
+
+set EXEC_DIR=%CD%
+set WDIR=%EXEC_DIR%
+:findBaseDir
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set WDIR=%CD%
+goto findBaseDir
+
+:baseDirFound
+set MAVEN_PROJECTBASEDIR=%WDIR%
+cd "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
+cd "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
+FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
+	IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+    echo Found %WRAPPER_JAR%
+) else (
+    echo Couldn't find %WRAPPER_JAR%, downloading it ...
+	echo Downloading from: %DOWNLOAD_URL%
+    powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
+    echo Finished downloading %WRAPPER_JAR%
+)
+@REM End of extension
+
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
+if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%" == "on" pause
+
+if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
+
+exit /B %ERROR_CODE%

+ 24 - 0
sys/pom.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.rxida</groupId>
+        <artifactId>xilinedu</artifactId>
+        <version>0.0.1-SNAPSHOT</version>
+    </parent>
+    <groupId>com.rxida.xilinedu</groupId>
+    <artifactId>sys</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>sys</name>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.shiro</groupId>
+            <artifactId>shiro-spring</artifactId>
+            <version>1.4.0</version>
+        </dependency>
+    </dependencies>
+
+</project>

+ 18 - 0
sys/src/main/java/com/rxida/xilinedu/sys/SysApplication.java

@@ -0,0 +1,18 @@
+package com.rxida.xilinedu.sys;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
+
+@ComponentScan("com.rxida")
+@MapperScan("*.dao")
+@SpringBootApplication
+public class SysApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(SysApplication.class, args);
+    }
+
+}
+

+ 43 - 0
sys/src/main/java/com/rxida/xilinedu/sys/common/JsonResult.java

@@ -0,0 +1,43 @@
+package com.rxida.xilinedu.sys.common;
+
+public class JsonResult {
+    public static final String ERROE = "1";
+    public static final String SUCCESS = "0";
+    private String msg;
+    private Object data;
+    private String status;
+
+    public JsonResult() {
+
+    }
+
+    public JsonResult(String msg, Object data, String status) {
+        this.msg = msg;
+        this.data = data;
+        this.status = status;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public Object getData() {
+        return data;
+    }
+
+    public void setData(Object data) {
+        this.data = data;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+}

+ 56 - 0
sys/src/main/java/com/rxida/xilinedu/sys/common/ShiroConfiguration.java

@@ -0,0 +1,56 @@
+package com.rxida.xilinedu.sys.common;
+
+import org.apache.shiro.mgt.SecurityManager;
+import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor;
+import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
+import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class ShiroConfiguration {
+    //将自己的验证方式加入容器
+    @Bean
+    public SystemAuthorizingRealm systemAuthorizingRealm() {
+        SystemAuthorizingRealm systemAuthorizingRealm = new SystemAuthorizingRealm();
+        return systemAuthorizingRealm;
+    }
+
+    //权限管理,配置主要是Realm的管理认证
+    @Bean
+    public SecurityManager securityManager() {
+        DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
+        securityManager.setRealm(systemAuthorizingRealm());
+        return securityManager;
+    }
+
+    //Filter工厂,设置对应的过滤条件和跳转条件
+    @Bean
+    public ShiroFilterFactoryBean shiroFilterFactoryBean(SecurityManager securityManager) {
+        ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
+        shiroFilterFactoryBean.setSecurityManager(securityManager);
+        Map<String, String> map = new HashMap<String, String>();
+        //登出
+        map.put("/logout", "logout");
+        //对所有用户认证
+        map.put("/a/**", "authc");
+        //登录
+        shiroFilterFactoryBean.setLoginUrl("/login");
+        //首页
+        shiroFilterFactoryBean.setSuccessUrl("/index");
+        //错误页面,认证不通过跳转
+        shiroFilterFactoryBean.setUnauthorizedUrl("/error");
+        shiroFilterFactoryBean.setFilterChainDefinitionMap(map);
+        return shiroFilterFactoryBean;
+    }
+
+    //加入注解的使用,不加入这个注解不生效
+    @Bean
+    public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(SecurityManager securityManager) {
+        AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor = new AuthorizationAttributeSourceAdvisor();
+        authorizationAttributeSourceAdvisor.setSecurityManager(securityManager);
+        return authorizationAttributeSourceAdvisor;
+    }
+}

+ 62 - 0
sys/src/main/java/com/rxida/xilinedu/sys/common/SystemAuthorizingRealm.java

@@ -0,0 +1,62 @@
+package com.rxida.xilinedu.sys.common;
+
+import com.rxida.xilinedu.sys.dao.UserDao;
+import com.rxida.xilinedu.sys.entity.Permission;
+import com.rxida.xilinedu.sys.entity.Role;
+import com.rxida.xilinedu.sys.entity.User;
+import org.apache.shiro.authc.AuthenticationException;
+import org.apache.shiro.authc.AuthenticationInfo;
+import org.apache.shiro.authc.AuthenticationToken;
+import org.apache.shiro.authc.SimpleAuthenticationInfo;
+import org.apache.shiro.authz.AuthorizationInfo;
+import org.apache.shiro.authz.SimpleAuthorizationInfo;
+import org.apache.shiro.realm.AuthorizingRealm;
+import org.apache.shiro.subject.PrincipalCollection;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.annotation.Resource;
+
+public class SystemAuthorizingRealm extends AuthorizingRealm {
+    @Autowired
+    private UserDao userDao;
+
+    //角色权限和对应权限添加
+    @Override
+    protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) {
+        //获取登录用户名
+        String name = (String) principalCollection.getPrimaryPrincipal();
+        //查询用户名称
+        User user = userDao.findByUsername(name);
+        //添加角色和权限
+        SimpleAuthorizationInfo simpleAuthorizationInfo = new SimpleAuthorizationInfo();
+        for (Role role : user.getRoles()) {
+            //添加角色
+            simpleAuthorizationInfo.addRole(role.getName());
+            for (Permission permission : role.getPermissions()) {
+                //添加权限
+                simpleAuthorizationInfo.addStringPermission(permission.getPermission());
+            }
+        }
+        return simpleAuthorizationInfo;
+    }
+
+    //用户认证
+    @Override
+    protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException {
+        //加这一步的目的是在Post请求的时候会先进认证,然后在到请求
+        if (authenticationToken.getPrincipal() == null) {
+            return null;
+        }
+        //获取用户信息
+        String name = authenticationToken.getPrincipal().toString();
+        User user = userDao.findByUsername(name);
+        if (user == null) {
+            //这里返回后会报出对应异常
+            return null;
+        } else {
+            //这里验证authenticationToken和simpleAuthenticationInfo的信息
+            SimpleAuthenticationInfo simpleAuthenticationInfo = new SimpleAuthenticationInfo(name, user.getPassword().toString(), getName());
+            return simpleAuthenticationInfo;
+        }
+    }
+}

+ 16 - 0
sys/src/main/java/com/rxida/xilinedu/sys/dao/MenuDao.java

@@ -0,0 +1,16 @@
+package com.rxida.xilinedu.sys.dao;
+
+import com.rxida.xilinedu.sys.entity.Menu;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface MenuDao {
+
+    void insert(Menu menu);
+
+    void update(Menu menu);
+
+    List<Menu> findAll();
+}

+ 4 - 0
sys/src/main/java/com/rxida/xilinedu/sys/dao/RoleDao.java

@@ -0,0 +1,4 @@
+package com.rxida.xilinedu.sys.dao;
+
+public interface RoleDao {
+}

+ 18 - 0
sys/src/main/java/com/rxida/xilinedu/sys/dao/UserDao.java

@@ -0,0 +1,18 @@
+package com.rxida.xilinedu.sys.dao;
+
+import com.rxida.xilinedu.sys.entity.User;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface UserDao {
+    List<User> findAll();
+
+    void insert(User user);
+
+    void update(User user);
+
+    User findByUsername(@Param(value = "username") String username);
+}

+ 99 - 0
sys/src/main/java/com/rxida/xilinedu/sys/entity/Menu.java

@@ -0,0 +1,99 @@
+package com.rxida.xilinedu.sys.entity;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+
+public class Menu {
+    private String id;
+    private String parentId;
+    private String name;
+    private String icon;
+    private String href;
+    private Integer sort;
+
+    public Integer getSort() {
+        return sort;
+    }
+
+    public void setSort(Integer sort) {
+        this.sort = sort;
+    }
+
+    private String component;
+
+    public String getComponent() {
+        return "MyTable";
+    }
+
+    public void setComponent(String component) {
+        this.component = component;
+    }
+
+    private List<Menu> items = new ArrayList<>();
+
+    public List<Menu> getItems() {
+        return items;
+    }
+
+    public void setItems(List<Menu> items) {
+        this.items = items;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getParentId() {
+        return parentId;
+    }
+
+    public void setParentId(String parentId) {
+        this.parentId = parentId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getIcon() {
+        return icon;
+    }
+
+    public void setIcon(String icon) {
+        this.icon = icon;
+    }
+
+    public String getHref() {
+        return "MyTable";
+    }
+
+    public void setHref(String href) {
+        this.href = href;
+    }
+
+    public static Menu getChild(Menu menu, List<Menu> menuList) {
+        for (Menu item : menuList) {
+            if (menu.getId().equals(item.getParentId())) {
+                menu.items.add(item);
+            }
+        }
+        for (Menu item : menu.items) {
+            getChild(item, menuList);
+        }
+        menu.items.sort(Comparator.comparing(Menu::getSort));
+        return menu;
+    }
+
+    public Menu getChild(List<Menu> menuList) {
+        return getChild(this, menuList);
+    }
+}

+ 31 - 0
sys/src/main/java/com/rxida/xilinedu/sys/entity/Permission.java

@@ -0,0 +1,31 @@
+package com.rxida.xilinedu.sys.entity;
+
+public class Permission {
+    private String id;
+    private String permission;
+    private Role role;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getPermission() {
+        return permission;
+    }
+
+    public void setPermission(String permission) {
+        this.permission = permission;
+    }
+
+    public Role getRole() {
+        return role;
+    }
+
+    public void setRole(Role role) {
+        this.role = role;
+    }
+}

+ 43 - 0
sys/src/main/java/com/rxida/xilinedu/sys/entity/Role.java

@@ -0,0 +1,43 @@
+package com.rxida.xilinedu.sys.entity;
+
+
+import java.util.List;
+
+public class Role {
+    private String id;
+    private String name;
+    private List<Permission> permissions;
+    private User user;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public List<Permission> getPermissions() {
+        return permissions;
+    }
+
+    public void setPermissions(List<Permission> permissions) {
+        this.permissions = permissions;
+    }
+
+    public User getUser() {
+        return user;
+    }
+
+    public void setUser(User user) {
+        this.user = user;
+    }
+}

+ 70 - 0
sys/src/main/java/com/rxida/xilinedu/sys/entity/User.java

@@ -0,0 +1,70 @@
+package com.rxida.xilinedu.sys.entity;
+
+
+import java.util.List;
+
+public class User {
+    private String id;
+    private String name;
+    private String username;
+    private String password;
+    private String email;
+    private String phone;
+    private List<Role> roles;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    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;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public List<Role> getRoles() {
+        return roles;
+    }
+
+    public void setRoles(List<Role> roles) {
+        this.roles = roles;
+    }
+}

+ 8 - 0
sys/src/main/java/com/rxida/xilinedu/sys/service/LoginService.java

@@ -0,0 +1,8 @@
+package com.rxida.xilinedu.sys.service;
+
+import org.springframework.stereotype.Service;
+
+@Service
+public class LoginService {
+
+}

+ 31 - 0
sys/src/main/java/com/rxida/xilinedu/sys/service/MenuService.java

@@ -0,0 +1,31 @@
+package com.rxida.xilinedu.sys.service;
+
+import com.rxida.xilinedu.sys.dao.MenuDao;
+import com.rxida.xilinedu.sys.entity.Menu;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.UUID;
+
+@Service
+@Transactional(readOnly = true)
+public class MenuService {
+    @Resource
+    private MenuDao menuDao;
+
+    public List<Menu> findAllList() {
+        return menuDao.findAll();
+    }
+
+    public void save(Menu menu) {
+        if (menu.getId() != null && !"".equals(menu.getId())) {
+            menuDao.insert(menu);
+        } else {
+            menu.setId(UUID.randomUUID().toString());
+            menuDao.update(menu);
+        }
+    }
+}

+ 31 - 0
sys/src/main/java/com/rxida/xilinedu/sys/service/UserService.java

@@ -0,0 +1,31 @@
+package com.rxida.xilinedu.sys.service;
+
+import com.rxida.xilinedu.sys.dao.UserDao;
+import com.rxida.xilinedu.sys.entity.User;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Service
+@Transactional(readOnly = true)
+public class UserService {
+    @Autowired
+    private UserDao userDao;
+
+    public List<User> findAll() {
+        return userDao.findAll();
+    }
+
+    public void save(User user) {
+        if (user.getId() == null || "".equals(user.getId())) {
+            //TODO  生成
+            user.setId("1111");
+            userDao.insert(user);
+        } else {
+            userDao.update(user);
+        }
+    }
+}

+ 13 - 0
sys/src/main/java/com/rxida/xilinedu/sys/web/AutherController.java

@@ -0,0 +1,13 @@
+package com.rxida.xilinedu.sys.web;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@RequestMapping("/login")
+@Controller
+public class AutherController {
+    @RequestMapping("")
+    public String toLogin() {
+        return "login";
+    }
+}

+ 53 - 0
sys/src/main/java/com/rxida/xilinedu/sys/web/LoginController.java

@@ -0,0 +1,53 @@
+package com.rxida.xilinedu.sys.web;
+
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.authc.*;
+import org.apache.shiro.subject.Subject;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+@Controller
+public class LoginController {
+    //退出的时候是get请求,主要是用于退出
+    @RequestMapping(value = "/login", method = RequestMethod.GET)
+    public String login() {
+        return "login";
+    }
+
+    //post登录
+    @RequestMapping(value = "/login", method = RequestMethod.POST)
+    public String login(String username, String password) {
+        //添加用户认证信息
+        Subject subject = SecurityUtils.getSubject();
+        UsernamePasswordToken usernamePasswordToken = new UsernamePasswordToken(username, password);
+        try {
+            subject.login(usernamePasswordToken);
+        } catch (UnknownAccountException uae) {
+        } catch (IncorrectCredentialsException ice) {
+        } catch (LockedAccountException lae) {
+        } catch (ExcessiveAttemptsException eae) {
+        } catch (AuthenticationException ae) {
+
+        }
+        return "login";
+    }
+
+    @RequestMapping(value = "/index")
+    public String index() {
+        return "index";
+    }
+
+    //登出
+    @RequestMapping(value = "/logout")
+    public String logout() {
+        return "logout";
+    }
+
+    //错误页面展示
+    @RequestMapping(value = "/error", method = RequestMethod.POST)
+    public String error() {
+        return "error ok!";
+    }
+
+}

+ 36 - 0
sys/src/main/java/com/rxida/xilinedu/sys/web/MenuController.java

@@ -0,0 +1,36 @@
+package com.rxida.xilinedu.sys.web;
+
+import com.rxida.xilinedu.sys.entity.Menu;
+import com.rxida.xilinedu.sys.service.MenuService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@CrossOrigin
+@RequestMapping("/menu")
+public class MenuController {
+    @Autowired
+    private MenuService menuService;
+
+    @RequestMapping("/tree")
+    public List<Menu> tree() {
+        Menu m = new Menu();
+        m.setId("1");
+        List<Menu> allList = menuService.findAllList();
+        return Menu.getChild(m, allList).getItems();
+    }
+
+    @RequestMapping("/list")
+    public List<Menu> list() {
+        return menuService.findAllList();
+    }
+
+    @RequestMapping("/save")
+    public void save(Menu menu) {
+        menuService.save(menu);
+    }
+}

+ 31 - 0
sys/src/main/java/com/rxida/xilinedu/sys/web/UserController.java

@@ -0,0 +1,31 @@
+package com.rxida.xilinedu.sys.web;
+
+import com.rxida.xilinedu.sys.common.JsonResult;
+import com.rxida.xilinedu.sys.entity.User;
+import com.rxida.xilinedu.sys.service.UserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/user")
+@CrossOrigin
+public class UserController {
+    @Autowired
+    private UserService userService;
+
+    @RequestMapping("/list")
+    public List<User> findAll() {
+        return userService.findAll();
+    }
+
+    @RequestMapping("/save")
+    public JsonResult save(User user) {
+        userService.save(user);
+        JsonResult result = new JsonResult();
+        return result;
+    }
+}

+ 12 - 0
sys/src/main/resources/application.yml

@@ -0,0 +1,12 @@
+server:
+  port: 80
+spring:
+  datasource:
+    driver-class-name: com.mysql.cj.jdbc.Driver
+    url: jdbc:mysql://localhost:3306/xilinedu?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&serverTimezone=UTC
+    username: root
+    password: root
+mybatis:
+  type-aliases-package: com.rxida.xilinedu.sys.dao
+  mapper-locations: 'classpath:mapper/**/*.xml'
+

+ 13 - 0
sys/src/main/resources/mapper/sys/MenuDao.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.rxida.xilinedu.sys.dao.MenuDao">
+    <select id="findAll" resultType="com.rxida.xilinedu.sys.entity.Menu">
+            SELECT * FROM sys_menu a
+    </select>
+    <insert id="insert" parameterType="com.rxida.xilinedu.sys.entity.Menu">
+
+    </insert>
+    <update id="update" parameterType="com.rxida.xilinedu.sys.entity.Menu">
+
+    </update>
+</mapper>

+ 47 - 0
sys/src/main/resources/mapper/sys/UserDao.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.rxida.xilinedu.sys.dao.UserDao">
+    <resultMap id="userResult" type="com.rxida.xilinedu.sys.entity.User">
+        <id property="id" column="id"/>
+        <result property="username" column="login_name"/>
+        <result property="password" column="password"/>
+        <result property="name" column="name"/>
+        <result property="email" column="email"/>
+        <result property="phone" column="phone"/>
+        <collection property="roles" ofType="com.rxida.xilinedu.sys.entity.Role">
+            <id property="id" column="roleList.id"/>
+            <result property="name" column="roleList.name"/>
+            <collection property="permissions" ofType="com.rxida.xilinedu.sys.entity.Permission">
+                <id property="id" column="permissionList.id"/>
+                <result property="permission" column="permissionList.permission"/>
+            </collection>
+        </collection>
+    </resultMap>
+    <select id="findByUsername" parameterType="java.lang.String" resultMap="userResult">
+        select
+          login_name AS "username",
+          password AS "password",
+          sr.id AS "roleList.id",
+          sr.name AS "roleList.name",
+          sm.permission AS "permissionList.permission",
+          sm.id AS "permissionList.id"
+        from sys_user a
+        LEFT JOIN sys_user_role sur ON sur.user_id = a.id
+        LEFT JOIN sys_role sr ON sr.id = sur.role_id
+        LEFT JOIN sys_role_menu  srm ON srm.role_id = sr.id
+        LEFT JOIN sys_menu  sm ON sm.id = srm.menu_id
+        where username = #{username}
+    </select>
+    <select id="findAll" resultType="com.rxida.xilinedu.sys.entity.User">
+        select
+          login_name AS "username",
+          password AS "password"
+        from sys_user
+    </select>
+    <insert id="insert" parameterType="com.rxida.xilinedu.sys.entity.User">
+
+    </insert>
+    <update id="update" parameterType="com.rxida.xilinedu.sys.entity.User">
+
+    </update>
+</mapper>

+ 14 - 0
sys/src/main/resources/templates/login.html

@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>登录</title>
+</head>
+<body>
+<form action="/login" method="post">
+    <input name="username" type="text" placeholder="输入用户名">
+    <input name="password" type="password" placeholder="输入密码">
+    <button type="submit">登录</button>
+</form>
+</body>
+</html>

+ 17 - 0
sys/src/test/java/com/rxida/xilinedu/sys/SysApplicationTests.java

@@ -0,0 +1,17 @@
+package com.rxida.xilinedu.sys;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class SysApplicationTests {
+
+    @Test
+    public void contextLoads() {
+    }
+
+}
+