温红权 9 лет назад
Родитель
Сommit
de761cc168
40 измененных файлов с 1900 добавлено и 0 удалено
  1. 24 0
      VisualInspection_server/.gitignore
  2. BIN
      VisualInspection_server/.mvn/wrapper/maven-wrapper.jar
  3. 1 0
      VisualInspection_server/.mvn/wrapper/maven-wrapper.properties
  4. 233 0
      VisualInspection_server/mvnw
  5. 145 0
      VisualInspection_server/mvnw.cmd
  6. 212 0
      VisualInspection_server/pom.xml
  7. 11 0
      VisualInspection_server/profiles.xml
  8. 13 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/ServletInitializer.java
  9. 30 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/VideocheckApplication.java
  10. 13 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/CheckTask.java
  11. 20 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/Msg.java
  12. 25 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/Permission.java
  13. 13 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/Role.java
  14. 75 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/User.java
  15. 118 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/AppErrorPageController.java
  16. 95 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/TestController.java
  17. 16 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/PermissionDao.java
  18. 21 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/UserDao.java
  19. 17 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/druidTools/DruidStatFilter.java
  20. 21 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/druidTools/DruidStatViewServlet.java
  21. 31 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/PageHelperConfiguration.java
  22. 18 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/PermissionDaoMapper.xml
  23. 68 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/UserMapper.xml
  24. 29 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/securityTools/CorsConfig.java
  25. 53 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/securityTools/MyAccessDecisionManager.java
  26. 77 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/securityTools/MyFilterSecurityInterceptor.java
  27. 40 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/securityTools/MyGrantedAuthority.java
  28. 76 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/securityTools/MyInvocationSecurityMetadataSourceService.java
  29. 18 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/securityTools/WebMvcConfig.java
  30. 62 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/securityTools/WebSecurityConfig.java
  31. 8 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/BaseService.java
  32. 20 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/UserService.java
  33. 85 0
      VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/UserServiceImpl.java
  34. 54 0
      VisualInspection_server/src/main/resources/application.properties
  35. 4 0
      VisualInspection_server/src/main/resources/static/css/bootstrap.min.css
  36. 8 0
      VisualInspection_server/src/main/resources/static/js/bootstrap.min.js
  37. 14 0
      VisualInspection_server/src/main/resources/templates/error.html
  38. 64 0
      VisualInspection_server/src/main/resources/templates/home.html
  39. 52 0
      VisualInspection_server/src/main/resources/templates/login.html
  40. 16 0
      VisualInspection_server/src/test/java/com/xintong/visualinspection/VideocheckApplicationTests.java

+ 24 - 0
VisualInspection_server/.gitignore

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

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


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

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

+ 233 - 0
VisualInspection_server/mvnw

@@ -0,0 +1,233 @@
+#!/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
+           #
+           # Look for the Apple JDKs first to preserve the existing behaviour, and then look
+           # for the new JDKs provided by Oracle.
+           #
+           if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK ] ; then
+             #
+             # Apple JDKs
+             #
+             export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
+           fi
+
+           if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Java/JavaVirtualMachines/CurrentJDK ] ; then
+             #
+             # Apple JDKs
+             #
+             export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
+           fi
+
+           if [ -z "$JAVA_HOME" ] && [ -L "/Library/Java/JavaVirtualMachines/CurrentJDK" ] ; then
+             #
+             # Oracle JDKs
+             #
+             export JAVA_HOME=/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home
+           fi
+
+           if [ -z "$JAVA_HOME" ] && [ -x "/usr/libexec/java_home" ]; then
+             #
+             # Apple JDKs
+             #
+             export JAVA_HOME=`/usr/libexec/java_home`
+           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 Migwn, 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
+
+# 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"`
+fi
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+  local basedir=$(pwd)
+  local wdir=$(pwd)
+  while [ "$wdir" != '/' ] ; do
+    if [ -d "$wdir"/.mvn ] ; then
+      basedir=$wdir
+      break
+    fi
+    wdir=$(cd "$wdir/.."; pwd)
+  done
+  echo "${basedir}"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+  if [ -f "$1" ]; then
+    echo "$(tr -s '\n' ' ' < "$1")"
+  fi
+}
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)}
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+
+# Provide a "standardized" way to retrieve the CLI args that will
+# work with both Windows and non-Windows executions.
+MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
+export MAVEN_CMD_LINE_ARGS
+
+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} "$@"

+ 145 - 0
VisualInspection_server/mvnw.cmd

@@ -0,0 +1,145 @@
+@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 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
+
+set MAVEN_CMD_LINE_ARGS=%*
+
+@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="".\.mvn\wrapper\maven-wrapper.jar""
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
+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%

+ 212 - 0
VisualInspection_server/pom.xml

@@ -0,0 +1,212 @@
+<?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>
+
+	<groupId>com.xintong.visualInspection</groupId>
+	<artifactId>visualInspection</artifactId>
+	<version>0.0.1-SNAPSHOT</version>
+	<packaging>war</packaging>
+
+	<name>VisualInspection</name>
+	<description>视屏稽查</description>
+
+
+
+	<parent>
+		<groupId>org.springframework.boot</groupId>
+		<artifactId>spring-boot-starter-parent</artifactId>
+		<version>1.5.2.RELEASE</version>
+		<relativePath/> <!-- lookup parent from repository -->
+	</parent>
+
+	<properties>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+		<java.version>1.8</java.version>
+	</properties>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-web</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-security</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>org.mybatis.spring.boot</groupId>
+			<artifactId>mybatis-spring-boot-starter</artifactId>
+			<version>1.2.0</version>
+		</dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-thymeleaf</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-remote-shell</artifactId>
+        </dependency>
+
+        <!--<dependency>-->
+            <!--<groupId>org.springframework.boot</groupId>-->
+            <!--<artifactId>spring-boot-starter-data-jpa</artifactId>-->
+        <!--</dependency>-->
+
+        <!-- http://mvnrepository.com/artifact/org.thymeleaf.extras/thymeleaf-extras-springsecurity4 -->
+        <dependency>
+            <groupId>org.thymeleaf.extras</groupId>
+            <artifactId>thymeleaf-extras-springsecurity4</artifactId>
+            <version>2.1.2.RELEASE</version>
+        </dependency>
+
+        <!-- https://mvnrepository.com/artifact/org.thymeleaf/thymeleaf-spring4 -->
+        <!--<dependency>-->
+            <!--<groupId>org.thymeleaf</groupId>-->
+            <!--<artifactId>thymeleaf-spring4</artifactId>-->
+            <!--<version>3.0.5.RELEASE</version>-->
+        <!--</dependency>-->
+
+
+
+        <!--<dependency>-->
+            <!--<groupId>org.springframework.security</groupId>-->
+            <!--<artifactId>spring-security-taglibs</artifactId>-->
+            <!--<version>4.2.1.RELEASE</version>-->
+        <!--</dependency>-->
+
+
+        <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper</artifactId>
+            <version>4.2.1</version>
+        </dependency>
+
+
+		<dependency>
+			<groupId>org.projectlombok</groupId>
+			<artifactId>lombok</artifactId>
+			<optional>true</optional>
+		</dependency>
+
+		<dependency>
+			<groupId>mysql</groupId>
+			<artifactId>mysql-connector-java</artifactId>
+			<version>5.1.41</version>
+		</dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>druid</artifactId>
+            <version>1.0.29</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.30</version>
+        </dependency>
+
+
+
+        <dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-test</artifactId>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+
+	<dependencyManagement>
+		<dependencies>
+			<dependency>
+				<groupId>org.springframework.cloud</groupId>
+				<artifactId>spring-cloud-dependencies</artifactId>
+				<version>Dalston.RC1</version>
+				<type>pom</type>
+				<scope>import</scope>
+			</dependency>
+		</dependencies>
+	</dependencyManagement>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<configuration>
+					<source>${java.version}</source>
+					<target>${java.version}</target>
+
+				</configuration>
+			</plugin>
+		</plugins>
+		<resources>
+			<resource>
+				<directory>${basedir}/src/main/resources</directory>
+				<filtering>true</filtering>
+				<includes>
+					<include>**/application*.yml</include>
+					<include>**/application*.properties</include>
+				</includes>
+			</resource>
+			<resource>
+				<directory>${basedir}/src/main/resources</directory>
+				<excludes>
+					<exclude>**/application*.yml</exclude>
+					<exclude>**/application*.properties</exclude>
+				</excludes>
+			</resource>
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.properties</include>
+                    <include>**/*.xml</include>
+                </includes>
+                <filtering>false</filtering>
+            </resource>
+			<resource>
+				<directory>src/main/resources</directory>
+				<targetPath>BOOT-INF/lib/</targetPath>
+				<includes>
+					<include>**/*.jar</include>
+				</includes>
+			</resource>
+			<resource>
+				<directory>lib</directory>
+				<targetPath>BOOT-INF/lib/</targetPath>
+				<includes>
+					<include>*.jar</include>
+				</includes>
+			</resource>
+		</resources>
+	</build>
+
+    <!--<repositories>-->
+        <!--<repository>-->
+            <!--<id>spring-milestones</id>-->
+            <!--<name>Spring Milestones</name>-->
+            <!--<url>https://repo.spring.io/milestone</url>-->
+            <!--<snapshots>-->
+                <!--<enabled>false</enabled>-->
+            <!--</snapshots>-->
+        <!--</repository>-->
+        <!--&lt;!&ndash;<repository>&ndash;&gt;-->
+            <!--&lt;!&ndash;<id>maven</id>&ndash;&gt;-->
+            <!--&lt;!&ndash;<name>maven</name>&ndash;&gt;-->
+            <!--&lt;!&ndash;<url>http://repo1.maven.org/maven2</url>&ndash;&gt;-->
+            <!--&lt;!&ndash;<snapshots>&ndash;&gt;-->
+                <!--&lt;!&ndash;<enabled>false</enabled>&ndash;&gt;-->
+            <!--&lt;!&ndash;</snapshots>&ndash;&gt;-->
+        <!--&lt;!&ndash;</repository>&ndash;&gt;-->
+    <!--</repositories>-->
+
+
+</project>

+ 11 - 0
VisualInspection_server/profiles.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<profilesXml xmlns="http://maven.apache.org/PROFILES/1.0.0"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://maven.apache.org/PROFILES/1.0.0 http://maven.apache.org/xsd/profiles-1.0.0.xsd">
+    <profiles>
+        <profile>
+            <id></id>
+            
+        </profile>
+    </profiles>
+</profilesXml>

+ 13 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/ServletInitializer.java

@@ -0,0 +1,13 @@
+package com.xintong.visualinspection;
+
+import org.springframework.boot.builder.SpringApplicationBuilder;
+import org.springframework.boot.web.support.SpringBootServletInitializer;
+
+public class ServletInitializer extends SpringBootServletInitializer {
+
+	@Override
+	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
+		return application.sources(VideocheckApplication.class);
+	}
+
+}

+ 30 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/VideocheckApplication.java

@@ -0,0 +1,30 @@
+package com.xintong.visualinspection;
+
+import com.alibaba.druid.pool.DruidDataSource;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.boot.web.servlet.ServletComponentScan;
+import org.springframework.context.annotation.Bean;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+import org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect;
+import org.thymeleaf.spring4.SpringTemplateEngine;
+import org.thymeleaf.templateresolver.ServletContextTemplateResolver;
+
+import javax.sql.DataSource;
+
+@SpringBootApplication
+@ServletComponentScan
+public class VideocheckApplication {
+	@Bean
+	@ConfigurationProperties(prefix="spring.datasource")
+	public DataSource druidDataSource() {
+		return new DruidDataSource();
+	}
+
+
+
+	public static void main(String[] args) {
+		SpringApplication.run(VideocheckApplication.class, args);
+	}
+}

+ 13 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/CheckTask.java

@@ -0,0 +1,13 @@
+package com.xintong.visualinspection.bean;
+
+import lombok.Data;
+
+/**
+ * 文件名:CheckTask
+ * 版本信息:日期:2017/4/15 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Data
+public class CheckTask {
+
+
+}

+ 20 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/Msg.java

@@ -0,0 +1,20 @@
+package com.xintong.visualinspection.bean;
+
+import lombok.Data;
+
+/**
+ * 文件名:Msg
+ * 版本信息:日期:2017/3/31 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Data
+public class Msg {
+    private String title;
+    private String content;
+    private String etraInfo;
+    public Msg(String title, String content, String etraInfo) {
+        super();
+        this.title = title;
+        this.content = content;
+        this.etraInfo = etraInfo;
+    }
+}

+ 25 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/Permission.java

@@ -0,0 +1,25 @@
+package com.xintong.visualinspection.bean;
+
+import lombok.Data;
+
+/**
+ * 文件名:Permission
+ * 版本信息:日期:2017/3/31 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Data
+public class Permission {
+    private int id;
+    //权限名称
+    private String name;
+
+    //权限描述
+    private String descritpion;
+
+    //授权链接
+    private String url;
+
+    //父节点id
+    private int pid;
+
+    private String method;
+}

+ 13 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/Role.java

@@ -0,0 +1,13 @@
+package com.xintong.visualinspection.bean;
+
+import lombok.Data;
+
+/**
+ * 文件名:Role
+ * 版本信息:日期:2017/3/31 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Data
+public class Role {
+    private Integer id;
+    private String name;
+}

+ 75 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/bean/User.java

@@ -0,0 +1,75 @@
+package com.xintong.visualinspection.bean;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Data;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.userdetails.UserDetails;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 文件名:User
+ * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Data
+public class User implements UserDetails {
+    private Integer id;
+    private String username;
+    private Integer age;
+    @JsonIgnore
+    private String password;
+    @JsonIgnore
+    private List<Role> roles;
+    private List<? extends GrantedAuthority> authorities;
+
+
+    public User(){
+
+    }
+
+    public User(String username, String password, List<GrantedAuthority> grantedAuthorities) {
+        this.username = username;
+        this.password = password;
+        this.authorities = grantedAuthorities;
+    }
+
+
+
+    @JsonIgnore
+    @Override
+    public boolean isAccountNonExpired() {
+        return true;
+    }
+
+    @JsonIgnore
+    @Override
+    public boolean isAccountNonLocked() {
+        return true;
+    }
+
+    @JsonIgnore
+    @Override
+    public boolean isCredentialsNonExpired() {
+        return true;
+    }
+
+
+    @JsonIgnore
+    @Override
+    public boolean isEnabled() {
+        return true;
+    }
+
+    @JsonIgnore
+    @Override
+    public Collection<? extends GrantedAuthority> getAuthorities() {
+        return authorities;
+    }
+
+    public void setGrantedAuthorities(List<? extends GrantedAuthority> authorities) {
+        this.authorities = authorities;
+    }
+
+
+}

+ 118 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/AppErrorPageController.java

@@ -0,0 +1,118 @@
+package com.xintong.visualinspection.controller;
+
+import java.util.Map;
+import javax.servlet.http.HttpServletRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.web.ErrorAttributes;
+import org.springframework.boot.autoconfigure.web.ErrorController;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.context.request.RequestAttributes;
+import org.springframework.web.context.request.ServletRequestAttributes;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * 文件名:PageController
+ * 版本信息:日期:2017/3/13 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Controller
+public class AppErrorPageController implements ErrorController {
+
+    private static final Logger logger = LoggerFactory.getLogger(AppErrorPageController.class);
+
+    private static AppErrorPageController appErrorController;
+
+    /**
+     * Error Attributes in the Application
+     */
+    @Autowired
+    private ErrorAttributes errorAttributes;
+
+    private final static String ERROR_PATH = "/error";
+
+    /**
+     * Controller for the Error Controller
+     * @param errorAttributes
+     * @return
+     */
+
+    public AppErrorPageController(ErrorAttributes errorAttributes) {
+        this.errorAttributes = errorAttributes;
+    }
+
+    public AppErrorPageController() {
+        if(appErrorController == null){
+            appErrorController = new AppErrorPageController(errorAttributes);
+        }
+    }
+
+    /**
+     * Supports the HTML Error View
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = ERROR_PATH, produces = "text/html")
+    public ModelAndView errorHtml(HttpServletRequest request) {
+        return new ModelAndView("error", getErrorAttributes(request, false));
+    }
+
+    /**
+     * Supports other formats like JSON, XML
+     * @param request
+     * @return
+     */
+    @RequestMapping(value = ERROR_PATH)
+    @ResponseBody
+    public ResponseEntity<Map<String, Object>> error(HttpServletRequest request) {
+        Map<String, Object> body = getErrorAttributes(request, getTraceParameter(request));
+        HttpStatus status = getStatus(request);
+        return new ResponseEntity<Map<String, Object>>(body, status);
+    }
+
+    /**
+     * Returns the path of the error page.
+     *
+     * @return the error path
+     */
+    @Override
+    public String getErrorPath() {
+        return ERROR_PATH;
+    }
+
+
+    private boolean getTraceParameter(HttpServletRequest request) {
+        String parameter = request.getParameter("trace");
+        if (parameter == null) {
+            return false;
+        }
+        return !"false".equals(parameter.toLowerCase());
+    }
+
+    private Map<String, Object> getErrorAttributes(HttpServletRequest request,
+                                                   boolean includeStackTrace) {
+        RequestAttributes requestAttributes = new ServletRequestAttributes(request);
+        Map<String, Object> map = this.errorAttributes.getErrorAttributes(requestAttributes,includeStackTrace);
+        String URL = request.getRequestURL().toString();
+        map.put("URL", URL);
+        logger.debug("AppErrorController.method [error info]: status-" + map.get("status") +", request url-" + URL);
+        return map;
+    }
+
+    private HttpStatus getStatus(HttpServletRequest request) {
+        Integer statusCode = (Integer) request
+                .getAttribute("javax.servlet.error.status_code");
+        if (statusCode != null) {
+            try {
+                return HttpStatus.valueOf(statusCode);
+            }
+            catch (Exception ex) {
+            }
+        }
+        return HttpStatus.INTERNAL_SERVER_ERROR;
+    }
+}

+ 95 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/controller/TestController.java

@@ -0,0 +1,95 @@
+package com.xintong.visualinspection.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.xintong.visualinspection.bean.Msg;
+import com.xintong.visualinspection.bean.User;
+import com.xintong.visualinspection.service.UserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.expression.SecurityExpressionRoot;
+import org.springframework.security.core.Authentication;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+import java.lang.reflect.Array;
+import java.util.List;
+
+/**
+ * 文件名:TestController
+ * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Controller
+public class TestController {
+
+    @Autowired
+    private UserService userService;
+
+
+    @RequestMapping("/")
+    public String index(Model model, HttpServletRequest request){
+        Msg msg =  new Msg("测试标题","测试内容","额外信息,只对管理员显示");
+        model.addAttribute("msg", msg);
+        request.isUserInRole("ROLE_ADMIN");
+
+        return "home";
+    }
+    @RequestMapping("/admin")
+    @ResponseBody
+    public String hello(){
+        return "hello admin";
+    }
+
+
+
+    @RequestMapping("/login")
+    public String login(){
+        return "login";
+    }
+
+    @RequestMapping(value = "/user", method = RequestMethod.GET)
+    @ResponseBody
+    public String getList(){
+        return "hello getList";
+    }
+
+
+    @RequestMapping(value = "/user", method = RequestMethod.POST)
+    @ResponseBody
+    public String save(){
+        return "hello save";
+    }
+
+
+    @RequestMapping(value = "/user", method = RequestMethod.PUT)
+    @ResponseBody
+    public String update(){
+        return "hello update";
+    }
+
+    @RequestMapping(value = "/test1")
+    public String index(){
+        PageHelper.startPage(1,2);
+
+        List<User> list = userService.getAll();
+
+
+        return JSON.toJSON(new PageInfo(list)).toString();
+    }
+
+    @RequestMapping(value = "/test")
+    public String test(){
+
+        User user = new User();
+        user.setUsername("ss");
+        user.setAge(22);
+        userService.insert(user);
+        return "test";
+    }
+
+}

+ 16 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/PermissionDao.java

@@ -0,0 +1,16 @@
+package com.xintong.visualinspection.dao;
+
+import com.xintong.visualinspection.bean.Permission;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 文件名:PermissionDao
+ * 版本信息:日期:2017/3/31 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Mapper
+public interface PermissionDao {
+    public List<Permission> findAll();
+    public List<Permission> findByAdminUserId(int userId);
+}

+ 21 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/dao/UserDao.java

@@ -0,0 +1,21 @@
+package com.xintong.visualinspection.dao;
+
+import com.xintong.visualinspection.bean.User;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 文件名:UserDao
+ * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Mapper
+public interface UserDao  {
+    public List<User> getAll();
+    public User getOne(Long id);
+    public void insert(User user);
+    public void update(User user);
+    public void delete(Long id);
+    public User findByUserName(String username);
+}

+ 17 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/druidTools/DruidStatFilter.java

@@ -0,0 +1,17 @@
+package com.xintong.visualinspection.druidTools;
+
+import javax.servlet.annotation.WebFilter;
+import javax.servlet.annotation.WebInitParam;
+import com.alibaba.druid.support.http.WebStatFilter;
+/**
+ * 文件名:DruidStatFilter
+ * 版本信息:日期:2017/3/31 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@WebFilter(filterName="druidWebStatFilter",urlPatterns="/*",
+        initParams={
+                @WebInitParam(name="exclusions",value="*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*")// 忽略资源
+        }
+)
+public class DruidStatFilter extends WebStatFilter{
+
+}

+ 21 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/druidTools/DruidStatViewServlet.java

@@ -0,0 +1,21 @@
+package com.xintong.visualinspection.druidTools;
+
+import javax.servlet.annotation.WebInitParam;
+import javax.servlet.annotation.WebServlet;
+import com.alibaba.druid.support.http.StatViewServlet;
+/**
+ * 文件名:DruidStatViewServlet
+ * 版本信息:日期:2017/3/31 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@SuppressWarnings("serial")
+@WebServlet(urlPatterns = "/druid/*",
+        initParams={
+                @WebInitParam(name="allow",value=""),// IP白名单 (没有配置或者为空,则允许所有访问)
+                @WebInitParam(name="deny",value="192.168.16.111"),// IP黑名单 (存在共同时,deny优先于allow)
+                @WebInitParam(name="loginUsername",value="wen"),// 用户名
+                @WebInitParam(name="loginPassword",value="123456"),// 密码
+                @WebInitParam(name="resetEnable",value="false")// 禁用HTML页面上的“Reset All”功能
+        })
+public class DruidStatViewServlet extends StatViewServlet {
+
+}

+ 31 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/PageHelperConfiguration.java

@@ -0,0 +1,31 @@
+package com.xintong.visualinspection.mapper;
+
+import com.github.pagehelper.PageHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.util.Properties;
+
+/**
+ * 文件名:PageHelperConfiguration
+ * 版本信息:日期:2017/3/31 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Configuration
+public class PageHelperConfiguration {
+    private static final Logger log = LoggerFactory.getLogger(PageHelperConfiguration.class);
+    @Bean
+    public PageHelper pageHelper() {
+        log.info("------Register MyBatis PageHelper");
+        PageHelper pageHelper = new PageHelper();
+        Properties p = new Properties();
+        p.setProperty("offsetAsPageNum", "true");
+        p.setProperty("rowBoundsWithCount", "true");
+        p.setProperty("reasonable", "true");
+        //通过设置pageSize=0或者RowBounds.limit = 0就会查询出全部的结果。
+        p.setProperty("pageSizeZero", "true");
+        pageHelper.setProperties(p);
+        return pageHelper;
+    }
+}

+ 18 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/PermissionDaoMapper.xml

@@ -0,0 +1,18 @@
+<?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.xintong.visualinspection.dao.PermissionDao">
+    <select id="findAll"  resultType="com.xintong.visualinspection.bean.Permission">
+
+        SELECT * from sys_permission ;
+    </select>
+
+    <select id="findByAdminUserId" parameterType="int" resultType="com.xintong.visualinspection.bean.Permission">
+        select p.*
+        from sys_user u
+        LEFT JOIN sys_role_user sru on u.id= sru.sys_user_id
+        LEFT JOIN sys_role r on sru.sys_role_id=r.id
+        LEFT JOIN sys_permission_role spr on spr.role_id=r.id
+        LEFT JOIN sys_permission p on p.id =spr.permission_id
+        where u.id=#{userId}
+    </select>
+</mapper>

+ 68 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/mapper/UserMapper.xml

@@ -0,0 +1,68 @@
+<?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.xintong.visualinspection.dao.UserDao" >
+    <resultMap id="BaseResultMap" type="com.xintong.visualinspection.bean.User" >
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="username" property="username" jdbcType="VARCHAR" />
+        <result column="age" property="age" jdbcType="INTEGER" />
+        <result column="password" property="password" jdbcType="VARCHAR" />
+    </resultMap>
+    <resultMap id="userMap" type="com.xintong.visualinspection.bean.User">
+        <id property="id" column="ID"/>
+        <result property="username" column="username"/>
+        <result property="password" column="PASSWORD"/>
+        <collection property="roles" ofType="com.xintong.visualinspection.bean.Role">
+            <result column="name" property="name"/>
+        </collection>
+    </resultMap>
+
+    <select id="getAll" resultMap="BaseResultMap"  >
+        SELECT
+        id,username,age,password
+        FROM sys_user
+    </select>
+
+    <select id="getOne" parameterType="java.lang.Long" resultMap="BaseResultMap" >
+        SELECT
+        id,username,age,password
+        FROM sys_user
+        WHERE id = #{id}
+    </select>
+
+    <insert id="insert" parameterType="com.xintong.visualinspection.bean.User" >
+        INSERT INTO
+        sys_user
+        (username,age,password)
+        VALUES
+        (#{username}, #{age},#{password})
+    </insert>
+
+    <update id="update" parameterType="com.xintong.visualinspection.bean.User" >
+        UPDATE
+        sys_user
+        SET
+        <if test="username != null">userName = #{username},</if>
+        <if test="age != null">age = #{age},</if>
+        <if test="password != null">password = #{password},</if>
+        id = #{id}
+        WHERE
+        id = #{id}
+    </update>
+
+    <delete id="delete" parameterType="java.lang.Long" >
+        DELETE FROM
+        sys_user
+        WHERE
+        id =#{id}
+    </delete>
+
+
+    <select id="findByUserName" parameterType="String" resultMap="userMap">
+        select u.*
+        ,r.name
+        from sys_user u
+        LEFT JOIN sys_role_user sru on u.id= sru.Sys_User_id
+        LEFT JOIN sys_role r on sru.sys_role_id=r.id
+        where username= #{username}
+    </select>
+</mapper>

+ 29 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/securityTools/CorsConfig.java

@@ -0,0 +1,29 @@
+package com.xintong.visualinspection.securityTools;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+import org.springframework.web.filter.CorsFilter;
+/**
+ * 文件名:CorsConfig
+ * 版本信息:日期:2017/4/7 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+
+
+@Configuration
+public class CorsConfig {
+    private CorsConfiguration buildConfig() {
+        CorsConfiguration corsConfiguration = new CorsConfiguration();
+        corsConfiguration.addAllowedOrigin("*"); // 1
+        corsConfiguration.addAllowedHeader("*"); // 2
+        corsConfiguration.addAllowedMethod("*"); // 3
+        return corsConfiguration;
+    }
+
+    @Bean
+    public CorsFilter corsFilter() {
+        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+        source.registerCorsConfiguration("/**", buildConfig()); // 4
+        return new CorsFilter(source);
+    }
+}

+ 53 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/securityTools/MyAccessDecisionManager.java

@@ -0,0 +1,53 @@
+package com.xintong.visualinspection.securityTools;
+
+import org.springframework.security.access.AccessDecisionManager;
+import org.springframework.security.access.AccessDeniedException;
+import org.springframework.security.access.ConfigAttribute;
+import org.springframework.security.authentication.InsufficientAuthenticationException;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.stereotype.Service;
+
+import java.util.Collection;
+import java.util.Iterator;
+/**
+ * 文件名:MyAccessDecisionManager
+ * 版本信息:日期:2017/3/31 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Service
+public class MyAccessDecisionManager implements AccessDecisionManager {
+    @Override
+    public void decide(Authentication authentication, Object object, Collection<ConfigAttribute> configAttributes) throws AccessDeniedException, InsufficientAuthenticationException {
+
+        if(null== configAttributes || configAttributes.size() <=0) {
+            return;
+        }
+        ConfigAttribute c;
+        String needRole;
+        for(Iterator<ConfigAttribute> iter = configAttributes.iterator(); iter.hasNext(); ) {
+            c = iter.next();
+            needRole = c.getAttribute();
+            for(GrantedAuthority ga : authentication.getAuthorities()) {
+                if(needRole.trim().equals(ga.getAuthority())) {
+                    return;
+                }
+            }
+        }
+        throw new AccessDeniedException("no right");
+
+
+
+    }
+
+
+
+    @Override
+    public boolean supports(ConfigAttribute attribute) {
+        return true;
+    }
+
+    @Override
+    public boolean supports(Class<?> clazz) {
+        return true;
+    }
+}

+ 77 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/securityTools/MyFilterSecurityInterceptor.java

@@ -0,0 +1,77 @@
+package com.xintong.visualinspection.securityTools;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.SecurityMetadataSource;
+import org.springframework.security.access.intercept.AbstractSecurityInterceptor;
+import org.springframework.security.access.intercept.InterceptorStatusToken;
+import org.springframework.security.web.FilterInvocation;
+import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource;
+import org.springframework.stereotype.Service;
+
+import java.io.IOException;
+/**
+ * 文件名:MyFilterSecurityInterceptor
+ * 版本信息:日期:2017/3/31 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Service
+public class MyFilterSecurityInterceptor extends AbstractSecurityInterceptor implements Filter {
+
+
+    @Autowired
+    private FilterInvocationSecurityMetadataSource securityMetadataSource;
+
+    @Autowired
+    public void setMyAccessDecisionManager(MyAccessDecisionManager myAccessDecisionManager) {
+        super.setAccessDecisionManager(myAccessDecisionManager);
+    }
+
+
+    @Override
+    public void init(FilterConfig filterConfig) throws ServletException {
+
+    }
+
+    @Override
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
+
+        FilterInvocation fi = new FilterInvocation(request, response, chain);
+        invoke(fi);
+    }
+
+
+    public void invoke(FilterInvocation fi) throws IOException, ServletException {
+//fi里面有一个被拦截的url
+//里面调用MyInvocationSecurityMetadataSource的getAttributes(Object object)这个方法获取fi对应的所有权限
+//再调用MyAccessDecisionManager的decide方法来校验用户的权限是否足够
+        InterceptorStatusToken token = super.beforeInvocation(fi);
+        try {
+//执行下一个拦截器
+            fi.getChain().doFilter(fi.getRequest(), fi.getResponse());
+        } finally {
+            super.afterInvocation(token, null);
+        }
+    }
+
+
+    @Override
+    public void destroy() {
+
+    }
+
+    @Override
+    public Class<?> getSecureObjectClass() {
+        return FilterInvocation.class;
+
+    }
+
+    @Override
+    public SecurityMetadataSource obtainSecurityMetadataSource() {
+        return this.securityMetadataSource;
+    }
+}

+ 40 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/securityTools/MyGrantedAuthority.java

@@ -0,0 +1,40 @@
+package com.xintong.visualinspection.securityTools;
+
+import lombok.Data;
+import org.springframework.security.core.GrantedAuthority;
+
+/**
+ * Created by yangyibo on 17/2/15.
+ */
+@Data
+public class MyGrantedAuthority implements GrantedAuthority {
+
+    private String url;
+    private String method;
+
+    public String getPermissionUrl() {
+        return url;
+    }
+
+    public void setPermissionUrl(String permissionUrl) {
+        this.url = permissionUrl;
+    }
+
+    public String getMethod() {
+        return method;
+    }
+
+    public void setMethod(String method) {
+        this.method = method;
+    }
+
+    public MyGrantedAuthority(String url, String method) {
+        this.url = url;
+        this.method = method;
+    }
+
+    @Override
+    public String getAuthority() {
+        return this.url + ";" + this.method;
+    }
+}

+ 76 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/securityTools/MyInvocationSecurityMetadataSourceService.java

@@ -0,0 +1,76 @@
+package com.xintong.visualinspection.securityTools;
+
+import com.xintong.visualinspection.bean.Permission;
+import com.xintong.visualinspection.dao.PermissionDao;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.ConfigAttribute;
+import org.springframework.security.access.SecurityConfig;
+import org.springframework.security.web.FilterInvocation;
+import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource;
+import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
+import org.springframework.stereotype.Service;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.*;
+/**
+ * 文件名:MyInvocationSecurityMetadataSourceService
+ * 版本信息:日期:2017/3/31 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+
+
+
+/**
+ * Created by yangyibo on 17/1/19.
+ */
+@Service
+public class MyInvocationSecurityMetadataSourceService  implements
+        FilterInvocationSecurityMetadataSource {
+
+    @Autowired
+    private PermissionDao permissionDao;
+
+    private HashMap<String, Collection<ConfigAttribute>> map =null;
+
+    /**
+     * 加载资源,初始化资源变量
+     */
+    public void loadResourceDefine(){
+        map = new HashMap<>();
+        Collection<ConfigAttribute> array;
+        ConfigAttribute cfg;
+        List<Permission> permissions = permissionDao.findAll();
+        for(Permission permission : permissions) {
+            array = new ArrayList<>();
+            cfg = new SecurityConfig(permission.getName());
+            array.add(cfg);
+            map.put(permission.getUrl(), array);
+        }
+
+    }
+
+    @Override
+    public Collection<ConfigAttribute> getAttributes(Object object) throws IllegalArgumentException {
+        if(map ==null) loadResourceDefine();
+        HttpServletRequest request = ((FilterInvocation) object).getHttpRequest();
+        AntPathRequestMatcher matcher;
+        String resUrl;
+        for(Iterator<String> iter = map.keySet().iterator(); iter.hasNext(); ) {
+            resUrl = iter.next();
+            matcher = new AntPathRequestMatcher(resUrl);
+            if(matcher.matches(request)) {
+                return map.get(resUrl);
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public Collection<ConfigAttribute> getAllConfigAttributes() {
+        return null;
+    }
+
+    @Override
+    public boolean supports(Class<?> clazz) {
+        return true;
+    }
+}

+ 18 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/securityTools/WebMvcConfig.java

@@ -0,0 +1,18 @@
+package com.xintong.visualinspection.securityTools;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+
+/**
+ * 文件名:WebMvcConfig
+ * 版本信息:日期:2017/3/31 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Configuration
+public class WebMvcConfig extends WebMvcConfigurerAdapter {
+
+    @Override
+    public void addViewControllers(ViewControllerRegistry registry) {
+        registry.addViewController("/login").setViewName("login");
+    }
+}

+ 62 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/securityTools/WebSecurityConfig.java

@@ -0,0 +1,62 @@
+package com.xintong.visualinspection.securityTools;
+
+import com.xintong.visualinspection.service.UserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Role;
+import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
+import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.builders.WebSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.web.access.intercept.FilterSecurityInterceptor;
+import org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect;
+import org.thymeleaf.spring4.SpringTemplateEngine;
+import org.thymeleaf.templateresolver.ServletContextTemplateResolver;
+
+/**
+ * 文件名:WebSecurityConfig
+ * 版本信息:日期:2017/3/31 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Configuration
+@EnableWebSecurity
+@EnableGlobalMethodSecurity(securedEnabled = true,prePostEnabled=true)
+public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
+
+    @Autowired
+    private MyFilterSecurityInterceptor myFilterSecurityInterceptor;
+
+    @Autowired
+    private UserService userService;
+
+    @Override
+    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
+        auth.userDetailsService(userService); //user Details Service验证
+    }
+
+    @Override
+    public void configure(WebSecurity web) throws Exception {
+        super.configure(web);
+        web.ignoring().antMatchers("/css/**","/js/**");
+    }
+
+    @Override
+    protected void configure(HttpSecurity http) throws Exception {
+        http.authorizeRequests()
+                .anyRequest().authenticated() //任何请求,登录后可以访问
+                .and()
+                .formLogin()
+                .loginPage("/login")
+                .failureUrl("/login?error")
+                .permitAll() //登录页面用户任意访问
+                .and()
+                .logout().permitAll(); //注销行为任意访问
+
+
+        http.addFilterBefore(myFilterSecurityInterceptor, FilterSecurityInterceptor.class).csrf().disable();
+
+    }
+
+}

+ 8 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/BaseService.java

@@ -0,0 +1,8 @@
+package com.xintong.visualinspection.service;
+
+/**
+ * 文件名:BaseService
+ * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+public class BaseService {
+}

+ 20 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/UserService.java

@@ -0,0 +1,20 @@
+package com.xintong.visualinspection.service;
+
+import com.xintong.visualinspection.bean.User;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.security.core.userdetails.UserDetailsService;
+
+import java.util.List;
+
+/**
+ * 文件名:UserService
+ * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+public interface UserService extends UserDetailsService {
+    public List<User> getAll();
+    public User getOne(Long id);
+    public void insert(User user);
+    public void update(User user);
+    public void delete(Long id);
+    public UserDetails loadUserByUsername(String username);
+}

+ 85 - 0
VisualInspection_server/src/main/java/com/xintong/visualinspection/service/impl/UserServiceImpl.java

@@ -0,0 +1,85 @@
+package com.xintong.visualinspection.service.impl;
+
+import com.xintong.visualinspection.bean.Permission;
+import com.xintong.visualinspection.bean.Role;
+import com.xintong.visualinspection.bean.User;
+import com.xintong.visualinspection.dao.PermissionDao;
+import com.xintong.visualinspection.dao.UserDao;
+import com.xintong.visualinspection.securityTools.MyGrantedAuthority;
+import com.xintong.visualinspection.service.BaseService;
+import com.xintong.visualinspection.service.UserService;
+import lombok.Data;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.security.core.userdetails.UsernameNotFoundException;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 文件名:UserServiceImpl
+ * 版本信息:日期:2017/3/30 Copyright 江苏省交通规划设计院 Corporation 2017 版权所有.
+ */
+@Service
+@Data
+public class UserServiceImpl extends BaseService implements UserService {
+
+    private static final org.slf4j.Logger logger = LoggerFactory.getLogger(UserService.class);
+
+
+    @Autowired
+    private UserDao userDao;
+    @Autowired
+    private PermissionDao permissionDao;
+
+    @Override
+    public List<User> getAll() {
+        return userDao.getAll();
+    }
+
+    @Override
+    public User getOne(Long id) {
+        return userDao.getOne(id);
+    }
+
+    @Override
+    public void insert(User user) {
+        userDao.insert(user);
+    }
+
+    @Override
+    public void update(User user) {
+        userDao.update(user);
+    }
+
+    @Override
+    public void delete(Long id) {
+        userDao.delete(id);
+    }
+
+    @Override
+    public UserDetails loadUserByUsername(String username) {
+
+        User user = userDao.findByUserName(username);
+        if (user != null) {
+            List<Permission> permissions = permissionDao.findByAdminUserId(user.getId());
+            List<GrantedAuthority> grantedAuthorities = new ArrayList<>();
+            for (Permission permission : permissions) {
+                if (permission != null && permission.getName() != null) {
+
+                    GrantedAuthority grantedAuthority = new SimpleGrantedAuthority(permission.getName());
+                    grantedAuthorities.add(grantedAuthority);
+                }
+            }
+            return new User(user.getUsername(), user.getPassword(), grantedAuthorities);
+        } else {
+            throw new UsernameNotFoundException("admin: " + username + " do not exist!");
+        }
+
+    }
+}

+ 54 - 0
VisualInspection_server/src/main/resources/application.properties

@@ -0,0 +1,54 @@
+server.port=8089
+spring.thymeleaf.cache=false
+
+spring.datasource.name = test
+spring.datasource.url = jdbc:mysql://git.topm.win:9001/visualinspection?useUnicode=true&characterEncoding=utf-8
+spring.datasource.username = root
+spring.datasource.password = root
+spring.datasource.type = com.alibaba.druid.pool.DruidDataSource
+spring.datasource.driver-class-name = com.mysql.jdbc.Driver
+# 初始化大小,最小,最大
+spring.datasource.initialSize=5
+spring.datasource.minIdle=5
+spring.datasource.maxActive=20
+# 配置获取连接等待超时的时间
+spring.datasource.maxWait=60000
+# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+spring.datasource.timeBetweenEvictionRunsMillis=60000
+# 配置一个连接在池中最小生存的时间,单位是毫秒
+spring.datasource.minEvictableIdleTimeMillis=300000
+spring.datasource.validationQuery=SELECT 1 FROM DUAL
+spring.datasource.testWhileIdle=true
+spring.datasource.testOnBorrow=false
+spring.datasource.testOnReturn=false
+# 打开PSCache,并且指定每个连接上PSCache的大小
+spring.datasource.poolPreparedStatements=true
+spring.datasource.maxPoolPreparedStatementPerConnectionSize=20
+# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+spring.datasource.filters=stat,wall,log4j
+# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
+spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
+# 合并多个DruidDataSource的监控数据
+spring.datasource.useGlobalDataSourceStat=true
+
+mybatis.mapper-locations=classpath:com/xintong/visualinspection/mapper/*.xml
+mybatis.type-aliases-package=com.xintong.visualinspection.bean
+
+
+
+log4j.logger.org.thymeleaf=DEBUG
+log4j.logger.org.thymeleaf.TemplateEngine.CONFIG=DEBUG
+log4j.logger.org.thymeleaf.TemplateEngine.TIMER=DEBUG
+log4j.logger.org.thymeleaf.TemplateEngine.cache.TEMPLATE_CACHE=DEBUG
+log4j.logger.org.thymeleaf.TemplateEngine.cache.FRAGMENT_CACHE=DEBUG
+log4j.logger.org.thymeleaf.TemplateEngine.cache.MESSAGE_CACHE=DEBUG
+log4j.logger.org.thymeleaf.TemplateEngine.cache.EXPRESSION_CACHE=DEBUG
+
+
+
+management.shell.auth.simple.user.name=wen
+management.shell.auth.simple.user.password=wen
+management.shell.auth.type=simple
+
+
+

Разница между файлами не показана из-за своего большого размера
+ 4 - 0
VisualInspection_server/src/main/resources/static/css/bootstrap.min.css


Разница между файлами не показана из-за своего большого размера
+ 8 - 0
VisualInspection_server/src/main/resources/static/js/bootstrap.min.js


+ 14 - 0
VisualInspection_server/src/main/resources/templates/error.html

@@ -0,0 +1,14 @@
+<!DOCTYPE HTML>
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+    <title>Error Pages</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+</head>
+<body>
+<p th:text="'Url:' + ${URL}" />
+<p th:text="'Error:' + ${error}" />
+<p th:text="'Status:' + ${status}" />
+<p th:text="'Timestamp:' + ${timestamp}" />
+</body>
+</html>
+

+ 64 - 0
VisualInspection_server/src/main/resources/templates/home.html

@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html xmlns:th="http://www.thymeleaf.org"
+      xmlns:sec="http://www.springframework.org/security/tags">
+<head>
+    <meta content="text/html;charset=UTF-8"/>
+    <title sec:authentication="name"></title>
+    <link rel="stylesheet" th:href="@{css/bootstrap.min.css}" />
+    <style type="text/css">
+        body {
+            padding-top: 50px;
+        }
+        .starter-template {
+            padding: 40px 15px;
+            text-align: center;
+        }
+    </style>
+</head>
+<body>
+<nav class="navbar navbar-inverse navbar-fixed-top">
+    <div class="container">
+        <div class="navbar-header">
+            <a class="navbar-brand" href="#">Spring Security演示</a>
+        </div>
+        <div id="navbar" class="collapse navbar-collapse">
+            <ul class="nav navbar-nav">
+                <li><a th:href="@{/}"> 首页 </a></li>
+                <li sec:authorize="hasRole('ROLE_ADMIN')"><a th:href="@{/admin}"> admin </a></li>
+            </ul>
+        </div><!--/.nav-collapse -->
+    </div>
+</nav>
+
+
+<div class="container">
+
+    <div class="starter-template">
+        <h1 th:text="${msg.title}"></h1>
+
+        <p class="bg-primary" th:text="${msg.content}"></p>
+
+        <div sec:authorize="hasRole('ROLE_HOME')"> <!-- 用户类型为ROLE_ADMIN 显示 -->
+            <p class="bg-info" th:text="${msg.etraInfo}"></p>
+        </div>
+        <div sec:authorize="hasRole('ROLE_ADMIN')"> <!-- 用户类型为ROLE_ADMIN 显示 -->
+            <p class="bg-info">恭喜您,您有 ROLE_ADMIN 权限 </p>
+        </div>
+
+
+            <hr/>
+              <div th:inline="text">[[${#httpServletRequest.remoteUser}]]</div>
+            <hr/>
+
+
+
+        <form th:action="@{/logout}" method="post">
+            <input type="submit" class="btn btn-primary" value="注销"/>
+        </form>
+    </div>
+
+</div>
+
+
+</body>
+</html>

+ 52 - 0
VisualInspection_server/src/main/resources/templates/login.html

@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+    <meta content="text/html;charset=UTF-8"/>
+    <title>登录页面</title>
+    <link rel="stylesheet" th:href="@{css/bootstrap.min.css}"/>
+    <style type="text/css">
+        body {
+            padding-top: 50px;
+        }
+        .starter-template {
+            padding: 40px 15px;
+            text-align: center;
+        }
+    </style>
+</head>
+<body>
+
+<nav class="navbar navbar-inverse navbar-fixed-top">
+    <div class="container">
+        <div class="navbar-header">
+            <a class="navbar-brand" href="#">Spring Security演示</a>
+        </div>
+        <div id="navbar" class="collapse navbar-collapse">
+            <ul class="nav navbar-nav">
+                <li><a th:href="@{/}"> 首页 </a></li>
+
+            </ul>
+        </div><!--/.nav-collapse -->
+    </div>
+</nav>
+<div class="container">
+
+    <div class="starter-template">
+        <p th:if="${param.logout}" class="bg-warning">已成功注销</p><!-- 1 -->
+        <p th:if="${param.error}" class="bg-danger">有错误,请重试</p> <!-- 2 -->
+        <h2>使用账号密码登录</h2>
+        <form name="form" th:action="@{/login}" action="/login" method="POST"> <!-- 3 -->
+            <div class="form-group">
+                <label for="username">账号</label>
+                <input type="text" class="form-control" name="username" value="" placeholder="账号" />
+            </div>
+            <div class="form-group">
+                <label for="password">密码</label>
+                <input type="password" class="form-control" name="password" placeholder="密码" />
+            </div>
+            <input type="submit" id="login" value="Login" class="btn btn-primary" />
+        </form>
+    </div>
+</div>
+</body>
+</html>

+ 16 - 0
VisualInspection_server/src/test/java/com/xintong/visualinspection/VideocheckApplicationTests.java

@@ -0,0 +1,16 @@
+package com.xintong.videocheck;
+
+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 VideocheckApplicationTests {
+
+	@Test
+	public void contextLoads() {
+	}
+
+}

Некоторые файлы не были показаны из-за большого количества измененных файлов