├── README.md ├── access-control-spring ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── AcsCtl.sql ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── demo │ │ │ ├── DemoApplication.java │ │ │ ├── controller │ │ │ ├── AdminControl.java │ │ │ ├── DeviceControl.java │ │ │ ├── RecordsControl.java │ │ │ └── UserControl.java │ │ │ ├── entity │ │ │ ├── Admin.java │ │ │ ├── AdminDevice.java │ │ │ ├── Device.java │ │ │ ├── Records.java │ │ │ ├── User.java │ │ │ └── UserDevice.java │ │ │ ├── mapper │ │ │ ├── AdminDeviceMapper.java │ │ │ ├── AdminMapper.java │ │ │ ├── DeviceMapper.java │ │ │ ├── RecordsMapper.java │ │ │ ├── UserDeviceMapper.java │ │ │ └── UserMapper.java │ │ │ ├── result │ │ │ ├── Result.java │ │ │ └── ResultCode.java │ │ │ ├── service │ │ │ ├── AdminDeviceService.java │ │ │ ├── AdminService.java │ │ │ ├── DeviceService.java │ │ │ ├── RecordsService.java │ │ │ ├── UserDeviceService.java │ │ │ └── UserService.java │ │ │ ├── utils │ │ │ └── ResultUtil.java │ │ │ └── view │ │ │ ├── AdminView.java │ │ │ ├── RecordView.java │ │ │ └── UserView.java │ └── resources │ │ ├── application.yml │ │ └── static │ │ └── image │ │ └── pexels-snapwire-670061.jpg │ └── test │ └── java │ └── com │ └── example │ └── demo │ └── DemoApplicationTests.java ├── acess-control-vue ├── .babelrc ├── .editorconfig ├── .gitignore ├── .postcssrc.js ├── README.md ├── build │ ├── build.js │ ├── check-versions.js │ ├── logo.png │ ├── utils.js │ ├── vue-loader.conf.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ └── webpack.prod.conf.js ├── config │ ├── dev.env.js │ ├── index.js │ └── prod.env.js ├── index.html ├── package-lock.json ├── package.json ├── src │ ├── App.vue │ ├── assets │ │ ├── css │ │ │ ├── color-dark.css │ │ │ └── main.css │ │ ├── img.jpg │ │ ├── login-bg.jpg │ │ └── logo.png │ ├── components │ │ ├── Home.vue │ │ ├── Login.vue │ │ ├── admin │ │ │ ├── AdminManager.vue │ │ │ ├── DeviceManager.vue │ │ │ ├── RecordsManager.vue │ │ │ ├── SystemView.vue │ │ │ └── UserManager.vue │ │ ├── common │ │ │ ├── Header.vue │ │ │ ├── Sidebar.vue │ │ │ └── Tags.vue │ │ └── otherAdmin │ │ │ └── Manager.vue │ ├── main.js │ ├── router │ │ └── index.js │ └── store │ │ └── index.js └── static │ └── .gitkeep └── images ├── access.png ├── admin.png ├── device.png ├── index.png ├── login.png ├── manager.png └── user.png /README.md: -------------------------------------------------------------------------------- 1 | # Access Control System 2 | 3 | 一个基于SpringBoot+MyBatis+Vue+Element的门禁管理系统。 4 | 5 | 1. 系统用户分为超级管理员和普通管理员 6 | 2. 系统功能包括门禁记录管理、门禁设备管理和人员管理 7 | 3. 系统是人脸识别门禁闸机系统之上的管理系统 8 | 9 | ## 系统演示 10 | 11 | 1. 登录页面 12 | 13 |  14 | 15 | 2. 主页 16 | 17 |  18 | 19 | 3. 门禁管理页面 20 | 21 |  22 | 23 | 4. 设备管理页面 24 | 25 |  26 | 27 | 5. 人员管理页面 28 | 29 |  30 | 31 |  32 | 33 | 6. 普通管理页面 34 | 35 |  36 | -------------------------------------------------------------------------------- /access-control-spring/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /access-control-spring/.mvn/wrapper/MavenWrapperDownloader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-present the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import java.net.*; 18 | import java.io.*; 19 | import java.nio.channels.*; 20 | import java.util.Properties; 21 | 22 | public class MavenWrapperDownloader { 23 | 24 | private static final String WRAPPER_VERSION = "0.5.6"; 25 | /** 26 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. 27 | */ 28 | private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" 29 | + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; 30 | 31 | /** 32 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to 33 | * use instead of the default one. 34 | */ 35 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH = 36 | ".mvn/wrapper/maven-wrapper.properties"; 37 | 38 | /** 39 | * Path where the maven-wrapper.jar will be saved to. 40 | */ 41 | private static final String MAVEN_WRAPPER_JAR_PATH = 42 | ".mvn/wrapper/maven-wrapper.jar"; 43 | 44 | /** 45 | * Name of the property which should be used to override the default download url for the wrapper. 46 | */ 47 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; 48 | 49 | public static void main(String args[]) { 50 | System.out.println("- Downloader started"); 51 | File baseDirectory = new File(args[0]); 52 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); 53 | 54 | // If the maven-wrapper.properties exists, read it and check if it contains a custom 55 | // wrapperUrl parameter. 56 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); 57 | String url = DEFAULT_DOWNLOAD_URL; 58 | if (mavenWrapperPropertyFile.exists()) { 59 | FileInputStream mavenWrapperPropertyFileInputStream = null; 60 | try { 61 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); 62 | Properties mavenWrapperProperties = new Properties(); 63 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); 64 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); 65 | } catch (IOException e) { 66 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); 67 | } finally { 68 | try { 69 | if (mavenWrapperPropertyFileInputStream != null) { 70 | mavenWrapperPropertyFileInputStream.close(); 71 | } 72 | } catch (IOException e) { 73 | // Ignore ... 74 | } 75 | } 76 | } 77 | System.out.println("- Downloading from: " + url); 78 | 79 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); 80 | if (!outputFile.getParentFile().exists()) { 81 | if (!outputFile.getParentFile().mkdirs()) { 82 | System.out.println( 83 | "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); 84 | } 85 | } 86 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); 87 | try { 88 | downloadFileFromURL(url, outputFile); 89 | System.out.println("Done"); 90 | System.exit(0); 91 | } catch (Throwable e) { 92 | System.out.println("- Error downloading"); 93 | e.printStackTrace(); 94 | System.exit(1); 95 | } 96 | } 97 | 98 | private static void downloadFileFromURL(String urlString, File destination) throws Exception { 99 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { 100 | String username = System.getenv("MVNW_USERNAME"); 101 | char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); 102 | Authenticator.setDefault(new Authenticator() { 103 | @Override 104 | protected PasswordAuthentication getPasswordAuthentication() { 105 | return new PasswordAuthentication(username, password); 106 | } 107 | }); 108 | } 109 | URL website = new URL(urlString); 110 | ReadableByteChannel rbc; 111 | rbc = Channels.newChannel(website.openStream()); 112 | FileOutputStream fos = new FileOutputStream(destination); 113 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); 114 | fos.close(); 115 | rbc.close(); 116 | } 117 | 118 | } 119 | -------------------------------------------------------------------------------- /access-control-spring/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangjunhui6/access-control-system/1377d5399f40a8d97479ddc0e60c3c08dca17585/access-control-spring/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /access-control-spring/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /access-control-spring/AcsCtl.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat Premium Data Transfer 3 | 4 | Source Server : first 5 | Source Server Type : MySQL 6 | Source Server Version : 50734 7 | Source Host : 127.0.0.1:3306 8 | Source Schema : AcsCtl 9 | 10 | Target Server Type : MySQL 11 | Target Server Version : 50734 12 | File Encoding : 65001 13 | 14 | Date: 08/06/2021 19:50:21 15 | */ 16 | 17 | SET NAMES utf8mb4; 18 | SET FOREIGN_KEY_CHECKS = 0; 19 | 20 | -- ---------------------------- 21 | -- Table structure for admin 22 | -- ---------------------------- 23 | DROP TABLE IF EXISTS `admin`; 24 | CREATE TABLE `admin` ( 25 | `username` varchar(255) NOT NULL, 26 | `password` varchar(255) DEFAULT NULL, 27 | PRIMARY KEY (`username`) 28 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 29 | 30 | -- ---------------------------- 31 | -- Records of admin 32 | -- ---------------------------- 33 | BEGIN; 34 | INSERT INTO `admin` VALUES ('admin', '123456'); 35 | INSERT INTO `admin` VALUES ('admin1', '123456'); 36 | COMMIT; 37 | 38 | -- ---------------------------- 39 | -- Table structure for admin_device 40 | -- ---------------------------- 41 | DROP TABLE IF EXISTS `admin_device`; 42 | CREATE TABLE `admin_device` ( 43 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 44 | `username` varchar(255) DEFAULT NULL, 45 | `did` int(11) unsigned DEFAULT NULL, 46 | PRIMARY KEY (`id`), 47 | KEY `username` (`username`), 48 | KEY `did` (`did`), 49 | CONSTRAINT `admin_device_ibfk_1` FOREIGN KEY (`username`) REFERENCES `admin` (`username`), 50 | CONSTRAINT `admin_device_ibfk_2` FOREIGN KEY (`did`) REFERENCES `device` (`id`) 51 | ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4; 52 | 53 | -- ---------------------------- 54 | -- Records of admin_device 55 | -- ---------------------------- 56 | BEGIN; 57 | INSERT INTO `admin_device` VALUES (9, 'admin1', 2); 58 | INSERT INTO `admin_device` VALUES (10, 'admin1', 3); 59 | COMMIT; 60 | 61 | -- ---------------------------- 62 | -- Table structure for device 63 | -- ---------------------------- 64 | DROP TABLE IF EXISTS `device`; 65 | CREATE TABLE `device` ( 66 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 67 | `name` varchar(255) DEFAULT NULL, 68 | `location` varchar(255) DEFAULT NULL, 69 | `state` varchar(255) DEFAULT NULL, 70 | PRIMARY KEY (`id`), 71 | KEY `id` (`id`) 72 | ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4; 73 | 74 | -- ---------------------------- 75 | -- Records of device 76 | -- ---------------------------- 77 | BEGIN; 78 | INSERT INTO `device` VALUES (2, 'west_1_in', '西门-1号闸机-出', 'stop'); 79 | INSERT INTO `device` VALUES (3, 'face_recognition', '南门-1号闸机-入', 'stop'); 80 | INSERT INTO `device` VALUES (5, 'east_1_out', '东门-1号闸机-出', 'stop'); 81 | COMMIT; 82 | 83 | -- ---------------------------- 84 | -- Table structure for records 85 | -- ---------------------------- 86 | DROP TABLE IF EXISTS `records`; 87 | CREATE TABLE `records` ( 88 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 89 | `uid` int(11) unsigned DEFAULT NULL, 90 | `did` int(11) unsigned DEFAULT NULL, 91 | `temp` float(11,2) DEFAULT NULL, 92 | `time` datetime DEFAULT NULL, 93 | PRIMARY KEY (`id`), 94 | KEY `uid` (`uid`), 95 | KEY `did` (`did`), 96 | CONSTRAINT `records_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `user` (`id`), 97 | CONSTRAINT `records_ibfk_2` FOREIGN KEY (`did`) REFERENCES `device` (`id`) 98 | ) ENGINE=InnoDB AUTO_INCREMENT=135 DEFAULT CHARSET=utf8mb4; 99 | 100 | -- ---------------------------- 101 | -- Records of records 102 | -- ---------------------------- 103 | BEGIN; 104 | INSERT INTO `records` VALUES (35, 2, 3, 25.47, '2021-05-26 09:56:09'); 105 | INSERT INTO `records` VALUES (36, 2, 3, 25.29, '2021-05-26 09:56:11'); 106 | INSERT INTO `records` VALUES (37, 2, 3, 28.43, '2021-05-26 09:56:12'); 107 | INSERT INTO `records` VALUES (38, 2, 3, 25.43, '2021-05-26 09:56:13'); 108 | INSERT INTO `records` VALUES (39, 2, 3, 25.37, '2021-05-26 09:56:14'); 109 | INSERT INTO `records` VALUES (40, 2, 3, 25.43, '2021-05-26 09:56:18'); 110 | INSERT INTO `records` VALUES (41, 2, 3, 29.55, '2021-05-26 09:56:19'); 111 | INSERT INTO `records` VALUES (42, 2, 3, 25.37, '2021-05-26 09:56:33'); 112 | INSERT INTO `records` VALUES (43, 2, 3, 25.63, '2021-05-26 09:56:34'); 113 | INSERT INTO `records` VALUES (44, 2, 3, 35.69, '2021-05-26 09:56:35'); 114 | INSERT INTO `records` VALUES (45, 2, 3, 25.59, '2021-05-26 09:56:37'); 115 | INSERT INTO `records` VALUES (46, 2, 3, 25.53, '2021-05-26 09:56:38'); 116 | INSERT INTO `records` VALUES (47, 2, 3, 25.67, '2021-05-26 09:56:39'); 117 | INSERT INTO `records` VALUES (48, 2, 3, 25.55, '2021-05-26 09:56:40'); 118 | INSERT INTO `records` VALUES (49, 2, 3, 25.47, '2021-05-26 09:56:41'); 119 | INSERT INTO `records` VALUES (50, 2, 3, 25.53, '2021-05-26 09:56:42'); 120 | INSERT INTO `records` VALUES (51, 2, 3, 25.75, '2021-05-26 09:56:44'); 121 | INSERT INTO `records` VALUES (52, 2, 3, 25.63, '2021-05-26 09:56:47'); 122 | INSERT INTO `records` VALUES (53, 2, 3, 25.53, '2021-05-26 09:56:48'); 123 | INSERT INTO `records` VALUES (54, 2, 3, 36.53, '2021-05-26 09:56:52'); 124 | INSERT INTO `records` VALUES (55, 2, 3, 25.59, '2021-05-26 09:57:05'); 125 | INSERT INTO `records` VALUES (56, 2, 3, 25.59, '2021-05-26 09:57:08'); 126 | INSERT INTO `records` VALUES (57, 2, 3, 25.69, '2021-05-26 09:57:48'); 127 | INSERT INTO `records` VALUES (58, 2, 3, 25.69, '2021-05-26 09:57:51'); 128 | INSERT INTO `records` VALUES (59, 2, 3, 35.55, '2021-05-26 09:57:53'); 129 | INSERT INTO `records` VALUES (60, 2, 3, 25.55, '2021-05-26 09:57:55'); 130 | INSERT INTO `records` VALUES (61, 2, 3, 25.55, '2021-05-26 09:57:57'); 131 | INSERT INTO `records` VALUES (62, 2, 3, 25.73, '2021-05-26 09:58:01'); 132 | INSERT INTO `records` VALUES (63, 2, 3, 38.87, '2021-05-26 09:58:04'); 133 | INSERT INTO `records` VALUES (64, 2, 3, 25.69, '2021-05-26 09:58:05'); 134 | INSERT INTO `records` VALUES (65, 2, 3, 25.69, '2021-05-26 10:03:38'); 135 | INSERT INTO `records` VALUES (66, 2, 3, 25.61, '2021-05-26 10:03:40'); 136 | INSERT INTO `records` VALUES (67, 2, 3, 25.67, '2021-05-26 10:03:42'); 137 | INSERT INTO `records` VALUES (68, 2, 3, 35.63, '2021-05-26 10:03:44'); 138 | INSERT INTO `records` VALUES (69, 2, 3, 25.53, '2021-05-26 10:03:48'); 139 | INSERT INTO `records` VALUES (70, 2, 3, 25.69, '2021-05-26 10:04:02'); 140 | INSERT INTO `records` VALUES (71, 2, 3, 25.75, '2021-05-26 10:04:43'); 141 | INSERT INTO `records` VALUES (72, 2, 3, 33.87, '2021-05-26 10:04:54'); 142 | INSERT INTO `records` VALUES (73, 2, 3, 25.75, '2021-05-26 10:05:01'); 143 | INSERT INTO `records` VALUES (74, 2, 3, 25.97, '2021-05-26 10:05:20'); 144 | INSERT INTO `records` VALUES (75, 2, 3, 25.73, '2021-05-26 10:05:50'); 145 | INSERT INTO `records` VALUES (76, 2, 3, 26.05, '2021-05-26 10:05:55'); 146 | INSERT INTO `records` VALUES (77, 2, 3, 25.85, '2021-05-26 10:06:39'); 147 | INSERT INTO `records` VALUES (78, 2, 3, 25.85, '2021-05-26 10:06:40'); 148 | INSERT INTO `records` VALUES (79, 2, 3, 24.89, '2021-05-26 10:07:03'); 149 | INSERT INTO `records` VALUES (80, 2, 3, 24.29, '2021-05-28 15:06:54'); 150 | INSERT INTO `records` VALUES (81, 2, 3, 24.35, '2021-05-28 15:06:58'); 151 | INSERT INTO `records` VALUES (82, 2, 3, 38.21, '2021-05-28 15:07:09'); 152 | INSERT INTO `records` VALUES (83, 2, 3, 24.23, '2021-05-28 15:07:22'); 153 | INSERT INTO `records` VALUES (84, 2, 3, 37.41, '2021-05-28 15:07:30'); 154 | INSERT INTO `records` VALUES (85, 2, 3, 24.51, '2021-05-28 15:07:34'); 155 | INSERT INTO `records` VALUES (86, 2, 3, 24.45, '2021-05-28 15:07:38'); 156 | INSERT INTO `records` VALUES (87, 2, 3, 27.15, '2021-06-03 16:44:22'); 157 | INSERT INTO `records` VALUES (88, 2, 3, 26.91, '2021-06-03 16:44:26'); 158 | INSERT INTO `records` VALUES (89, 2, 3, 26.99, '2021-06-03 16:44:35'); 159 | INSERT INTO `records` VALUES (90, 2, 3, 26.97, '2021-06-03 16:44:59'); 160 | INSERT INTO `records` VALUES (91, 2, 3, 27.17, '2021-06-03 16:45:03'); 161 | INSERT INTO `records` VALUES (92, 2, 3, 27.21, '2021-06-03 16:45:07'); 162 | INSERT INTO `records` VALUES (93, 2, 3, 27.05, '2021-06-03 16:45:17'); 163 | INSERT INTO `records` VALUES (94, 3, 3, 26.61, '2021-06-03 17:05:45'); 164 | INSERT INTO `records` VALUES (95, 3, 3, 27.09, '2021-06-03 17:05:49'); 165 | INSERT INTO `records` VALUES (96, 2, 3, 27.11, '2021-06-05 08:33:10'); 166 | INSERT INTO `records` VALUES (97, 2, 3, 27.25, '2021-06-05 08:33:16'); 167 | INSERT INTO `records` VALUES (98, 2, 3, 26.99, '2021-06-05 08:33:21'); 168 | INSERT INTO `records` VALUES (99, 2, 3, 27.21, '2021-06-05 08:33:34'); 169 | INSERT INTO `records` VALUES (100, 2, 3, 27.29, '2021-06-05 08:34:03'); 170 | INSERT INTO `records` VALUES (101, 2, 3, 27.05, '2021-06-05 08:34:07'); 171 | INSERT INTO `records` VALUES (102, 2, 3, 27.75, '2021-06-05 08:37:02'); 172 | INSERT INTO `records` VALUES (103, 2, 3, 37.87, '2021-06-05 08:37:06'); 173 | INSERT INTO `records` VALUES (104, 2, 3, 30.09, '2021-06-05 08:38:39'); 174 | INSERT INTO `records` VALUES (105, 3, 3, 30.99, '2021-06-05 08:39:48'); 175 | INSERT INTO `records` VALUES (106, 3, 3, 29.89, '2021-06-05 08:40:12'); 176 | INSERT INTO `records` VALUES (107, 2, 3, 29.77, '2021-06-05 08:40:25'); 177 | INSERT INTO `records` VALUES (108, 3, 3, 27.87, '2021-06-05 08:44:56'); 178 | INSERT INTO `records` VALUES (109, 2, 3, 28.75, '2021-06-05 08:51:25'); 179 | INSERT INTO `records` VALUES (110, 2, 3, 28.01, '2021-06-05 08:51:35'); 180 | INSERT INTO `records` VALUES (111, 2, 3, 27.99, '2021-06-05 08:51:45'); 181 | INSERT INTO `records` VALUES (112, 2, 3, 29.15, '2021-06-05 08:51:59'); 182 | INSERT INTO `records` VALUES (113, 2, 3, 28.59, '2021-06-05 08:53:18'); 183 | INSERT INTO `records` VALUES (114, 2, 3, 27.87, '2021-06-05 09:08:08'); 184 | INSERT INTO `records` VALUES (115, 2, 3, 27.03, '2021-06-05 09:13:51'); 185 | INSERT INTO `records` VALUES (116, 2, 3, 28.85, '2021-06-05 09:16:42'); 186 | INSERT INTO `records` VALUES (117, 2, 3, 28.31, '2021-06-05 09:16:50'); 187 | INSERT INTO `records` VALUES (118, 2, 3, 27.93, '2021-06-05 09:17:44'); 188 | INSERT INTO `records` VALUES (119, 2, 3, 28.71, '2021-06-05 09:19:15'); 189 | INSERT INTO `records` VALUES (120, 3, 3, 30.67, '2021-06-08 19:45:35'); 190 | INSERT INTO `records` VALUES (121, 3, 3, 30.47, '2021-06-08 19:45:39'); 191 | INSERT INTO `records` VALUES (122, 3, 3, 30.45, '2021-06-08 19:45:43'); 192 | INSERT INTO `records` VALUES (123, 3, 3, 30.63, '2021-06-08 19:45:47'); 193 | INSERT INTO `records` VALUES (124, 3, 3, 33.51, '2021-06-08 19:45:51'); 194 | INSERT INTO `records` VALUES (125, 3, 3, 34.09, '2021-06-08 19:45:55'); 195 | INSERT INTO `records` VALUES (126, 3, 3, 29.43, '2021-06-08 19:45:59'); 196 | INSERT INTO `records` VALUES (127, 3, 3, 29.03, '2021-06-08 19:46:03'); 197 | INSERT INTO `records` VALUES (128, 3, 3, 29.37, '2021-06-08 19:46:07'); 198 | INSERT INTO `records` VALUES (129, 3, 3, 32.89, '2021-06-08 19:46:23'); 199 | INSERT INTO `records` VALUES (130, 3, 3, 31.25, '2021-06-08 19:46:29'); 200 | INSERT INTO `records` VALUES (131, 3, 3, 32.41, '2021-06-08 19:46:55'); 201 | INSERT INTO `records` VALUES (132, 3, 3, 31.33, '2021-06-08 19:46:59'); 202 | INSERT INTO `records` VALUES (133, 3, 3, 31.63, '2021-06-08 19:47:03'); 203 | INSERT INTO `records` VALUES (134, 3, 3, 31.61, '2021-06-08 19:47:07'); 204 | COMMIT; 205 | 206 | -- ---------------------------- 207 | -- Table structure for user 208 | -- ---------------------------- 209 | DROP TABLE IF EXISTS `user`; 210 | CREATE TABLE `user` ( 211 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户唯一id', 212 | `name` varchar(255) DEFAULT NULL COMMENT '姓名', 213 | `facefeature` json DEFAULT NULL COMMENT '存储特征信息', 214 | `image` varchar(255) DEFAULT NULL COMMENT '存储图片二进制流', 215 | `flag` int(1) DEFAULT '0' COMMENT '注销标志,1:注销,0:正常', 216 | `time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, 217 | PRIMARY KEY (`id`) USING BTREE 218 | ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4; 219 | 220 | -- ---------------------------- 221 | -- Records of user 222 | -- ---------------------------- 223 | BEGIN; 224 | INSERT INTO `user` VALUES (2, '徐某某', '{\"feature\": [2.1875, -0.96728515625, 0.245849609375, 1.2353515625, 2.390625, -1.0888671875, 0.08367919921875, 0.96923828125, 1.8115234375, 1.078125, 1.1708984375, -0.76904296875, -0.47705078125, 0.65087890625, -2.607421875, -0.2103271484375, -0.30078125, 1.3134765625, 0.80908203125, 1.30078125, 1.5322265625, 2.234375, 0.728515625, -0.9326171875, -0.12017822265625, -1.1640625, -0.68115234375, 0.3662109375, 1.056640625, 2.931640625, 0.091796875, 0.435546875, -1.623046875, 3.181640625, 0.11077880859375, 0.21240234375, -0.69287109375, -1.1650390625, -0.70263671875, 0.396484375, -1.21875, 0.794921875, -0.068115234375, 0.466552734375, 0.1463623046875, -0.7412109375, -1.69921875, -0.734375, -0.90869140625, 1.4052734375, -0.431884765625, 1.0859375, 1.1064453125, 0.810546875, -0.24169921875, -0.95751953125, -0.578125, -0.1383056640625, 0.41357421875, 0.90478515625, 1.2548828125, -0.23779296875, -0.2276611328125, -0.30908203125, 0.2509765625, -2.111328125, -1.2294921875, -0.11578369140625, -0.417236328125, -0.154296875, -0.251708984375, 0.296630859375, 1.48828125, -0.39794921875, -0.398193359375, -1.876953125, 3.375, 2.216796875, -0.50537109375, 0.162841796875, -0.74365234375, 1.0341796875, -1.669921875, -0.2900390625, 1.017578125, 0.1480712890625, 1.3720703125, -1.0654296875, -1.1005859375, -0.30078125, -1.1611328125, -0.37158203125, 0.0233917236328125, 0.3291015625, 0.376708984375, 0.05706787109375, -0.0474853515625, -1.564453125, -0.36328125, -1.0048828125, 0.6220703125, -0.6357421875, 1.341796875, 0.64111328125, 1.15234375, 1.421875, 0.2861328125, -1.1328125, 0.2384033203125, -1.3359375, 0.1973876953125, 1.1181640625, -0.319580078125, -0.5126953125, -0.96630859375, -0.03741455078125, 0.6591796875, 0.01445770263671875, 0.273681640625, 0.56689453125, 0.26904296875, 0.445068359375, -0.08349609375, 3.21484375, -0.9130859375, 0.2027587890625, 0.60400390625, 0.63232421875, 0.0594482421875, -0.484130859375, 0.94921875, 0.2462158203125, 1.5166015625, -1.201171875, 1.6923828125, 0.296142578125, 2.16015625, 0.37841796875, 0.517578125, 1.328125, -2.3046875, 0.88525390625, 1.3544921875, 0.2744140625, -0.02935791015625, -1.5546875, 0.2158203125, -0.1378173828125, -0.372802734375, -0.01751708984375, -0.8759765625, 0.89453125, -1.142578125, -0.599609375, 1.3447265625, 0.456787109375, -1.1005859375, -1.28515625, -0.0670166015625, -1.36328125, -1.0078125, 1.2783203125, -0.76904296875, 1.1875, -2.33984375, 0.1552734375, 0.76953125, 0.233154296875, -0.1854248046875, 2.150390625, 2.10546875, -1.001953125, -0.5556640625, -1.3154296875, 0.47412109375, 0.6689453125, 0.450439453125, 0.0789794921875, 2.216796875, -0.85791015625, 1.181640625, -1.0478515625, -0.2310791015625, 1.0107421875, 1.087890625, 0.94140625, 1.7578125, -1.4306640625, 0.448974609375, 0.10809326171875, 0.020294189453125, -0.1947021484375, 0.84912109375, 1.4775390625, -1.322265625, -0.371826171875, -0.278076171875, -0.96630859375, -0.84619140625, -1.4677734375, -0.70068359375, 0.2257080078125, 1.880859375, -0.56591796875, 0.4384765625, -0.34619140625, 0.56689453125, 0.73193359375, 0.1048583984375, -1.884765625, -0.2978515625, 0.306396484375, 0.498291015625, -0.391357421875, -1.37109375, -1.2568359375, -1.6259765625, -0.748046875, 0.492431640625, 1.4736328125, -0.4755859375, 1.87890625, 0.9482421875, -1.978515625, -1.9208984375, 3.572265625, 1.232421875, 1.1552734375, 1.599609375, -0.324462890625, -0.97021484375, 0.177001953125, -0.57421875, 1.7685546875, -0.728515625, 0.98583984375, 0.65283203125, 0.1943359375, -1.08984375, 1.21875, 1.4755859375, -0.5478515625, -1.4453125, -0.7333984375, -1.1171875, 0.5185546875, -0.2802734375, 2.17578125, -0.611328125, 0.33544921875, -1.45703125, 0.90283203125, -1.6201171875, 2.109375, -0.7890625, -0.359619140625, 1.5244140625, -0.92724609375, 0.8203125, -0.220458984375, -1.498046875, 0.640625, -1.189453125, 0.1632080078125, -1.3095703125, -1.154296875, 0.477783203125, 1.6181640625, 0.4423828125, -0.54296875, 0.457763671875, 0.1253662109375, -0.76806640625, -0.60595703125, -0.72705078125, 1.8232421875, 0.08453369140625, -0.931640625, 0.55859375, 0.7197265625, 0.66064453125, -1.908203125, -0.296630859375, 2.015625, 0.97412109375, 0.127685546875, 0.8212890625, 0.677734375, 1.044921875, -0.53662109375, -0.86767578125, 1.3125, 0.04925537109375, -0.0655517578125, 0.83056640625, 1.490234375, -0.042388916015625, 0.300048828125, -0.998046875, 0.062225341796875, -0.515625, -0.380126953125, 1.2333984375, -0.14306640625, 1.0205078125, -0.152587890625, 1.478515625, -0.1396484375, -0.44482421875, -0.85791015625, 0.98779296875, -0.01001739501953125, 0.50537109375, -0.8818359375, 0.65283203125, -1.5126953125, -1.078125, -0.87451171875, 1.958984375, -1.46875, -0.7099609375, 0.2120361328125, -1.33984375, -0.6015625, -0.720703125, -1.4384765625, -0.84814453125, -0.9765625, -1.6337890625, -0.2724609375, 2.162109375, 0.138916015625, 2.521484375, -0.240478515625, -2.0703125, 1.2548828125, 0.30224609375, -1.318359375, -0.43603515625, -0.83056640625, -0.53173828125, -1.9599609375, 0.615234375, -1.28515625, 0.75537109375, 0.76708984375, -1.400390625, 0.270751953125, -0.01507568359375, -0.55712890625, 0.2105712890625, 0.9990234375, -0.024810791015625, -0.447021484375, -0.947265625, 0.6650390625, -0.20263671875, 1.23046875, 0.8212890625, 1.0595703125, -0.64794921875, -0.87158203125, 0.258056640625, 0.449462890625, -1.2626953125, 0.51904296875, -0.556640625, -0.6533203125, 1.044921875, -1.83984375, -1.9482421875, 0.5048828125, 1.677734375, -0.1011962890625, -0.732421875, -0.83056640625, -0.01406097412109375, -0.884765625, -1.0615234375, -0.403076171875, 0.42431640625, -1.51953125, 0.71240234375, -1.7666015625, -0.210693359375, 1.4365234375, -1.7568359375, 0.1322021484375, -0.9169921875, -1.6337890625, 0.853515625, 0.99609375, -0.54443359375, -0.72900390625, -1.7265625, 0.6875, -0.376220703125, 0.31298828125, -0.03863525390625, 0.1578369140625, -0.09893798828125, -0.75341796875, 0.953125, 0.003376007080078125, 0.249755859375, 0.479248046875, -0.77490234375, 0.11578369140625, -0.12481689453125, -0.51904296875, -0.779296875, 0.210693359375, 0.2578125, -0.806640625, -0.33203125, -0.0004925727844238281, 1.3408203125, 0.68359375, 0.625, 0.44287109375, -0.890625, -0.06304931640625, -0.94970703125, 0.9833984375, 0.802734375, -1.447265625, 0.8369140625, -0.0208587646484375, 1.017578125, -0.42041015625, 1.099609375, 1.4853515625, 0.29296875, -2.31640625, -0.1683349609375, 2.0546875, 0.09136962890625, 0.407470703125, 0.4580078125, -1.01953125, 0.7060546875, 0.6748046875, 1.5048828125, 0.048248291015625, -0.10711669921875, 0.92724609375, -0.0574951171875, -1.201171875, -0.31591796875, -1.2021484375, 0.9287109375, 0.021697998046875, 0.76904296875, -0.708984375, 0.79638671875, 0.5380859375, 0.84814453125, -0.1630859375, -0.31494140625, 0.2098388671875, 0.56982421875, -0.18994140625, -0.01419830322265625, -0.0306243896484375, -1.8505859375, -0.9482421875, 1.5439453125, -0.96142578125, 0.18603515625, -0.4404296875, -0.8486328125, -0.0557861328125, -0.2352294921875, 0.69677734375, -0.019439697265625, 0.81884765625, 1.3388671875, 0.6494140625, -0.6298828125, -0.2734375, 2.248046875, 0.1348876953125, 0.34326171875, -1.7919921875, -0.998046875, -1.943359375, -0.038177490234375, 0.1351318359375, -2.0078125, -1.873046875, 0.8271484375, 0.419189453125, 0.44580078125, 1.6044921875, -1.3994140625, -1.0009765625, -0.112060546875, 0.51611328125, 1.162109375, -0.98388671875, -0.297607421875, 0.23388671875, -0.405517578125, 0.30419921875, 0.151123046875, -0.456298828125, -0.1832275390625, 0.17236328125, -0.1793212890625, 0.30517578125, -0.150634765625, 0.5966796875, 0.0784912109375, -0.5380859375, -0.89892578125, -0.050201416015625, 0.2958984375, -0.040374755859375, -0.75537109375, 0.431884765625, -0.2274169921875, -0.398681640625, 0.537109375, 0.1971435546875, 0.309326171875, 0.080078125, -0.6953125, -0.2144775390625, -0.0867919921875, 0.318603515625, 0.043243408203125, 0.481201171875, -0.419921875, 0.1290283203125, 0.1231689453125, -0.08612060546875, 0.716796875, 0.252197265625, 0.1451416015625, -0.50244140625, -0.07342529296875, 0.94580078125, 0.05096435546875, -0.70361328125, -0.8095703125, -0.222412109375, 0.09698486328125, 0.071533203125, -0.43212890625, 0.1895751953125, -1.212890625, -0.287353515625, -0.397216796875, 0.53369140625, 0.06329345703125, -0.322998046875, 0.00870513916015625, -0.45849609375, 0.462646484375, 0.57861328125, 0.5107421875, -0.392578125, -0.5751953125, 0.42236328125, 0.64892578125, 0.040008544921875, -0.12066650390625, -0.1756591796875, -0.06927490234375, -0.2386474609375, -0.2474365234375, -0.859375, -0.67919921875, 0.384521484375, -1.0166015625, 0.0654296875, -0.25341796875, 0.2138671875, -0.58251953125, -0.49169921875, -0.62060546875, 0.37109375, -0.35498046875, -0.02581787109375, 0.06402587890625, 0.60205078125, -0.30712890625, -0.1829833984375, -0.253662109375, 0.30224609375, -0.75390625, -0.376220703125, -0.233154296875, -0.650390625, -0.615234375, 0.1253662109375, -0.203369140625, -0.037567138671875, -0.1822509765625, -0.87255859375, 0.73828125, -0.341064453125, -0.546875, 0.513671875, -0.1505126953125, 0.7080078125, 1.119140625, -0.8076171875, 0.255615234375, 0.18408203125, 0.07745361328125, -0.61279296875, -0.13037109375, 0.3388671875, -0.142333984375, 0.292236328125, 0.57275390625, 0.399169921875, -0.01047515869140625, -0.2177734375, 0.1873779296875, -0.43310546875, -0.1966552734375, -0.701171875, -0.39306640625, 0.1181640625, 0.25146484375, -0.151123046875, -0.3603515625, -0.322021484375, -0.6318359375, -0.822265625, 0.278564453125, -0.70654296875, 0.13232421875, 0.3994140625, -0.437255859375, 0.99853515625, 0.34814453125, 0.01230621337890625, 0.412841796875, -0.488037109375, 0.17529296875, 0.202392578125, 0.56396484375, 0.74072265625, 0.463134765625, -0.49072265625, 0.49169921875, -0.1531982421875, -0.384765625, 0.022918701171875, -0.098388671875, -0.36669921875, 0.1259765625, 0.000804901123046875, 0.332763671875, -0.336669921875, -0.306640625, 0.00981903076171875, -0.9794921875, 0.301025390625, 0.37646484375, -0.345458984375, 0.09234619140625, -0.04681396484375, 0.681640625, -0.72021484375, -0.147705078125, 0.430419921875, 0.0140228271484375, -0.69921875, 0.224609375, -0.04510498046875, 0.1290283203125, -0.74267578125, 0.2015380859375, 0.12078857421875, -0.6484375, 0.29052734375, -0.38134765625, 0.238525390625, -0.267333984375, 0.13525390625, 0.00896453857421875, 0.1307373046875, -0.8818359375, 0.005878448486328125, 0.51171875, -0.56689453125, -0.2318115234375, 0.77783203125, 0.0024852752685546875, -0.00305938720703125, -0.309814453125, -0.5439453125, 0.465087890625, -0.420654296875, -0.224853515625, -0.16357421875, -0.134521484375, 0.1318359375, -0.79443359375, -0.5927734375, 0.646484375, -0.7392578125, 0.215087890625, -0.388671875, 0.340576171875, 0.322998046875, -0.0789794921875, -0.822265625, -0.0960693359375, 0.1431884765625, -0.33837890625, 0.96240234375, 0.75537109375, 0.708984375, 1.1103515625, 0.9775390625, -0.59375, 0.19287109375, 0.402587890625, -0.2205810546875, 0.260498046875, -0.2135009765625, -0.156982421875, 0.23828125, -0.0178680419921875, 0.6845703125, -0.095703125, 0.11944580078125, 0.60009765625, -0.031494140625, 0.42236328125, -0.016357421875, 0.2060546875, -0.67529296875, 0.1578369140625, -0.6171875, -0.35400390625, -1.2822265625, -0.204345703125, -0.58984375, -0.0880126953125, -0.1568603515625, -0.76220703125, -0.171875, -0.137939453125, -0.214599609375, -0.23095703125, 0.0126800537109375, -0.1727294921875, 0.38720703125, -0.8046875, 0.75830078125, 0.03485107421875, -0.8701171875, 0.70166015625, -0.320556640625, -0.383056640625, 0.966796875, -0.148193359375, 0.76416015625, -0.10687255859375, 0.15966796875, -0.08740234375, -0.034332275390625, 0.12890625, -0.1485595703125, 0.157470703125, -1.2119140625, -0.94140625, 0.0002887248992919922, 0.2010498046875, -0.191162109375, 0.0518798828125, 0.395751953125, 0.3662109375, -0.0203399658203125, -0.03851318359375, 0.1680908203125, 0.033660888671875, 0.4287109375, -0.0083465576171875, -0.29345703125, -0.07568359375, 0.04632568359375, -0.0200653076171875, 0.28369140625, -0.85546875, -0.09014892578125, -1.0302734375, 0.289794921875, -0.5068359375, -0.0096588134765625, 0.382568359375, 0.54052734375, 0.14892578125, 0.389892578125, 0.1363525390625, 0.0019073486328125, 0.07330322265625, 0.2340087890625, 0.09259033203125, 0.91455078125, -0.5341796875, -0.55419921875, -0.005279541015625, 0.143310546875, 0.10028076171875, -0.5458984375, -0.08148193359375, 0.19873046875, -0.364990234375, -0.2362060546875, -0.5703125, -0.4150390625, 0.0188446044921875, 0.12298583984375, -0.53271484375, 0.51904296875, -0.236083984375, -0.358154296875, 0.2291259765625, -0.1053466796875, -0.316162109375, 0.1290283203125, 0.505859375, 0.2010498046875, 0.4169921875, 0.253662109375, 0.2059326171875, 0.296630859375, 0.5654296875, 0.12030029296875, 0.6904296875, 0.59130859375, -0.168212890625, -0.21484375, -0.208251953125, -0.318603515625, 0.05584716796875, -0.72412109375, 0.64208984375, 0.205078125, -1.275390625, 0.0244140625, -0.411865234375, 0.55859375, 0.294189453125, 0.5830078125, -0.288818359375, 0.438720703125, 0.1639404296875, -0.79443359375, -0.81005859375, 0.026763916015625, -0.59375, 0.1688232421875, 0.7099609375, -0.29150390625, -0.343505859375, 0.82666015625, 0.07757568359375, 0.18212890625, 0.186279296875, 0.01334381103515625, 0.4150390625, 0.2171630859375, -0.17333984375, 0.52294921875, -0.267578125, 0.2366943359375, 0.33984375, -0.2265625, -0.459716796875, -0.406494140625, 0.30029296875, -1.0888671875, -0.33349609375, -0.10028076171875, -0.095458984375, -0.135986328125, 0.94189453125, -0.408447265625, 1.4033203125, 0.61962890625, 0.19091796875, -0.404541015625, -0.04632568359375, -0.0771484375, 0.73388671875, 0.307861328125, -0.0633544921875, 0.336669921875, 0.9521484375, 0.2025146484375, 0.79931640625, 0.245849609375, -0.059844970703125, 0.34765625, 0.339111328125, -0.56787109375, -0.00311279296875, -0.3056640625, -0.260986328125, -0.230224609375, 0.345703125, 0.1505126953125, 0.198974609375, 0.073486328125, 0.202392578125, -0.474853515625, 0.467041015625, -0.33740234375, -0.168212890625, 0.2353515625, -0.38818359375, 0.0196990966796875, 0.2330322265625, 0.0960693359375, 0.032379150390625, 0.09423828125, -0.73095703125, -0.1834716796875, 0.16796875, -1.2041015625, -0.1475830078125, 0.310546875, 0.947265625, 0.289306640625, -0.443359375, 0.34375, 0.2122802734375, 0.8203125, 0.466796875, -0.55126953125, 0.7802734375, -0.3798828125, -0.69873046875, -0.982421875, 0.5185546875, -0.90380859375, 0.0380859375, -0.1273193359375, 0.171142578125, -0.56201171875, -0.81494140625, 0.1453857421875, -1.19140625, 0.048675537109375, -0.546875, 0.41796875, -0.0924072265625, -0.79150390625, -0.058685302734375, -0.054718017578125, -0.43505859375, 0.178955078125, -0.10595703125, -0.23095703125, 0.685546875, 0.176025390625, 0.152587890625, 0.12078857421875, 0.304931640625, 0.1654052734375, -0.88525390625, -0.365478515625, 0.67626953125, -0.051605224609375, -0.292724609375, -0.3837890625, -0.045135498046875, 0.68017578125, -0.6005859375, 0.15625, -0.39990234375, 0.08203125, 0.19921875, -0.42236328125, -0.2880859375, 0.092041015625, 0.1492919921875, -0.09588623046875, 0.1956787109375, 0.323486328125, -0.2186279296875, -0.0143280029296875, 0.352783203125, 0.08306884765625, 0.130126953125, -0.5048828125, -0.28564453125, 0.67919921875, -0.1380615234375, 0.5732421875, -0.342041015625, 0.28759765625, -1.1640625, -0.1697998046875, 0.477783203125, 0.286376953125, 0.358642578125, -0.71337890625, -0.39306640625, 0.55322265625, -0.466796875, 1.0888671875, 0.28466796875, -0.086181640625, 0.182373046875, -0.67724609375, 0.246826171875, 0.462646484375, 0.208984375, -0.5078125, 0.14501953125, 0.116943359375, -1.248046875, -0.366943359375, -0.022247314453125, -0.493408203125], \"coordinate\": [82, 100, 219, 219]}', 'http://192.168.2.233:8445/image/jpg/2.jpg', 0, '2021-06-08 19:30:35'); 225 | INSERT INTO `user` VALUES (3, '张俊辉', '{\"feature\": [-2.484375, 0.3583984375, 0.37255859375, 0.28857421875, 0.6015625, 0.5732421875, 0.8046875, 1.775390625, 2.48828125, 0.298583984375, 0.52392578125, 2.703125, 0.75732421875, 3.427734375, 1.724609375, -0.9501953125, -0.9384765625, -1.7822265625, -0.374267578125, -0.489501953125, 0.78466796875, 1.3388671875, 1.4228515625, -1.220703125, 1.3720703125, -0.09552001953125, -0.67919921875, -2.064453125, -2.412109375, -0.75244140625, 0.7509765625, 0.6181640625, 0.4853515625, -0.1964111328125, 0.923828125, 1.603515625, 1.1767578125, -0.9267578125, -1.109375, -0.404541015625, -0.6669921875, 1.01171875, -0.08740234375, -0.52978515625, -1.3310546875, -0.8037109375, -2.52734375, -0.9443359375, -1.998046875, 0.2421875, -0.491943359375, 2.12890625, 0.4091796875, -0.67333984375, 0.9248046875, -0.41650390625, 2.193359375, -1.5244140625, 0.830078125, 0.220458984375, 2.056640625, 0.42236328125, 0.93310546875, -2.26953125, 1.845703125, 0.07562255859375, -1.267578125, 0.353515625, -0.90869140625, -0.57763671875, -1.7548828125, -0.32666015625, -2.17578125, 1.2431640625, 1.73046875, 1.294921875, 0.869140625, 1.6884765625, 0.0162200927734375, 3.29296875, 0.2197265625, 0.6708984375, 0.68505859375, -1.7880859375, 0.75341796875, 2.201171875, 0.86767578125, -2.34765625, -1.3955078125, -0.99560546875, -1.44921875, 1.3857421875, -2.67578125, -0.1424560546875, 2.4765625, 1.80078125, 1.5986328125, -1.2734375, 2.228515625, 0.4755859375, 0.484130859375, 0.98291015625, 1.0576171875, -0.35791015625, 0.431884765625, 0.68701171875, -0.65869140625, 0.71337890625, -0.09381103515625, 0.04168701171875, 1.3359375, -1.076171875, -2.408203125, 2.021484375, -2.828125, 2.078125, 0.173095703125, -0.74560546875, -0.94091796875, -0.76611328125, 0.69287109375, -1.3955078125, 0.7861328125, 1.3154296875, 2.357421875, 3.181640625, 0.830078125, -0.4384765625, 0.325439453125, 0.61865234375, 0.0229644775390625, 0.63427734375, -2.3515625, 0.07403564453125, 2.111328125, -2.072265625, -0.285400390625, 0.386474609375, 1.9990234375, -2.087890625, -0.386962890625, 0.07830810546875, 0.5048828125, -1.14453125, 3.9765625, 1.7216796875, 0.8935546875, 1.060546875, 0.468017578125, 0.5546875, 1.083984375, -0.76904296875, 0.200439453125, 1.666015625, -0.426513671875, 0.077392578125, 1.0556640625, -1.9248046875, -2.990234375, -2.751953125, -0.246826171875, 1.4482421875, -1.5390625, 1.927734375, -0.89990234375, -1.24609375, 0.278564453125, 2.72265625, -1.8720703125, -0.286376953125, 1.4638671875, -1.3193359375, 1.056640625, -0.1175537109375, 1.3935546875, -1.697265625, -2.33203125, -1.5146484375, 0.14404296875, 1.1826171875, 3.53515625, -2.3046875, -1.2294921875, 0.481689453125, 2.064453125, 0.794921875, 1.970703125, 0.802734375, -1.517578125, 0.10064697265625, -0.09210205078125, -2.298828125, -0.09954833984375, 0.463623046875, -0.89111328125, 1.529296875, -0.3203125, 2.00390625, 1.9951171875, -1.0576171875, -2.005859375, -1.51953125, 1.126953125, -0.341796875, 0.42431640625, 1.3212890625, 0.9453125, -0.444580078125, 0.250732421875, -1.7587890625, 0.282470703125, -0.43798828125, -1.0927734375, -0.94970703125, -0.77880859375, -1.8349609375, -1.423828125, 2.1953125, 0.3779296875, 1.5322265625, -0.8154296875, -0.728515625, 0.2235107421875, 1.19921875, 2.40234375, 3.40234375, -1.1376953125, -0.67626953125, 1.375, -0.84326171875, -0.362060546875, 0.9560546875, -0.603515625, 3, -1.0947265625, 0.5849609375, 0.4375, 0.9599609375, 0.10711669921875, -0.7685546875, -0.271728515625, -2.7109375, -0.017913818359375, 0.275146484375, -0.16552734375, -1.16796875, 0.6435546875, -0.9169921875, 1.5185546875, 1.888671875, 0.90087890625, 3.203125, 1.30078125, 1.693359375, -0.939453125, 1.376953125, -1.0517578125, -1.283203125, 3.494140625, 2.322265625, -0.9208984375, -0.1475830078125, -0.252197265625, -1.2705078125, -1.326171875, 0.321533203125, -0.724609375, -0.275390625, -1.3642578125, -2.703125, 0.242431640625, 1.0556640625, -0.130126953125, -1.2841796875, 1.7724609375, -0.853515625, -0.42919921875, 0.12939453125, -0.153564453125, -0.28466796875, -0.12408447265625, -0.40966796875, 0.65869140625, 1.8349609375, 2.00390625, 2.529296875, -0.06524658203125, 1.2939453125, 0.81201171875, -1.892578125, -0.6201171875, 0.058135986328125, -0.09686279296875, 2.71484375, -1.3466796875, 0.5927734375, -0.2108154296875, -1.0439453125, -0.12274169921875, 2.017578125, -0.204345703125, -2.158203125, 3.513671875, -0.439453125, -0.83251953125, 0.8505859375, 1.7744140625, -0.7783203125, 0.306884765625, 1.0615234375, 2.138671875, -0.310791015625, -1.1279296875, -2.451171875, 2.189453125, -1.529296875, -0.07281494140625, 0.3505859375, -0.0163421630859375, -2.541015625, -0.8037109375, 0.94091796875, -1.814453125, -0.52099609375, -1.3974609375, -3.00390625, -2.203125, -0.0723876953125, -1.65234375, 2.681640625, -0.1658935546875, 1.349609375, -0.033721923828125, -0.394287109375, -1.9013671875, 0.04351806640625, 1.205078125, 1.375, 0.6396484375, -1.943359375, -0.299072265625, -0.865234375, -0.3388671875, -0.33056640625, 1.3486328125, -0.2459716796875, -2.416015625, -0.56982421875, -0.53076171875, 0.00008571147918701172, 1.33984375, -1.2197265625, 0.0278167724609375, -1.8173828125, 0.44140625, 0.87548828125, -0.625, -0.66943359375, -2.029296875, 0.6953125, 2.732421875, -0.01197052001953125, 0.315673828125, 1.08984375, -1.08984375, -0.98095703125, -1.33203125, -1.3310546875, 1.9521484375, -3.109375, 0.0811767578125, -0.68115234375, -1.8603515625, -0.473876953125, -1.091796875, -0.67529296875, -1.751953125, -3.12890625, 2.12109375, 0.9833984375, 0.039825439453125, 0.70458984375, 0.420166015625, -0.8671875, -0.0122528076171875, -1.8134765625, -0.638671875, -1.2275390625, -2.1796875, -0.53076171875, 1.427734375, -0.08685302734375, 2.345703125, -0.53466796875, -0.88232421875, -1.66015625, -1.3662109375, 1.4912109375, -1.845703125, -0.08319091796875, 1.498046875, 1.51953125, -0.354248046875, 0.97607421875, 2.791015625, -0.146240234375, 0.08721923828125, 1.0810546875, 0.3623046875, -1.38671875, -1.9306640625, 0.62841796875, 3.796875, -1.1025390625, 1.1845703125, -0.7314453125, 2.396484375, 0.18017578125, -0.322021484375, -2.455078125, -2.31640625, 1.00390625, 0.350341796875, -1.404296875, -0.4697265625, -0.79345703125, -1.2490234375, -2.37109375, -0.50732421875, 0.3017578125, 2.400390625, -1.1669921875, 1.4013671875, -2.779296875, 0.52734375, -0.28271484375, 2.0703125, -0.66845703125, -1.05078125, -1.521484375, -1.6220703125, 2.314453125, -0.57470703125, -0.01593017578125, -0.0401611328125, 1.3232421875, -0.14794921875, -0.1649169921875, -3.45703125, -1.544921875, -1.1279296875, -0.269775390625, 1.1064453125, -0.7578125, 0.82861328125, 3.423828125, 1.9365234375, 0.7451171875, 3.142578125, 1.619140625, 0.9853515625, 0.2587890625, 1.427734375, 0.271728515625, -0.207763671875, 0.42041015625, 2.884765625, 0.83642578125, -0.261962890625, -2.447265625, 1.2587890625, 0.6708984375, 0.04168701171875, -1.7734375, 0.74267578125, -0.65234375, 1.8623046875, -0.47314453125, 0.8271484375, -2.748046875, 2.130859375, 2.025390625, 0.5009765625, 0.513671875, 0.0921630859375, 0.64013671875, -3.091796875, -1.197265625, -2.392578125, -1.572265625, 0.60791015625, -0.0285797119140625, 2.017578125, -1.7509765625, -0.90576171875, -1.9921875, -0.60595703125, 3.669921875, -2.1640625, -1.033203125, 1.09765625, -1.5654296875, 0.77734375, 1.15625, -1.5234375, 3.68359375, 0.3203125, 0.71044921875, 0.517578125, -2.900390625, -1.2216796875, 1.3447265625, 0.71142578125, -1.14453125, 0.1544189453125, -0.25732421875, 0.1815185546875, -1.544921875, -0.66064453125, 0.74853515625, -0.356201171875, -0.35595703125, 0.1107177734375, -0.223388671875, 0.460693359375, 0.364990234375, 0.32080078125, -0.3310546875, 0.08648681640625, 0.332763671875, -1.3291015625, 0.572265625, -0.0279541015625, -0.71044921875, 0.08355712890625, -0.77197265625, 0.197021484375, 0.3271484375, 0.0137786865234375, -0.2410888671875, -0.0096893310546875, -0.4013671875, -2.0078125, 0.8115234375, 0.332275390625, -0.65966796875, 0.35888671875, 0.154541015625, 1.1572265625, 1.150390625, -1.0986328125, -1.53515625, -0.60498046875, 0.9716796875, -0.02337646484375, -0.6015625, -0.280029296875, -0.11627197265625, -0.73486328125, 2.1015625, 1.15625, -0.294189453125, 0.027130126953125, 0.16455078125, 0.299560546875, 0.386474609375, -0.55224609375, 0.411376953125, 0.2366943359375, -1.775390625, -1.333984375, -0.489501953125, 0.80810546875, 1.2138671875, 0.039825439453125, 1.2890625, -0.41552734375, 0.32470703125, -0.95947265625, -1.400390625, 0.13916015625, 2.123046875, -0.82275390625, -0.9853515625, -1.103515625, 1.1875, -0.414794921875, -0.242919921875, -1.0341796875, -0.9326171875, -0.90234375, -0.2301025390625, 0.1663818359375, -0.232177734375, -1.62109375, -0.798828125, 0.74658203125, -0.755859375, 0.333984375, 0.8828125, -0.43505859375, 1.142578125, 1.046875, 0.64794921875, 0.58447265625, -0.005970001220703125, 1.869140625, -0.583984375, -0.86376953125, 1.533203125, 0.748046875, -0.3828125, -0.346923828125, 0.3759765625, 0.04327392578125, -1.220703125, -0.11724853515625, -0.84375, 0.65966796875, -0.2027587890625, 0.8896484375, -1.0478515625, -1.005859375, -0.74267578125, -0.56787109375, 0.2255859375, -0.1983642578125, -0.8212890625, -1.0224609375, -0.66943359375, -1.25390625, -0.0276336669921875, 0.78076171875, -0.63037109375, -0.11920166015625, 0.237060546875, 0.0478515625, -0.214111328125, 1.0498046875, -0.11529541015625, 0.83251953125, 0.2081298828125, 0.1083984375, -0.280029296875, 0.438232421875, 0.50634765625, 0.3271484375, 0.45263671875, -0.4765625, 0.5068359375, -1.3828125, 0.59912109375, -0.1724853515625, 0.6552734375, 0.794921875, -0.65673828125, 0.14111328125, 0.478271484375, 0.72607421875, 0.53271484375, -1.8720703125, 0.453857421875, 0.6611328125, -0.61962890625, 1.0400390625, 0.23095703125, 0.0262451171875, -1.4169921875, 0.133056640625, 0.8916015625, -0.27099609375, -1.09765625, -0.034088134765625, -0.0026721954345703125, 0.62255859375, -0.5791015625, 0.51953125, 0.2587890625, -0.951171875, -0.1661376953125, 1.66796875, -0.054901123046875, -1.0986328125, -0.10113525390625, 0.46630859375, 0.357421875, -0.89990234375, 0.2398681640625, 1.056640625, -1.5771484375, -0.2137451171875, 0.06866455078125, 0.14599609375, 0.0222320556640625, 0.193603515625, -1.20703125, -0.4931640625, 0.05377197265625, 0.458251953125, 0.56884765625, 1.5078125, 0.10125732421875, -1.123046875, -0.5146484375, 1.080078125, -0.1026611328125, 0.322265625, 0.72998046875, 0.64990234375, 0.82958984375, -0.383056640625, 0.38720703125, -0.99169921875, 0.55419921875, -0.2237548828125, 1.0791015625, -0.64697265625, -0.1719970703125, 1.4521484375, 0.318115234375, -0.73046875, 0.6552734375, -1.2412109375, -0.6591796875, 1.330078125, -0.95703125, 0.301025390625, 0.52490234375, 0.1566162109375, 0.49169921875, -1.412109375, 0.0908203125, 0.482177734375, 0.307861328125, 0.66259765625, 0.96826171875, 0.61181640625, 0.191162109375, -0.7109375, 0.363037109375, 0.197265625, -1.240234375, -1.5029296875, 0.383056640625, -0.59326171875, -1.126953125, -0.71923828125, 0.28564453125, -0.1727294921875, 0.58837890625, -0.8134765625, -0.420166015625, -0.81201171875, -0.373291015625, -0.450439453125, 0.56591796875, 0.01174163818359375, -0.02728271484375, 0.2413330078125, -0.38037109375, 0.327880859375, 0.93017578125, -0.25146484375, 0.032562255859375, 0.39453125, -0.89599609375, -0.81005859375, 1.130859375, -0.2919921875, 0.05963134765625, 1.109375, -1.435546875, -0.316650390625, 0.98779296875, 0.78076171875, 0.0008873939514160156, 0.04583740234375, 0.34423828125, 0.74853515625, -0.13671875, -0.89013671875, -0.224609375, -0.2391357421875, 0.0228271484375, 0.55859375, 0.1781005859375, 0.859375, -0.341064453125, 0.8515625, 1.400390625, -0.202880859375, 0.59521484375, -0.8037109375, 2.189453125, 0.7734375, 0.0849609375, 0.24072265625, 1.708984375, 0.053131103515625, 0.015625, -0.405517578125, 0.732421875, -1.046875, 1.8251953125, 0.11016845703125, -0.83056640625, -0.79248046875, 0.1295166015625, -0.08587646484375, 0.35498046875, -0.78369140625, -0.658203125, -0.0452880859375, -0.1279296875, -0.9609375, -0.334228515625, 0.25634765625, -0.00371551513671875, 0.352783203125, -0.5556640625, -0.68994140625, 0.2293701171875, -1.169921875, 0.394287109375, 0.5107421875, -0.74609375, -0.71435546875, -0.77587890625, 1.609375, 0.12237548828125, -1.390625, 1.3232421875, 0.3291015625, 1.5712890625, 0.55224609375, 0.062042236328125, 0.73046875, 0.8681640625, 0.6875, -0.29541015625, 0.426513671875, 0.1270751953125, 0.331787109375, -0.96533203125, -0.150146484375, -1.1328125, 0.1837158203125, 0.184326171875, 0.765625, 0.5966796875, 0.5400390625, 1.103515625, 0.59375, 1.2900390625, 0.48681640625, 0.1756591796875, -0.028472900390625, 0.145751953125, -0.939453125, 0.12420654296875, 1.119140625, -0.77099609375, -0.41259765625, 0.96826171875, 0.2464599609375, 0.4892578125, -0.10821533203125, 0.11724853515625, -0.2159423828125, 0.2440185546875, -0.7373046875, -0.01473236083984375, -0.91064453125, -0.623046875, 0.81591796875, -0.6201171875, -1.7333984375, -0.407958984375, 0.389404296875, -1.8056640625, -0.4150390625, -0.07623291015625, 1.4482421875, 0.68994140625, -0.05615234375, -0.5869140625, 0.130859375, 0.027130126953125, 0.5830078125, -0.007049560546875, 0.1383056640625, -0.7001953125, 1.021484375, 0.54931640625, -0.87353515625, -0.448974609375, 0.7822265625, -0.791015625, 0.50439453125, 0.234619140625, 1.47265625, 1.6142578125, 0.1343994140625, -0.0816650390625, 0.52734375, -1.7197265625, 0.79443359375, -0.63818359375, 0.71923828125, 0.73486328125, 0.386474609375, -0.308837890625, 1.0341796875, 0.5546875, 0.043487548828125, -0.9130859375, 0.09130859375, -0.362548828125, -0.06622314453125, -0.4541015625, 1.04296875, -0.03985595703125, 0.5478515625, -0.56298828125, -1.3662109375, -0.452880859375, 0.87939453125, -0.2110595703125, -0.460693359375, 0.6494140625, -0.15087890625, -1.513671875, -1.529296875, -0.33056640625, 0.1138916015625, 0.369384765625, -0.060302734375, -0.77490234375, 2.41796875, -0.2705078125, -1.2841796875, -0.392578125, 0.11212158203125, -0.153076171875, 0.87646484375, 0.81884765625, 0.1533203125, -0.5068359375, 0.25927734375, -0.1109619140625, -0.6953125, -1.28125, 0.1561279296875, -0.7705078125, -1.07421875, -0.77978515625, -0.66357421875, -0.7021484375, -0.33447265625, -0.517578125, 0.453369140625, -0.75048828125, 0.152099609375, 1.140625, 0.357421875, -0.53662109375, -1.681640625, 0.48388671875, -1.115234375, 0.1265869140625, -0.150146484375, -0.381591796875, -0.2607421875, 0.36474609375, -0.265380859375, -0.17333984375, -0.59814453125, 0.1641845703125, -1.55859375, 0.1146240234375, 0.449951171875, -0.52294921875, -0.8515625, 0.471435546875, -0.54833984375, 0.12255859375, 0.34619140625, 0.352783203125, -0.90576171875, -1.2958984375, -0.149658203125, -0.8466796875, 0.55810546875, -1.3671875, -0.5791015625, 1.0458984375, -1.2578125, 1.39453125, 0.521484375, -1.3427734375, -0.11322021484375, -1.373046875, 0.619140625, 0.358154296875, -0.81884765625, -0.89453125, 0.62158203125, 1.5634765625, 0.27099609375, 0.80029296875, -0.0775146484375, -0.15380859375, -0.0074920654296875, -0.431396484375, 0.216796875, 1.0380859375, -1.068359375, 0.51708984375, 1.1240234375, -0.32568359375, -0.53076171875, 0.472412109375, -0.90478515625, 1.1513671875], \"coordinate\": [29, 35, 194, 194]}', 'http://192.168.2.233:8445/image/jpg/3.jpg', 0, '2021-06-08 19:35:42'); 226 | COMMIT; 227 | 228 | -- ---------------------------- 229 | -- Table structure for user_device 230 | -- ---------------------------- 231 | DROP TABLE IF EXISTS `user_device`; 232 | CREATE TABLE `user_device` ( 233 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 234 | `uid` int(11) unsigned DEFAULT NULL, 235 | `did` int(11) unsigned DEFAULT NULL, 236 | PRIMARY KEY (`id`), 237 | KEY `uid` (`uid`), 238 | KEY `did` (`did`), 239 | CONSTRAINT `user_device_ibfk_1` FOREIGN KEY (`uid`) REFERENCES `user` (`id`), 240 | CONSTRAINT `user_device_ibfk_2` FOREIGN KEY (`did`) REFERENCES `device` (`id`) 241 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4; 242 | 243 | -- ---------------------------- 244 | -- Records of user_device 245 | -- ---------------------------- 246 | BEGIN; 247 | INSERT INTO `user_device` VALUES (1, 2, 3); 248 | INSERT INTO `user_device` VALUES (2, 3, 3); 249 | COMMIT; 250 | 251 | SET FOREIGN_KEY_CHECKS = 1; 252 | -------------------------------------------------------------------------------- /access-control-spring/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | fi 118 | 119 | if [ -z "$JAVA_HOME" ]; then 120 | javaExecutable="`which javac`" 121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 122 | # readlink(1) is not available as standard on Solaris 10. 123 | readLink=`which readlink` 124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 125 | if $darwin ; then 126 | javaHome="`dirname \"$javaExecutable\"`" 127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 128 | else 129 | javaExecutable="`readlink -f \"$javaExecutable\"`" 130 | fi 131 | javaHome="`dirname \"$javaExecutable\"`" 132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 133 | JAVA_HOME="$javaHome" 134 | export JAVA_HOME 135 | fi 136 | fi 137 | fi 138 | 139 | if [ -z "$JAVACMD" ] ; then 140 | if [ -n "$JAVA_HOME" ] ; then 141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 142 | # IBM's JDK on AIX uses strange locations for the executables 143 | JAVACMD="$JAVA_HOME/jre/sh/java" 144 | else 145 | JAVACMD="$JAVA_HOME/bin/java" 146 | fi 147 | else 148 | JAVACMD="`which java`" 149 | fi 150 | fi 151 | 152 | if [ ! -x "$JAVACMD" ] ; then 153 | echo "Error: JAVA_HOME is not defined correctly." >&2 154 | echo " We cannot execute $JAVACMD" >&2 155 | exit 1 156 | fi 157 | 158 | if [ -z "$JAVA_HOME" ] ; then 159 | echo "Warning: JAVA_HOME environment variable is not set." 160 | fi 161 | 162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 163 | 164 | # traverses directory structure from process work directory to filesystem root 165 | # first directory with .mvn subdirectory is considered project base directory 166 | find_maven_basedir() { 167 | 168 | if [ -z "$1" ] 169 | then 170 | echo "Path not specified to find_maven_basedir" 171 | return 1 172 | fi 173 | 174 | basedir="$1" 175 | wdir="$1" 176 | while [ "$wdir" != '/' ] ; do 177 | if [ -d "$wdir"/.mvn ] ; then 178 | basedir=$wdir 179 | break 180 | fi 181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 182 | if [ -d "${wdir}" ]; then 183 | wdir=`cd "$wdir/.."; pwd` 184 | fi 185 | # end of workaround 186 | done 187 | echo "${basedir}" 188 | } 189 | 190 | # concatenates all lines of a file 191 | concat_lines() { 192 | if [ -f "$1" ]; then 193 | echo "$(tr -s '\n' ' ' < "$1")" 194 | fi 195 | } 196 | 197 | BASE_DIR=`find_maven_basedir "$(pwd)"` 198 | if [ -z "$BASE_DIR" ]; then 199 | exit 1; 200 | fi 201 | 202 | ########################################################################################## 203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 204 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 205 | ########################################################################################## 206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 207 | if [ "$MVNW_VERBOSE" = true ]; then 208 | echo "Found .mvn/wrapper/maven-wrapper.jar" 209 | fi 210 | else 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 213 | fi 214 | if [ -n "$MVNW_REPOURL" ]; then 215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 216 | else 217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 218 | fi 219 | while IFS="=" read key value; do 220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 221 | esac 222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 223 | if [ "$MVNW_VERBOSE" = true ]; then 224 | echo "Downloading from: $jarUrl" 225 | fi 226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 227 | if $cygwin; then 228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 229 | fi 230 | 231 | if command -v wget > /dev/null; then 232 | if [ "$MVNW_VERBOSE" = true ]; then 233 | echo "Found wget ... using wget" 234 | fi 235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 236 | wget "$jarUrl" -O "$wrapperJarPath" 237 | else 238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 239 | fi 240 | elif command -v curl > /dev/null; then 241 | if [ "$MVNW_VERBOSE" = true ]; then 242 | echo "Found curl ... using curl" 243 | fi 244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 245 | curl -o "$wrapperJarPath" "$jarUrl" -f 246 | else 247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 248 | fi 249 | 250 | else 251 | if [ "$MVNW_VERBOSE" = true ]; then 252 | echo "Falling back to using Java to download" 253 | fi 254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 255 | # For Cygwin, switch paths to Windows format before running javac 256 | if $cygwin; then 257 | javaClass=`cygpath --path --windows "$javaClass"` 258 | fi 259 | if [ -e "$javaClass" ]; then 260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 261 | if [ "$MVNW_VERBOSE" = true ]; then 262 | echo " - Compiling MavenWrapperDownloader.java ..." 263 | fi 264 | # Compiling the Java class 265 | ("$JAVA_HOME/bin/javac" "$javaClass") 266 | fi 267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 268 | # Running the downloader 269 | if [ "$MVNW_VERBOSE" = true ]; then 270 | echo " - Running MavenWrapperDownloader.java ..." 271 | fi 272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 273 | fi 274 | fi 275 | fi 276 | fi 277 | ########################################################################################## 278 | # End of extension 279 | ########################################################################################## 280 | 281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 282 | if [ "$MVNW_VERBOSE" = true ]; then 283 | echo $MAVEN_PROJECTBASEDIR 284 | fi 285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 286 | 287 | # For Cygwin, switch paths to Windows format before running java 288 | if $cygwin; then 289 | [ -n "$M2_HOME" ] && 290 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 291 | [ -n "$JAVA_HOME" ] && 292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 293 | [ -n "$CLASSPATH" ] && 294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 295 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 297 | fi 298 | 299 | # Provide a "standardized" way to retrieve the CLI args that will 300 | # work with both Windows and non-Windows executions. 301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 302 | export MAVEN_CMD_LINE_ARGS 303 | 304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 305 | 306 | exec "$JAVACMD" \ 307 | $MAVEN_OPTS \ 308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 311 | -------------------------------------------------------------------------------- /access-control-spring/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /access-control-spring/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.5 9 | 10 | 11 | com.example 12 | demo 13 | 0.0.1-SNAPSHOT 14 | demo 15 | Demo project for Spring Boot 16 | 17 | 1.8 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-web 23 | 24 | 25 | org.mybatis.spring.boot 26 | mybatis-spring-boot-starter 27 | 2.1.4 28 | 29 | 30 | 31 | mysql 32 | mysql-connector-java 33 | runtime 34 | 35 | 36 | org.projectlombok 37 | lombok 38 | true 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-starter-test 43 | test 44 | 45 | 46 | 47 | 48 | 49 | 50 | org.springframework.boot 51 | spring-boot-maven-plugin 52 | 53 | 54 | 55 | org.projectlombok 56 | lombok 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/DemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.demo; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | @MapperScan("com.example.demo.mapper") 9 | public class DemoApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(DemoApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/controller/AdminControl.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.controller; 2 | 3 | import com.example.demo.entity.Admin; 4 | import com.example.demo.entity.AdminDevice; 5 | import com.example.demo.result.Result; 6 | import com.example.demo.service.AdminDeviceService; 7 | import com.example.demo.service.AdminService; 8 | import com.example.demo.service.DeviceService; 9 | import com.example.demo.utils.ResultUtil; 10 | import com.example.demo.view.AdminView; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.web.bind.annotation.*; 13 | 14 | import javax.websocket.server.PathParam; 15 | import java.util.ArrayList; 16 | import java.util.List; 17 | 18 | @RestController 19 | @RequestMapping("/api/admin") 20 | @CrossOrigin 21 | public class AdminControl { 22 | @Autowired 23 | private AdminService adminService; 24 | 25 | @Autowired 26 | private AdminDeviceService adminDeviceService; 27 | 28 | @Autowired 29 | private DeviceService deviceService; 30 | 31 | /** 32 | * @Description: 登录功能 33 | * @Param: [admin] 34 | * @return: com.example.demo.result.Result 35 | * @Author: Zjh 36 | * @Date: 5/19/21 37 | */ 38 | @RequestMapping("/login") 39 | @ResponseBody 40 | public Result login(@RequestBody Admin admin) { 41 | Admin admin1 = adminService.Login(admin); 42 | if (null != admin1) { 43 | List devices; 44 | if (admin.getUsername().equals("admin")) { 45 | devices = deviceService.getAllDeviceId(); 46 | } else { 47 | devices = adminDeviceService.getDidByUsername(admin1.getUsername()); 48 | } 49 | 50 | return ResultUtil.buildSuccessResult("登录成功", devices); 51 | } else { 52 | return ResultUtil.buildFailResult("用户名或密码错误", null); 53 | } 54 | } 55 | 56 | @GetMapping("/getAllAdmin") 57 | public List getAllAdmins() { 58 | List list = new ArrayList<>(); 59 | List admins = adminService.getAllAdmin(); 60 | for (Admin admin : admins) { 61 | List devices = adminDeviceService.getDidByUsername(admin.getUsername()); 62 | AdminView userView = new AdminView(admin.getUsername(), admin.getPassword(), devices); 63 | list.add(userView); 64 | } 65 | return list; 66 | } 67 | 68 | @GetMapping("/findByKeyword") 69 | public List findByKeyWord(@PathParam("keyword") String keyword) { 70 | keyword = "%" + keyword + "%"; 71 | List list = new ArrayList<>(); 72 | List admins = adminService.findByKeyWord(keyword); 73 | for (Admin admin : admins) { 74 | List devices = adminDeviceService.getDidByUsername(admin.getUsername()); 75 | AdminView userView = new AdminView(admin.getUsername(), admin.getPassword(), devices); 76 | list.add(userView); 77 | } 78 | return list; 79 | } 80 | 81 | @RequestMapping("/addAdmin") 82 | @ResponseBody 83 | public Result addUser(@RequestBody AdminView adminView) { 84 | Admin admin = new Admin(adminView.getUsername(), "123456"); 85 | //判断用户名是否已存在 86 | Admin admin1 = adminService.findByUsername(admin); 87 | if (null == admin1) { 88 | //1.新增一个admin,成功则返回1 89 | int ret = adminService.insertAdmin(admin); 90 | if (ret == 1) { 91 | //2.新增权限 92 | for (int i : adminView.getDevices()) { 93 | AdminDevice adminDevice = new AdminDevice(0, adminView.getUsername(), i); 94 | int flag = adminDeviceService.insertAdminDevice(adminDevice); 95 | if (flag == 0) { 96 | return ResultUtil.buildFailResult("增加管理员权限失败", null); 97 | } 98 | } 99 | return ResultUtil.buildSuccessResult("新增管理员成功,默认密码为123456", null); 100 | } else { 101 | return ResultUtil.buildFailResult("增加管理员失败", null); 102 | } 103 | } else { 104 | return ResultUtil.buildFailResult("昵称已存在", null); 105 | } 106 | } 107 | 108 | @RequestMapping("/deleteAdmin") 109 | @ResponseBody 110 | public Result deleteUser(@RequestBody Admin admin) { 111 | int flag = adminDeviceService.deleteAllAdminDevice(admin.getUsername()); 112 | if (flag == 0) { 113 | return ResultUtil.buildFailResult("删除权限失败", null); 114 | } 115 | flag = adminService.deleteAdmin(admin); 116 | if (flag == 0) { 117 | return ResultUtil.buildFailResult("删除管理员失败", null); 118 | } 119 | return ResultUtil.buildSuccessResult("删除管理员成功!", null); 120 | } 121 | 122 | /** 123 | * @Description: 修改某个管理员的权限,括号内为新的权限 124 | * @Param: [username, devices] 125 | * @return: com.example.demo.result.Result 126 | * @Author: Zjh 127 | * @Date: 5/19/21 128 | */ 129 | @RequestMapping("/changeAuthority") 130 | @ResponseBody 131 | public Result changeAuthority(@RequestBody AdminView adminView) { 132 | String username = adminView.getUsername(); 133 | List devices = adminView.getDevices(); 134 | Admin admin = new Admin(username, ""); 135 | if (null != adminService.findByUsername(admin)) { 136 | if (devices == null) { 137 | // 清空 138 | adminDeviceService.deleteAllAdminDevice(username); 139 | } else { 140 | // 求差集,删除一些权限 141 | List old_devices = adminDeviceService.getDidByUsername(username); 142 | old_devices.removeAll(devices); 143 | for (int i : old_devices) { 144 | AdminDevice adminDevice = new AdminDevice(0, username, i); 145 | adminDeviceService.deleteOneAdminDevice(adminDevice); 146 | } 147 | //求差集,增加一些权限 148 | old_devices = adminDeviceService.getDidByUsername(username); 149 | devices.removeAll(old_devices); 150 | for (int i : devices) { 151 | AdminDevice adminDevice = new AdminDevice(0, username, i); 152 | adminDeviceService.insertAdminDevice(adminDevice); 153 | } 154 | } 155 | return ResultUtil.buildSuccessResult("修改权限成功", null); 156 | } else { 157 | return ResultUtil.buildFailResult("用户不存在", null); 158 | } 159 | } 160 | 161 | @RequestMapping("/changePassword") 162 | @ResponseBody 163 | public Result changePassword(@RequestParam String username,@RequestParam String oldPassword, @RequestParam String newPassword) { 164 | System.out.println(username); 165 | Admin admin = new Admin(username, oldPassword); 166 | if (null != adminService.Login(admin)){ 167 | admin.setPassword(newPassword); 168 | int ret = adminService.updatePassword(admin); 169 | if (ret == 1){ 170 | return ResultUtil.buildSuccessResult("修改密码成功!",null); 171 | } else { 172 | return ResultUtil.buildFailResult("修改密码失败!",null); 173 | } 174 | } 175 | return ResultUtil.buildFailResult("旧密码错误!",null); 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/controller/DeviceControl.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.controller; 2 | 3 | import com.example.demo.entity.Device; 4 | import com.example.demo.result.Result; 5 | import com.example.demo.service.AdminDeviceService; 6 | import com.example.demo.service.DeviceService; 7 | import com.example.demo.service.RecordsService; 8 | import com.example.demo.service.UserDeviceService; 9 | import com.example.demo.utils.ResultUtil; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | import javax.websocket.server.PathParam; 14 | import java.util.List; 15 | 16 | /** 17 | * @program: access_control 18 | * @description: 设备管理处理 19 | * @author: Zjh 20 | * @create: 2021-05-19 15:06 21 | **/ 22 | @RestController 23 | @RequestMapping("/api/device") 24 | @CrossOrigin 25 | public class DeviceControl { 26 | @Autowired 27 | private DeviceService deviceService; 28 | 29 | @Autowired 30 | private UserDeviceService userDeviceService; 31 | 32 | @Autowired 33 | private AdminDeviceService adminDeviceService; 34 | 35 | @Autowired 36 | private RecordsService recordsService; 37 | 38 | @GetMapping("/getAllDevices") 39 | public List getAllDevices() { 40 | return deviceService.getAllDevices(); 41 | } 42 | 43 | @GetMapping("/findByKeyword") 44 | public List findByKeyWord(@PathParam("keyword") String keyword) { 45 | keyword = "%" + keyword + "%"; 46 | return deviceService.findByKeyWord(keyword); 47 | } 48 | 49 | @RequestMapping("/changeLocation") 50 | @ResponseBody 51 | public Result changeLocation(@RequestBody Device device) { 52 | int flag = deviceService.changeLocation(device); 53 | if (flag == 1) { 54 | return ResultUtil.buildSuccessResult("修改位置信息成功", null); 55 | } else { 56 | return ResultUtil.buildFailResult("修改位置信息失败!", null); 57 | } 58 | } 59 | 60 | @RequestMapping("/addDevice") 61 | @ResponseBody 62 | public Result addDevice(@RequestBody Device device) { 63 | int flag = deviceService.addDevice(device); 64 | if (flag == 1) { 65 | return ResultUtil.buildSuccessResult("添加设备成功", null); 66 | } else { 67 | return ResultUtil.buildFailResult("设备名称已存在!", null); 68 | } 69 | } 70 | 71 | @RequestMapping("/deleteDevice") 72 | @ResponseBody 73 | public Result deleteDevice(@RequestBody Device device) { 74 | /*删除设备前需要确保admin_device、user_device以及records表中都没有该device的信息*/ 75 | int did = device.getId(); 76 | if (did == userDeviceService.isDeviceExist(did) || did == adminDeviceService.isDeviceExist(did) 77 | || did == recordsService.isDeviceExist(did)) { 78 | return ResultUtil.buildFailResult("删除设备失败!", null); 79 | } 80 | 81 | int flag = deviceService.deleteDevice(device); 82 | if (flag == 1) { 83 | return ResultUtil.buildSuccessResult("删除设备成功", null); 84 | } else { 85 | return ResultUtil.buildFailResult("删除设备失败!", null); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/controller/RecordsControl.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.controller; 2 | 3 | import com.example.demo.entity.Records; 4 | import com.example.demo.result.Result; 5 | import com.example.demo.service.RecordsService; 6 | import com.example.demo.utils.ResultUtil; 7 | import com.example.demo.view.RecordView; 8 | import com.example.demo.view.UserView; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | import javax.websocket.server.PathParam; 13 | import java.util.List; 14 | 15 | /** 16 | * @program: access_control 17 | * @description: records control 18 | * @author: Zjh 19 | * @create: 2021-05-20 16:51 20 | **/ 21 | @RestController 22 | @RequestMapping("/api/record") 23 | @CrossOrigin 24 | public class RecordsControl { 25 | 26 | @Autowired 27 | private RecordsService recordsService; 28 | 29 | @GetMapping("/getAllRecords") 30 | public List getAllRecords() { 31 | return recordsService.getAllRecords(); 32 | } 33 | 34 | @GetMapping("/findByKeyword") 35 | public List findByKeyWord(@PathParam("keyword") String keyword) { 36 | keyword = "%" + keyword + "%"; 37 | return recordsService.getRecordsByKeyword(keyword); 38 | } 39 | 40 | @RequestMapping("/getRecords") 41 | @ResponseBody 42 | public List getRecordsByDevices(@RequestBody UserView userView) { 43 | return recordsService.getRecordsByDevices(userView.getDevices()); 44 | } 45 | 46 | @RequestMapping("/findByKeyWordAndDevices") 47 | @ResponseBody 48 | public List getRecordsByDevicesAndKeyword(@RequestBody UserView userView, @PathParam("keyword") String keyword) { 49 | keyword = "%" + keyword + "%"; 50 | return recordsService.getRecordsByDevicesAndKeyword(userView.getDevices(), keyword); 51 | } 52 | 53 | @RequestMapping("/deleteRecord") 54 | @ResponseBody 55 | public Result deleteUser(@RequestBody Records records) { 56 | if (recordsService.deleteRecord(records.getId()) == 0) { 57 | return ResultUtil.buildFailResult("删除记录失败!", null); 58 | } 59 | return ResultUtil.buildSuccessResult("删除记录成功!", null); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/controller/UserControl.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.controller; 2 | 3 | import com.example.demo.entity.Device; 4 | import com.example.demo.entity.User; 5 | import com.example.demo.entity.UserDevice; 6 | import com.example.demo.result.Result; 7 | import com.example.demo.service.UserDeviceService; 8 | import com.example.demo.service.UserService; 9 | import com.example.demo.utils.ResultUtil; 10 | import com.example.demo.view.UserView; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.web.bind.annotation.*; 13 | 14 | import javax.websocket.server.PathParam; 15 | import java.io.File; 16 | import java.util.ArrayList; 17 | import java.util.List; 18 | 19 | /** 20 | * @program: access_control 21 | * @description: User Manager 22 | * @author: Zjh 23 | * @create: 2021-05-20 00:54 24 | **/ 25 | @RestController 26 | @RequestMapping("/api/user") 27 | @CrossOrigin 28 | public class UserControl { 29 | @Autowired 30 | private UserService userService; 31 | 32 | @Autowired 33 | private UserDeviceService userDeviceService; 34 | 35 | @GetMapping("/getAllUser") 36 | public List getAllUsers() { 37 | List list = new ArrayList<>(); 38 | List users = userService.getAllUser(); 39 | for (User user : users) { 40 | List devices = userDeviceService.findDidByUid(user.getId()); 41 | UserView userView = new UserView(user.getId(), user.getName(), user.getImage(), devices); 42 | list.add(userView); 43 | } 44 | return list; 45 | } 46 | 47 | @GetMapping("/findByKeyword") 48 | public List findByKeyWord(@PathParam("keyword") String keyword) { 49 | keyword = "%" + keyword + "%"; 50 | List list = new ArrayList<>(); 51 | List users = userService.findByKeyWord(keyword); 52 | for (User user : users) { 53 | List devices = userDeviceService.findDidByUid(user.getId()); 54 | UserView userView = new UserView(user.getId(), user.getName(), user.getImage(), devices); 55 | list.add(userView); 56 | } 57 | return list; 58 | } 59 | 60 | @RequestMapping("/addUser") 61 | @ResponseBody 62 | public Result addUser(@RequestBody UserView userView) { 63 | String name = userView.getName(); 64 | int flag = userService.insertUser(name); 65 | if (flag == 0) { 66 | return ResultUtil.buildFailResult("添加用户失败!", null); 67 | } 68 | int uid = userService.getLastIDByName(name); 69 | List devices = userView.getDevices(); 70 | for (int did : devices) { 71 | UserDevice userDevice = new UserDevice(0, uid, did); 72 | flag = userDeviceService.insertUserDevice(userDevice); 73 | if (flag == 0) { 74 | return ResultUtil.buildFailResult("添加用户权限" + did + "失败!", null); 75 | } 76 | } 77 | return ResultUtil.buildSuccessResult("添加用户以及其权限成功!", null); 78 | } 79 | 80 | @RequestMapping("/changeAuthority") 81 | @ResponseBody 82 | public Result changeAuthority(@RequestBody UserView userView) { 83 | int uid = userView.getId(); 84 | List devices = userView.getDevices(); 85 | if (devices.isEmpty()) { 86 | userDeviceService.deleteAllUserDevice(uid); 87 | return ResultUtil.buildSuccessResult("修改权限成功!", null); 88 | } else { 89 | // 求差集,删除一些数据 90 | List old_devices = userDeviceService.findDidByUid(uid); 91 | old_devices.removeAll(devices); 92 | for (int did : old_devices) { 93 | UserDevice userDevice = new UserDevice(0, uid, did); 94 | userDeviceService.deleteOneUserDevice(userDevice); 95 | } 96 | // 求差集,增加权限 97 | old_devices = userDeviceService.findDidByUid(uid); 98 | devices.removeAll(old_devices); 99 | for (int did : devices) { 100 | UserDevice userDevice = new UserDevice(0, uid, did); 101 | userDeviceService.insertUserDevice(userDevice); 102 | } 103 | return ResultUtil.buildSuccessResult("修改权限成功!", null); 104 | } 105 | } 106 | 107 | 108 | @RequestMapping("/deleteUser") 109 | @ResponseBody 110 | public Result deleteUser(@RequestBody User user) { 111 | int flag = userDeviceService.deleteAllUserDevice(user.getId()); 112 | if (flag == 0) { 113 | return ResultUtil.buildFailResult("删除权限失败", null); 114 | } 115 | user.setFlag(1); 116 | flag = userService.updateFlag(user); 117 | if (flag == 0) { 118 | return ResultUtil.buildFailResult("注销用户失败", null); 119 | } 120 | 121 | return ResultUtil.buildSuccessResult("注销成功!", null); 122 | } 123 | 124 | @GetMapping("/deleteFace") 125 | public Result deleteFace(@PathParam("id") int id){ 126 | int flag = userService.deleteFace(id); 127 | if (flag == 0){ 128 | return ResultUtil.buildFailResult("删除人脸失败,数据库删除失败",null); 129 | } 130 | // 删除本地文件内容 131 | String fileUrl = "/home/ketty/AscendProjects/access_control_system/presenterserver/facial_recognition/ui/static/face_images"; 132 | fileUrl += id + ".jpg"; 133 | File file = new File(fileUrl); 134 | if (file.delete()){ 135 | System.out.println("删除文件"+fileUrl+"成功!"); 136 | } else { 137 | System.out.println("删除文件"+fileUrl+"失败!"); 138 | } 139 | return ResultUtil.buildSuccessResult("删除人脸成功",null); 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/entity/Admin.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @NoArgsConstructor 9 | @AllArgsConstructor 10 | public class Admin { 11 | private String username; 12 | private String password; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/entity/AdminDevice.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @NoArgsConstructor 9 | @AllArgsConstructor 10 | public class AdminDevice { 11 | private int id; 12 | private String username; 13 | private int did; 14 | } 15 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/entity/Device.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @NoArgsConstructor 9 | @AllArgsConstructor 10 | public class Device { 11 | private int id; 12 | private String name; 13 | private String location; 14 | private String state; 15 | } 16 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/entity/Records.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @NoArgsConstructor 9 | @AllArgsConstructor 10 | public class Records { 11 | private int id; 12 | private int uid; 13 | private int did; 14 | private float temp; 15 | private String time; 16 | } 17 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @NoArgsConstructor 9 | @AllArgsConstructor 10 | public class User { 11 | private int id; 12 | private String name; 13 | private String image; 14 | private int flag; 15 | } 16 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/entity/UserDevice.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @NoArgsConstructor 9 | @AllArgsConstructor 10 | public class UserDevice { 11 | private int id; 12 | private int uid; 13 | private int did; 14 | } 15 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/mapper/AdminDeviceMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.mapper; 2 | 3 | import com.example.demo.entity.AdminDevice; 4 | import org.apache.ibatis.annotations.Delete; 5 | import org.apache.ibatis.annotations.Insert; 6 | import org.apache.ibatis.annotations.Select; 7 | import org.springframework.stereotype.Repository; 8 | 9 | import java.util.List; 10 | 11 | @Repository 12 | public interface AdminDeviceMapper { 13 | @Select("select distinct did from admin_device where did=#{did};") 14 | int isDeviceExist(int did); 15 | 16 | @Select("select did from admin_device where username=#{username};") 17 | List getDidByUsername(String username); 18 | 19 | @Insert("insert into admin_device(username,did) values(#{username},#{did});") 20 | int insertAdminDevice(AdminDevice adminDevice); 21 | 22 | @Delete("delete from admin_device where username=#{username} and did=#{did};") 23 | int deleteOneAdminDevice(AdminDevice adminDevice); 24 | 25 | @Delete("delete from admin_device where username=#{username};") 26 | int deleteAllAdminDevice(String username); 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/mapper/AdminMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.mapper; 2 | 3 | import com.example.demo.entity.Admin; 4 | import org.apache.ibatis.annotations.Delete; 5 | import org.apache.ibatis.annotations.Insert; 6 | import org.apache.ibatis.annotations.Select; 7 | import org.apache.ibatis.annotations.Update; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import java.util.List; 11 | 12 | @Repository 13 | public interface AdminMapper { 14 | @Select("select * from admin where username=#{username} and password=#{password};") 15 | Admin login(Admin admin); 16 | 17 | @Select("select username from admin where username<>'admin';") 18 | List getAllAdmin(); 19 | 20 | @Select("select username from admin where (username like #{keyword}) and username<>'admin';") 21 | List findByKeyWord(String keyword); 22 | 23 | @Insert("insert into admin(username,password) values(#{username},#{password});") 24 | int insertAdmin(Admin admin); 25 | 26 | @Update("update admin set password=#{password} where username=#{username};") 27 | int updatePassword(Admin admin); 28 | 29 | @Delete("delete from admin where username=#{username};") 30 | int deleteAdmin(Admin admin); 31 | 32 | @Select("select * from admin where username=#{username};") 33 | Admin findByUsername(Admin admin); 34 | } 35 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/mapper/DeviceMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.mapper; 2 | 3 | import com.example.demo.entity.Device; 4 | import org.apache.ibatis.annotations.Delete; 5 | import org.apache.ibatis.annotations.Insert; 6 | import org.apache.ibatis.annotations.Select; 7 | import org.apache.ibatis.annotations.Update; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import java.util.List; 11 | 12 | @Repository 13 | public interface DeviceMapper { 14 | /*获取所有设备信息*/ 15 | @Select("select * from device;") 16 | List getAllDevices(); 17 | 18 | /* 更新设备的地址信息 */ 19 | @Update("update device set location=#{location} where id=#{id};") 20 | int updateLocation(Device device); 21 | 22 | /* 根据设备名称查找设备*/ 23 | @Select("select * from device where name=#{name}") 24 | Device findByName(String name); 25 | 26 | /* 添加设备 */ 27 | @Insert("insert into device(id,name,location,state) " + 28 | "values(#{id},#{name},#{location},#{state});") 29 | int insertDevice(Device device); 30 | 31 | /* 删除设备 */ 32 | @Delete("delete from device where id=#{id};") 33 | int deleteDevice(Device device); 34 | 35 | /* 模糊搜索 */ 36 | @Select("select * from device where id like #{keyword} or name like #{keyword} or location like #{keyword} or state like #{keyword};") 37 | List findByKeyWord(String keyword); 38 | 39 | /* 获取所有的设备id */ 40 | @Select("select id from device;") 41 | List getAllDeviceId(); 42 | } 43 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/mapper/RecordsMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.mapper; 2 | 3 | import com.example.demo.entity.Records; 4 | import com.example.demo.view.RecordView; 5 | import org.apache.ibatis.annotations.Delete; 6 | import org.apache.ibatis.annotations.Param; 7 | import org.apache.ibatis.annotations.Select; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import java.util.List; 11 | 12 | @Repository 13 | public interface RecordsMapper { 14 | @Select("select distinct did from records where did=#{did};") 15 | int isDeviceExist(int did); 16 | 17 | @Select("select A.id,A.uid,B.name as userName,A.did,C.name as deviceName,A.temp,A.time from " + 18 | "(records A join user B on A.uid=B.id) " + 19 | "join device C on A.did=C.id") 20 | List getAllRecords(); 21 | 22 | @Select({ 23 | "" 32 | }) 33 | List getRecordsByDevices(@Param("ids") List ids); 34 | 35 | @Select({ 36 | "" 47 | }) 48 | List getRecordsByDevicesAndKeyword(@Param("ids") List ids, String keyword); 49 | 50 | @Select("select A.id,A.uid,B.name as userName,A.did,C.name as deviceName,A.temp,A.time from " + 51 | "(records A join user B on A.uid=B.id) " + 52 | "join device C on A.did=C.id " + 53 | "where A.id like #{keyword} or A.uid like #{keyword} or B.name like #{keyword} or " + 54 | "A.did like #{keyword} or C.name like #{keyword} or A.temp like #{keyword} or A.time like #{keyword};") 55 | List getRecordsByKeyword(String keyword); 56 | 57 | @Delete("delete from records where id=#{id}") 58 | int deleteRecord(int id); 59 | 60 | @Select("select * from records where did in #{did};") 61 | List getRecords(List did); 62 | } 63 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/mapper/UserDeviceMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.mapper; 2 | 3 | import com.example.demo.entity.UserDevice; 4 | import org.apache.ibatis.annotations.Delete; 5 | import org.apache.ibatis.annotations.Insert; 6 | import org.apache.ibatis.annotations.Select; 7 | import org.springframework.stereotype.Repository; 8 | 9 | import java.util.List; 10 | 11 | @Repository 12 | public interface UserDeviceMapper { 13 | @Select("select distinct did from user_device where did=#{did};") 14 | int isDeviceExist(int did); 15 | 16 | @Select("select distinct did from user_device where uid=#{uid};") 17 | List findDidByUid(int uid); 18 | 19 | @Insert("insert into user_device(uid,did) values(#{uid},#{did});") 20 | int insertUserDevice(UserDevice userDevice); 21 | 22 | @Delete("delete from user_device where uid=#{uid} and did=#{did};") 23 | int deleteOneUserDevice(UserDevice userDevice); 24 | 25 | @Delete("delete from user_device where uid=#{uid};") 26 | int deleteAllUserDevice(int uid); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.mapper; 2 | 3 | import com.example.demo.entity.User; 4 | import org.apache.ibatis.annotations.Insert; 5 | import org.apache.ibatis.annotations.Select; 6 | import org.apache.ibatis.annotations.Update; 7 | import org.springframework.stereotype.Repository; 8 | 9 | import java.util.List; 10 | 11 | @Repository 12 | public interface UserMapper { 13 | @Select("select id,name,image from user where flag=0;") 14 | List getAllUser(); 15 | 16 | @Select("select * from user where (id like #{keyword} or name like #{keyword} or image like #{keyword}) and flag=0;") 17 | List findByKeyWord(String keyword); 18 | 19 | @Insert("insert into user(name,flag) values(#{name},0);") 20 | int insertUser(String name); 21 | 22 | @Update("update user set flag=#{flag} where id=#{id};") 23 | int updateFlag(User user); 24 | 25 | @Select("select id from user where id = (select max(id) from user where name=#{name})") 26 | int getLastIDByName(String name); 27 | 28 | @Update("update user set facefeature=null,image=null where id=#{id};") 29 | int deleteFace(int id); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/result/Result.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.result; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class Result { 9 | private int code; 10 | private String message; 11 | private Object data; 12 | } 13 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/result/ResultCode.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.result; 2 | 3 | public enum ResultCode { 4 | /** 5 | * 成功 6 | */ 7 | SUCCESS(200), 8 | /** 9 | * 失败 10 | */ 11 | FAIL(400), 12 | /** 13 | * 没有身份认证 14 | */ 15 | UNAUTHORIZED(401), 16 | /** 17 | * 请求资源不存在 18 | */ 19 | NOT_FOUND(404), 20 | /** 21 | * 内部服务器错误 22 | */ 23 | INTERNAL_SERVER_ERROR(500); 24 | 25 | private int code; 26 | 27 | ResultCode(int code){ 28 | this.code = code; 29 | } 30 | 31 | public int getCode() { 32 | return code; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/service/AdminDeviceService.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.service; 2 | 3 | 4 | import com.example.demo.entity.AdminDevice; 5 | import com.example.demo.mapper.AdminDeviceMapper; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class AdminDeviceService { 13 | @Autowired 14 | private AdminDeviceMapper adminDeviceMapper; 15 | 16 | public int isDeviceExist(int did) { 17 | return adminDeviceMapper.isDeviceExist(did); 18 | } 19 | 20 | public List getDidByUsername(String username) { 21 | return adminDeviceMapper.getDidByUsername(username); 22 | } 23 | 24 | public int insertAdminDevice(AdminDevice adminDevice) { 25 | return adminDeviceMapper.insertAdminDevice(adminDevice); 26 | } 27 | 28 | public int deleteOneAdminDevice(AdminDevice adminDevice) { 29 | return adminDeviceMapper.deleteOneAdminDevice(adminDevice); 30 | } 31 | 32 | public int deleteAllAdminDevice(String username) { 33 | return adminDeviceMapper.deleteAllAdminDevice(username); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/service/AdminService.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.service; 2 | 3 | import com.example.demo.entity.Admin; 4 | import com.example.demo.mapper.AdminMapper; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import java.util.List; 9 | 10 | @Service 11 | public class AdminService { 12 | @Autowired 13 | private AdminMapper adminMapper; 14 | 15 | public Admin Login(Admin admin) { 16 | return adminMapper.login(admin); 17 | } 18 | 19 | public List getAllAdmin() { 20 | return adminMapper.getAllAdmin(); 21 | } 22 | 23 | public List findByKeyWord(String keyword) { 24 | return adminMapper.findByKeyWord(keyword); 25 | } 26 | 27 | public int insertAdmin(Admin admin) { 28 | return adminMapper.insertAdmin(admin); 29 | } 30 | 31 | public int updatePassword(Admin admin) { 32 | return adminMapper.updatePassword(admin); 33 | } 34 | 35 | public int deleteAdmin(Admin admin) { 36 | return adminMapper.deleteAdmin(admin); 37 | } 38 | 39 | public Admin findByUsername(Admin admin) { 40 | return adminMapper.findByUsername(admin); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/service/DeviceService.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.service; 2 | 3 | 4 | import com.example.demo.entity.Device; 5 | import com.example.demo.mapper.DeviceMapper; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | @Service 12 | public class DeviceService { 13 | @Autowired 14 | private DeviceMapper deviceMapper; 15 | 16 | public List getAllDevices() { 17 | return deviceMapper.getAllDevices(); 18 | } 19 | 20 | public int changeLocation(Device device) { 21 | return deviceMapper.updateLocation(device); 22 | } 23 | 24 | public int addDevice(Device device) { 25 | if (null != deviceMapper.findByName(device.getName())) 26 | return 0; 27 | return deviceMapper.insertDevice(device); 28 | } 29 | 30 | public int deleteDevice(Device device) { 31 | return deviceMapper.deleteDevice(device); 32 | } 33 | 34 | public List findByKeyWord(String keyword) { 35 | return deviceMapper.findByKeyWord(keyword); 36 | } 37 | 38 | public List getAllDeviceId() { 39 | return deviceMapper.getAllDeviceId(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/service/RecordsService.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.service; 2 | 3 | import com.example.demo.entity.Records; 4 | import com.example.demo.mapper.RecordsMapper; 5 | import com.example.demo.view.RecordView; 6 | import org.apache.ibatis.annotations.Param; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * @program: access_control 14 | * @description: records 15 | * @author: Zjh 16 | * @create: 2021-05-19 21:01 17 | **/ 18 | @Service 19 | public class RecordsService { 20 | @Autowired 21 | private RecordsMapper recordsMapper; 22 | 23 | public int isDeviceExist(int did) { 24 | return recordsMapper.isDeviceExist(did); 25 | } 26 | 27 | public List getAllRecords() { 28 | return recordsMapper.getAllRecords(); 29 | } 30 | 31 | public List getRecordsByKeyword(String keyword) { 32 | return recordsMapper.getRecordsByKeyword(keyword); 33 | } 34 | 35 | public List getRecordsByDevices(List devices) { 36 | return recordsMapper.getRecordsByDevices(devices); 37 | } 38 | 39 | public List getRecordsByDevicesAndKeyword(List devices, String keyword) { 40 | return recordsMapper.getRecordsByDevicesAndKeyword(devices, keyword); 41 | } 42 | 43 | public int deleteRecord(int id) { 44 | return recordsMapper.deleteRecord(id); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/service/UserDeviceService.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.service; 2 | 3 | import com.example.demo.entity.UserDevice; 4 | import com.example.demo.mapper.UserDeviceMapper; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * @program: access_control 12 | * @description: user can pass's device 13 | * @author: Zjh 14 | * @create: 2021-05-19 21:00 15 | **/ 16 | @Service 17 | public class UserDeviceService { 18 | @Autowired 19 | private UserDeviceMapper userDeviceMapper; 20 | 21 | public int isDeviceExist(int did) { 22 | return userDeviceMapper.isDeviceExist(did); 23 | } 24 | 25 | public List findDidByUid(int uid) { 26 | return userDeviceMapper.findDidByUid(uid); 27 | } 28 | 29 | public int insertUserDevice(UserDevice userDevice) { 30 | return userDeviceMapper.insertUserDevice(userDevice); 31 | } 32 | 33 | public int deleteOneUserDevice(UserDevice userDevice) { 34 | return userDeviceMapper.deleteOneUserDevice(userDevice); 35 | } 36 | 37 | public int deleteAllUserDevice(int uid) { 38 | return userDeviceMapper.deleteAllUserDevice(uid); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.service; 2 | 3 | import com.example.demo.entity.User; 4 | import com.example.demo.mapper.UserMapper; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * @program: access_control 12 | * @description: User Service 13 | * @author: Zjh 14 | * @create: 2021-05-20 00:44 15 | **/ 16 | @Service 17 | public class UserService { 18 | @Autowired 19 | private UserMapper userMapper; 20 | 21 | public List getAllUser() { 22 | return userMapper.getAllUser(); 23 | } 24 | 25 | public List findByKeyWord(String keyword) { 26 | return userMapper.findByKeyWord(keyword); 27 | } 28 | 29 | public int insertUser(String name) { 30 | return userMapper.insertUser(name); 31 | } 32 | 33 | public int updateFlag(User user) { 34 | return userMapper.updateFlag(user); 35 | } 36 | 37 | public int getLastIDByName(String name) { 38 | return userMapper.getLastIDByName(name); 39 | } 40 | 41 | public int deleteFace(int id){ 42 | return userMapper.deleteFace(id); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/utils/ResultUtil.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.utils; 2 | 3 | import com.example.demo.result.Result; 4 | import com.example.demo.result.ResultCode; 5 | 6 | public class ResultUtil { 7 | public static Result buildResult(int resultCode, String message, Object data) { 8 | return new Result(resultCode, message, data); 9 | } 10 | 11 | public static Result buildResult(ResultCode resultCode, String message, Object data) { 12 | return buildResult(resultCode.getCode(), message, data); 13 | } 14 | 15 | public static Result buildSuccessResult(String message, Object data) { 16 | return buildResult(ResultCode.SUCCESS, message, data); 17 | } 18 | 19 | public static Result buildFailResult(String message, Object data) { 20 | return buildResult(ResultCode.FAIL, message, data); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/view/AdminView.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.view; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @program: access_control 11 | * @description: admin view 12 | * @author: Zjh 13 | * @create: 2021-05-20 03:26 14 | **/ 15 | @Data 16 | @AllArgsConstructor 17 | @NoArgsConstructor 18 | public class AdminView { 19 | private String username; 20 | private String password; 21 | private List devices; 22 | } 23 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/view/RecordView.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.view; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | /** 8 | * @program: access_control 9 | * @description: records 10 | * @author: Zjh 11 | * @create: 2021-05-20 16:49 12 | **/ 13 | @Data 14 | @NoArgsConstructor 15 | @AllArgsConstructor 16 | public class RecordView { 17 | private int id; 18 | private int uid; 19 | private String userName; 20 | private int did; 21 | private String deviceName; 22 | private float temp; 23 | private String time; 24 | } 25 | -------------------------------------------------------------------------------- /access-control-spring/src/main/java/com/example/demo/view/UserView.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.view; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @program: access_control 11 | * @description: view 12 | * @author: Zjh 13 | * @create: 2021-05-20 00:57 14 | **/ 15 | 16 | @Data 17 | @AllArgsConstructor 18 | @NoArgsConstructor 19 | public class UserView { 20 | private int id; 21 | private String name; 22 | private String image; 23 | private List devices; 24 | } 25 | -------------------------------------------------------------------------------- /access-control-spring/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8086 3 | spring: 4 | datasource: 5 | url: jdbc:mysql://127.0.0.1:3306/AcsCtl?serverTimezone=GMT%2B8&characterEncoding=utf-8&useSSL=false 6 | username: root 7 | password: zjh1314520 8 | driver-class-name: com.mysql.cj.jdbc.Driver 9 | thymeleaf: 10 | cache: false 11 | mvc: 12 | static-path-pattern: /resources/** 13 | mybatis: 14 | configuration: 15 | map-underscore-to-camel-case: true 16 | -------------------------------------------------------------------------------- /access-control-spring/src/main/resources/static/image/pexels-snapwire-670061.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangjunhui6/access-control-system/1377d5399f40a8d97479ddc0e60c3c08dca17585/access-control-spring/src/main/resources/static/image/pexels-snapwire-670061.jpg -------------------------------------------------------------------------------- /access-control-spring/src/test/java/com/example/demo/DemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | 7 | @SpringBootTest 8 | 9 | class DemoApplicationTests { 10 | 11 | @Test 12 | void contextLoads() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /acess-control-vue/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false, 5 | "targets": { 6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 7 | } 8 | }], 9 | "stage-2" 10 | ], 11 | "plugins": ["transform-vue-jsx", "transform-runtime"] 12 | } 13 | -------------------------------------------------------------------------------- /acess-control-vue/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /acess-control-vue/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | /dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Editor directories and files 9 | .idea 10 | .vscode 11 | *.suo 12 | *.ntvs* 13 | *.njsproj 14 | *.sln 15 | -------------------------------------------------------------------------------- /acess-control-vue/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | "postcss-import": {}, 6 | "postcss-url": {}, 7 | // to edit target browsers: use "browserslist" field in package.json 8 | "autoprefixer": {} 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /acess-control-vue/README.md: -------------------------------------------------------------------------------- 1 | # vue-demo 2 | 3 | > A Vue.js project 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | npm install 10 | 11 | # serve with hot reload at localhost:8080 12 | npm run dev 13 | 14 | # build for production with minification 15 | npm run build 16 | 17 | # build for production and view the bundle analyzer report 18 | npm run build --report 19 | ``` 20 | 21 | For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). 22 | -------------------------------------------------------------------------------- /acess-control-vue/build/build.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | require('./check-versions')() 3 | 4 | process.env.NODE_ENV = 'production' 5 | 6 | const ora = require('ora') 7 | const rm = require('rimraf') 8 | const path = require('path') 9 | const chalk = require('chalk') 10 | const webpack = require('webpack') 11 | const config = require('../config') 12 | const webpackConfig = require('./webpack.prod.conf') 13 | 14 | const spinner = ora('building for production...') 15 | spinner.start() 16 | 17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 18 | if (err) throw err 19 | webpack(webpackConfig, (err, stats) => { 20 | spinner.stop() 21 | if (err) throw err 22 | process.stdout.write(stats.toString({ 23 | colors: true, 24 | modules: false, 25 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. 26 | chunks: false, 27 | chunkModules: false 28 | }) + '\n\n') 29 | 30 | if (stats.hasErrors()) { 31 | console.log(chalk.red(' Build failed with errors.\n')) 32 | process.exit(1) 33 | } 34 | 35 | console.log(chalk.cyan(' Build complete.\n')) 36 | console.log(chalk.yellow( 37 | ' Tip: built files are meant to be served over an HTTP server.\n' + 38 | ' Opening index.html over file:// won\'t work.\n' 39 | )) 40 | }) 41 | }) 42 | -------------------------------------------------------------------------------- /acess-control-vue/build/check-versions.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const chalk = require('chalk') 3 | const semver = require('semver') 4 | const packageConfig = require('../package.json') 5 | const shell = require('shelljs') 6 | 7 | function exec (cmd) { 8 | return require('child_process').execSync(cmd).toString().trim() 9 | } 10 | 11 | const versionRequirements = [ 12 | { 13 | name: 'node', 14 | currentVersion: semver.clean(process.version), 15 | versionRequirement: packageConfig.engines.node 16 | } 17 | ] 18 | 19 | if (shell.which('npm')) { 20 | versionRequirements.push({ 21 | name: 'npm', 22 | currentVersion: exec('npm --version'), 23 | versionRequirement: packageConfig.engines.npm 24 | }) 25 | } 26 | 27 | module.exports = function () { 28 | const warnings = [] 29 | 30 | for (let i = 0; i < versionRequirements.length; i++) { 31 | const mod = versionRequirements[i] 32 | 33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 34 | warnings.push(mod.name + ': ' + 35 | chalk.red(mod.currentVersion) + ' should be ' + 36 | chalk.green(mod.versionRequirement) 37 | ) 38 | } 39 | } 40 | 41 | if (warnings.length) { 42 | console.log('') 43 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 44 | console.log() 45 | 46 | for (let i = 0; i < warnings.length; i++) { 47 | const warning = warnings[i] 48 | console.log(' ' + warning) 49 | } 50 | 51 | console.log() 52 | process.exit(1) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /acess-control-vue/build/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangjunhui6/access-control-system/1377d5399f40a8d97479ddc0e60c3c08dca17585/acess-control-vue/build/logo.png -------------------------------------------------------------------------------- /acess-control-vue/build/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const config = require('../config') 4 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 5 | const packageConfig = require('../package.json') 6 | 7 | exports.assetsPath = function (_path) { 8 | const assetsSubDirectory = process.env.NODE_ENV === 'production' 9 | ? config.build.assetsSubDirectory 10 | : config.dev.assetsSubDirectory 11 | 12 | return path.posix.join(assetsSubDirectory, _path) 13 | } 14 | 15 | exports.cssLoaders = function (options) { 16 | options = options || {} 17 | 18 | const cssLoader = { 19 | loader: 'css-loader', 20 | options: { 21 | sourceMap: options.sourceMap 22 | } 23 | } 24 | 25 | const postcssLoader = { 26 | loader: 'postcss-loader', 27 | options: { 28 | sourceMap: options.sourceMap 29 | } 30 | } 31 | 32 | // generate loader string to be used with extract text plugin 33 | function generateLoaders (loader, loaderOptions) { 34 | const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] 35 | 36 | if (loader) { 37 | loaders.push({ 38 | loader: loader + '-loader', 39 | options: Object.assign({}, loaderOptions, { 40 | sourceMap: options.sourceMap 41 | }) 42 | }) 43 | } 44 | 45 | // Extract CSS when that option is specified 46 | // (which is the case during production build) 47 | if (options.extract) { 48 | return ExtractTextPlugin.extract({ 49 | use: loaders, 50 | fallback: 'vue-style-loader' 51 | }) 52 | } else { 53 | return ['vue-style-loader'].concat(loaders) 54 | } 55 | } 56 | 57 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html 58 | return { 59 | css: generateLoaders(), 60 | postcss: generateLoaders(), 61 | less: generateLoaders('less'), 62 | sass: generateLoaders('sass', { indentedSyntax: true }), 63 | scss: generateLoaders('sass'), 64 | stylus: generateLoaders('stylus'), 65 | styl: generateLoaders('stylus') 66 | } 67 | } 68 | 69 | // Generate loaders for standalone style files (outside of .vue) 70 | exports.styleLoaders = function (options) { 71 | const output = [] 72 | const loaders = exports.cssLoaders(options) 73 | 74 | for (const extension in loaders) { 75 | const loader = loaders[extension] 76 | output.push({ 77 | test: new RegExp('\\.' + extension + '$'), 78 | use: loader 79 | }) 80 | } 81 | 82 | return output 83 | } 84 | 85 | exports.createNotifierCallback = () => { 86 | const notifier = require('node-notifier') 87 | 88 | return (severity, errors) => { 89 | if (severity !== 'error') return 90 | 91 | const error = errors[0] 92 | const filename = error.file && error.file.split('!').pop() 93 | 94 | notifier.notify({ 95 | title: packageConfig.name, 96 | message: severity + ': ' + error.name, 97 | subtitle: filename || '', 98 | icon: path.join(__dirname, 'logo.png') 99 | }) 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /acess-control-vue/build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const config = require('../config') 4 | const isProduction = process.env.NODE_ENV === 'production' 5 | const sourceMapEnabled = isProduction 6 | ? config.build.productionSourceMap 7 | : config.dev.cssSourceMap 8 | 9 | module.exports = { 10 | loaders: utils.cssLoaders({ 11 | sourceMap: sourceMapEnabled, 12 | extract: isProduction 13 | }), 14 | cssSourceMap: sourceMapEnabled, 15 | cacheBusting: config.dev.cacheBusting, 16 | transformToRequire: { 17 | video: ['src', 'poster'], 18 | source: 'src', 19 | img: 'src', 20 | image: 'xlink:href' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /acess-control-vue/build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const config = require('../config') 5 | const vueLoaderConfig = require('./vue-loader.conf') 6 | 7 | function resolve (dir) { 8 | return path.join(__dirname, '..', dir) 9 | } 10 | 11 | 12 | 13 | module.exports = { 14 | context: path.resolve(__dirname, '../'), 15 | entry: { 16 | app: './src/main.js' 17 | }, 18 | output: { 19 | path: config.build.assetsRoot, 20 | filename: '[name].js', 21 | publicPath: process.env.NODE_ENV === 'production' 22 | ? config.build.assetsPublicPath 23 | : config.dev.assetsPublicPath 24 | }, 25 | resolve: { 26 | extensions: ['.js', '.vue', '.json'], 27 | alias: { 28 | 'vue$': 'vue/dist/vue.esm.js', 29 | '@': resolve('src'), 30 | } 31 | }, 32 | module: { 33 | rules: [ 34 | { 35 | test: /\.vue$/, 36 | loader: 'vue-loader', 37 | options: vueLoaderConfig 38 | }, 39 | { 40 | test: /\.js$/, 41 | loader: 'babel-loader', 42 | include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] 43 | }, 44 | { 45 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 46 | loader: 'url-loader', 47 | options: { 48 | limit: 10000, 49 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 50 | } 51 | }, 52 | { 53 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, 54 | loader: 'url-loader', 55 | options: { 56 | limit: 10000, 57 | name: utils.assetsPath('media/[name].[hash:7].[ext]') 58 | } 59 | }, 60 | { 61 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 62 | loader: 'url-loader', 63 | options: { 64 | limit: 10000, 65 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 66 | } 67 | } 68 | ] 69 | }, 70 | node: { 71 | // prevent webpack from injecting useless setImmediate polyfill because Vue 72 | // source contains it (although only uses it if it's native). 73 | setImmediate: false, 74 | // prevent webpack from injecting mocks to Node native modules 75 | // that does not make sense for the client 76 | dgram: 'empty', 77 | fs: 'empty', 78 | net: 'empty', 79 | tls: 'empty', 80 | child_process: 'empty' 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /acess-control-vue/build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const webpack = require('webpack') 4 | const config = require('../config') 5 | const merge = require('webpack-merge') 6 | const path = require('path') 7 | const baseWebpackConfig = require('./webpack.base.conf') 8 | const CopyWebpackPlugin = require('copy-webpack-plugin') 9 | const HtmlWebpackPlugin = require('html-webpack-plugin') 10 | const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') 11 | const portfinder = require('portfinder') 12 | 13 | const HOST = process.env.HOST 14 | const PORT = process.env.PORT && Number(process.env.PORT) 15 | 16 | const devWebpackConfig = merge(baseWebpackConfig, { 17 | module: { 18 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) 19 | }, 20 | // cheap-module-eval-source-map is faster for development 21 | devtool: config.dev.devtool, 22 | 23 | // these devServer options should be customized in /config/index.js 24 | devServer: { 25 | clientLogLevel: 'warning', 26 | historyApiFallback: { 27 | rewrites: [ 28 | { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, 29 | ], 30 | }, 31 | hot: true, 32 | contentBase: false, // since we use CopyWebpackPlugin. 33 | compress: true, 34 | host: HOST || config.dev.host, 35 | port: PORT || config.dev.port, 36 | open: config.dev.autoOpenBrowser, 37 | overlay: config.dev.errorOverlay 38 | ? { warnings: false, errors: true } 39 | : false, 40 | publicPath: config.dev.assetsPublicPath, 41 | proxy: config.dev.proxyTable, 42 | quiet: true, // necessary for FriendlyErrorsPlugin 43 | watchOptions: { 44 | poll: config.dev.poll, 45 | } 46 | }, 47 | plugins: [ 48 | new webpack.DefinePlugin({ 49 | 'process.env': require('../config/dev.env') 50 | }), 51 | new webpack.HotModuleReplacementPlugin(), 52 | new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. 53 | new webpack.NoEmitOnErrorsPlugin(), 54 | // https://github.com/ampedandwired/html-webpack-plugin 55 | new HtmlWebpackPlugin({ 56 | filename: 'index.html', 57 | template: 'index.html', 58 | inject: true 59 | }), 60 | // copy custom static assets 61 | new CopyWebpackPlugin([ 62 | { 63 | from: path.resolve(__dirname, '../static'), 64 | to: config.dev.assetsSubDirectory, 65 | ignore: ['.*'] 66 | } 67 | ]) 68 | ] 69 | }) 70 | 71 | module.exports = new Promise((resolve, reject) => { 72 | portfinder.basePort = process.env.PORT || config.dev.port 73 | portfinder.getPort((err, port) => { 74 | if (err) { 75 | reject(err) 76 | } else { 77 | // publish the new Port, necessary for e2e tests 78 | process.env.PORT = port 79 | // add port to devServer config 80 | devWebpackConfig.devServer.port = port 81 | 82 | // Add FriendlyErrorsPlugin 83 | devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ 84 | compilationSuccessInfo: { 85 | messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], 86 | }, 87 | onErrors: config.dev.notifyOnErrors 88 | ? utils.createNotifierCallback() 89 | : undefined 90 | })) 91 | 92 | resolve(devWebpackConfig) 93 | } 94 | }) 95 | }) 96 | -------------------------------------------------------------------------------- /acess-control-vue/build/webpack.prod.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const webpack = require('webpack') 5 | const config = require('../config') 6 | const merge = require('webpack-merge') 7 | const baseWebpackConfig = require('./webpack.base.conf') 8 | const CopyWebpackPlugin = require('copy-webpack-plugin') 9 | const HtmlWebpackPlugin = require('html-webpack-plugin') 10 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 11 | const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') 12 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin') 13 | 14 | const env = require('../config/prod.env') 15 | 16 | const webpackConfig = merge(baseWebpackConfig, { 17 | module: { 18 | rules: utils.styleLoaders({ 19 | sourceMap: config.build.productionSourceMap, 20 | extract: true, 21 | usePostCSS: true 22 | }) 23 | }, 24 | devtool: config.build.productionSourceMap ? config.build.devtool : false, 25 | output: { 26 | path: config.build.assetsRoot, 27 | filename: utils.assetsPath('js/[name].[chunkhash].js'), 28 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 29 | }, 30 | plugins: [ 31 | // http://vuejs.github.io/vue-loader/en/workflow/production.html 32 | new webpack.DefinePlugin({ 33 | 'process.env': env 34 | }), 35 | new UglifyJsPlugin({ 36 | uglifyOptions: { 37 | compress: { 38 | warnings: false 39 | } 40 | }, 41 | sourceMap: config.build.productionSourceMap, 42 | parallel: true 43 | }), 44 | // extract css into its own file 45 | new ExtractTextPlugin({ 46 | filename: utils.assetsPath('css/[name].[contenthash].css'), 47 | // Setting the following option to `false` will not extract CSS from codesplit chunks. 48 | // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. 49 | // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, 50 | // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110 51 | allChunks: true, 52 | }), 53 | // Compress extracted CSS. We are using this plugin so that possible 54 | // duplicated CSS from different components can be deduped. 55 | new OptimizeCSSPlugin({ 56 | cssProcessorOptions: config.build.productionSourceMap 57 | ? { safe: true, map: { inline: false } } 58 | : { safe: true } 59 | }), 60 | // generate dist index.html with correct asset hash for caching. 61 | // you can customize output by editing /index.html 62 | // see https://github.com/ampedandwired/html-webpack-plugin 63 | new HtmlWebpackPlugin({ 64 | filename: config.build.index, 65 | template: 'index.html', 66 | inject: true, 67 | minify: { 68 | removeComments: true, 69 | collapseWhitespace: true, 70 | removeAttributeQuotes: true 71 | // more options: 72 | // https://github.com/kangax/html-minifier#options-quick-reference 73 | }, 74 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin 75 | chunksSortMode: 'dependency' 76 | }), 77 | // keep module.id stable when vendor modules does not change 78 | new webpack.HashedModuleIdsPlugin(), 79 | // enable scope hoisting 80 | new webpack.optimize.ModuleConcatenationPlugin(), 81 | // split vendor js into its own file 82 | new webpack.optimize.CommonsChunkPlugin({ 83 | name: 'vendor', 84 | minChunks (module) { 85 | // any required modules inside node_modules are extracted to vendor 86 | return ( 87 | module.resource && 88 | /\.js$/.test(module.resource) && 89 | module.resource.indexOf( 90 | path.join(__dirname, '../node_modules') 91 | ) === 0 92 | ) 93 | } 94 | }), 95 | // extract webpack runtime and module manifest to its own file in order to 96 | // prevent vendor hash from being updated whenever app bundle is updated 97 | new webpack.optimize.CommonsChunkPlugin({ 98 | name: 'manifest', 99 | minChunks: Infinity 100 | }), 101 | // This instance extracts shared chunks from code splitted chunks and bundles them 102 | // in a separate chunk, similar to the vendor chunk 103 | // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk 104 | new webpack.optimize.CommonsChunkPlugin({ 105 | name: 'app', 106 | async: 'vendor-async', 107 | children: true, 108 | minChunks: 3 109 | }), 110 | 111 | // copy custom static assets 112 | new CopyWebpackPlugin([ 113 | { 114 | from: path.resolve(__dirname, '../static'), 115 | to: config.build.assetsSubDirectory, 116 | ignore: ['.*'] 117 | } 118 | ]) 119 | ] 120 | }) 121 | 122 | if (config.build.productionGzip) { 123 | const CompressionWebpackPlugin = require('compression-webpack-plugin') 124 | 125 | webpackConfig.plugins.push( 126 | new CompressionWebpackPlugin({ 127 | asset: '[path].gz[query]', 128 | algorithm: 'gzip', 129 | test: new RegExp( 130 | '\\.(' + 131 | config.build.productionGzipExtensions.join('|') + 132 | ')$' 133 | ), 134 | threshold: 10240, 135 | minRatio: 0.8 136 | }) 137 | ) 138 | } 139 | 140 | if (config.build.bundleAnalyzerReport) { 141 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 142 | webpackConfig.plugins.push(new BundleAnalyzerPlugin()) 143 | } 144 | 145 | module.exports = webpackConfig 146 | -------------------------------------------------------------------------------- /acess-control-vue/config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | NODE_ENV: '"development"' 7 | }) 8 | -------------------------------------------------------------------------------- /acess-control-vue/config/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // Template version: 1.3.1 3 | // see http://vuejs-templates.github.io/webpack for documentation. 4 | 5 | const path = require('path') 6 | 7 | module.exports = { 8 | dev: { 9 | 10 | // Paths 11 | assetsSubDirectory: 'static', 12 | assetsPublicPath: '/', 13 | proxyTable: { 14 | /*添加的内容*/ 15 | 'api':{ 16 | target: 'localhost', 17 | changeOrigin: true, 18 | pathRewrite:{ 19 | '^/api':'' 20 | } 21 | } 22 | }, 23 | 24 | // Various Dev Server settings 25 | host: 'localhost', // can be overwritten by process.env.HOST 26 | port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined 27 | autoOpenBrowser: false, 28 | errorOverlay: true, 29 | notifyOnErrors: true, 30 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- 31 | 32 | 33 | /** 34 | * Source Maps 35 | */ 36 | 37 | // https://webpack.js.org/configuration/devtool/#development 38 | devtool: 'cheap-module-eval-source-map', 39 | 40 | // If you have problems debugging vue-files in devtools, 41 | // set this to false - it *may* help 42 | // https://vue-loader.vuejs.org/en/options.html#cachebusting 43 | cacheBusting: true, 44 | 45 | cssSourceMap: true 46 | }, 47 | 48 | build: { 49 | // Template for index.html 50 | index: path.resolve(__dirname, '../dist/index.html'), 51 | 52 | // Paths 53 | assetsRoot: path.resolve(__dirname, '../dist'), 54 | assetsSubDirectory: 'static', 55 | assetsPublicPath: '/', 56 | 57 | /** 58 | * Source Maps 59 | */ 60 | 61 | productionSourceMap: true, 62 | // https://webpack.js.org/configuration/devtool/#production 63 | devtool: '#source-map', 64 | 65 | // Gzip off by default as many popular static hosts such as 66 | // Surge or Netlify already gzip all static assets for you. 67 | // Before setting to `true`, make sure to: 68 | // npm install --save-dev compression-webpack-plugin 69 | productionGzip: false, 70 | productionGzipExtensions: ['js', 'css'], 71 | 72 | // Run the build command with an extra argument to 73 | // View the bundle analyzer report after build finishes: 74 | // `npm run build --report` 75 | // Set to `true` or `false` to always turn it on or off 76 | bundleAnalyzerReport: process.env.npm_config_report 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /acess-control-vue/config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /acess-control-vue/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 门禁管理系统 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /acess-control-vue/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-demo", 3 | "version": "1.0.0", 4 | "description": "A Vue.js project", 5 | "author": "Julius <2105618521@qq.com>", 6 | "private": true, 7 | "scripts": { 8 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", 9 | "start": "npm run dev", 10 | "build": "node build/build.js" 11 | }, 12 | "dependencies": { 13 | "axios": "^0.21.1", 14 | "echarts": "^5.1.1", 15 | "element-ui": "^2.15.1", 16 | "vue": "^2.5.2", 17 | "vue-echarts": "*", 18 | "vue-router": "^3.0.1", 19 | "vuex": "^3.6.2" 20 | }, 21 | "devDependencies": { 22 | "autoprefixer": "^7.1.2", 23 | "babel-core": "^6.22.1", 24 | "babel-helper-vue-jsx-merge-props": "^2.0.3", 25 | "babel-loader": "^7.1.1", 26 | "babel-plugin-syntax-jsx": "^6.18.0", 27 | "babel-plugin-transform-runtime": "^6.22.0", 28 | "babel-plugin-transform-vue-jsx": "^3.5.0", 29 | "babel-preset-env": "^1.3.2", 30 | "babel-preset-stage-2": "^6.22.0", 31 | "chalk": "^2.0.1", 32 | "copy-webpack-plugin": "^4.0.1", 33 | "css-loader": "^0.28.0", 34 | "extract-text-webpack-plugin": "^3.0.0", 35 | "file-loader": "^1.1.4", 36 | "friendly-errors-webpack-plugin": "^1.6.1", 37 | "html-webpack-plugin": "^2.30.1", 38 | "node-notifier": "^5.1.2", 39 | "optimize-css-assets-webpack-plugin": "^3.2.0", 40 | "ora": "^1.2.0", 41 | "portfinder": "^1.0.13", 42 | "postcss-import": "^11.0.0", 43 | "postcss-loader": "^2.0.8", 44 | "postcss-url": "^7.2.1", 45 | "rimraf": "^2.6.0", 46 | "semver": "^5.3.0", 47 | "shelljs": "^0.7.6", 48 | "uglifyjs-webpack-plugin": "^1.1.1", 49 | "url-loader": "^0.5.8", 50 | "vue-loader": "^13.3.0", 51 | "vue-style-loader": "^3.0.1", 52 | "vue-template-compiler": "^2.5.2", 53 | "webpack": "^3.6.0", 54 | "webpack-bundle-analyzer": "^2.9.0", 55 | "webpack-dev-server": "^2.9.1", 56 | "webpack-merge": "^4.1.0" 57 | }, 58 | "engines": { 59 | "node": ">= 6.0.0", 60 | "npm": ">= 3.0.0" 61 | }, 62 | "browserslist": [ 63 | "> 1%", 64 | "last 2 versions", 65 | "not ie <= 8" 66 | ] 67 | } 68 | -------------------------------------------------------------------------------- /acess-control-vue/src/App.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 23 | -------------------------------------------------------------------------------- /acess-control-vue/src/assets/css/color-dark.css: -------------------------------------------------------------------------------- 1 | .header{ 2 | background-color: #242f42; 3 | } 4 | .login-wrap{ 5 | background: #324157; 6 | } 7 | .plugins-tips{ 8 | background: #eef1f6; 9 | } 10 | .plugins-tips a{ 11 | color: #20a0ff; 12 | } 13 | .el-upload--text em { 14 | color: #20a0ff; 15 | } 16 | .pure-button{ 17 | background: #20a0ff; 18 | } 19 | .tags-li.active { 20 | border: 1px solid #409EFF; 21 | background-color: #409EFF; 22 | } 23 | .message-title{ 24 | color: #20a0ff; 25 | } 26 | .collapse-btn:hover{ 27 | background: rgb(40,52,70); 28 | } -------------------------------------------------------------------------------- /acess-control-vue/src/assets/css/main.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | html, 7 | body, 8 | #app, 9 | .wrapper { 10 | width: 100%; 11 | height: 100%; 12 | overflow: hidden; 13 | } 14 | 15 | body { 16 | font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif; 17 | } 18 | 19 | a { 20 | text-decoration: none 21 | } 22 | 23 | .content-box { 24 | position: absolute; 25 | left: 200px; 26 | right: 0; 27 | top: 70px; 28 | bottom: 0; 29 | padding-bottom: 30px; 30 | -webkit-transition: left .3s ease-in-out; 31 | transition: left .3s ease-in-out; 32 | background: #f0f0f0; 33 | } 34 | 35 | .content { 36 | width: auto; 37 | height: 100%; 38 | padding: 10px; 39 | overflow-y: scroll; 40 | box-sizing: border-box; 41 | } 42 | 43 | .content-collapse { 44 | left: 65px; 45 | } 46 | 47 | .container { 48 | padding: 30px; 49 | background: #fff; 50 | border: 1px solid #ddd; 51 | border-radius: 5px; 52 | } 53 | 54 | .crumbs { 55 | margin: 10px 0; 56 | } 57 | 58 | .el-table th { 59 | background-color: #f5f7fa !important; 60 | } 61 | 62 | .pagination { 63 | margin: 20px 0; 64 | text-align: right; 65 | } 66 | 67 | .plugins-tips { 68 | padding: 20px 10px; 69 | margin-bottom: 20px; 70 | } 71 | 72 | .el-button+.el-tooltip { 73 | margin-left: 10px; 74 | } 75 | 76 | .el-table tr:hover { 77 | background: #f6faff; 78 | } 79 | 80 | .mgb20 { 81 | margin-bottom: 20px; 82 | } 83 | 84 | .move-enter-active, 85 | .move-leave-active { 86 | transition: opacity .1s ease; 87 | } 88 | 89 | .move-enter-from, 90 | .move-leave-to { 91 | opacity: 0; 92 | } 93 | 94 | /*BaseForm*/ 95 | 96 | .form-box { 97 | width: 600px; 98 | } 99 | 100 | .form-box .line { 101 | text-align: center; 102 | } 103 | 104 | .el-time-panel__content::after, 105 | .el-time-panel__content::before { 106 | margin-top: -7px; 107 | } 108 | 109 | .el-time-spinner__wrapper .el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default) { 110 | padding-bottom: 0; 111 | } 112 | 113 | /*Upload*/ 114 | 115 | .pure-button { 116 | width: 150px; 117 | height: 40px; 118 | line-height: 40px; 119 | text-align: center; 120 | color: #fff; 121 | border-radius: 3px; 122 | } 123 | 124 | .g-core-image-corp-container .info-aside { 125 | height: 45px; 126 | } 127 | 128 | .el-upload--text { 129 | background-color: #fff; 130 | border: 1px dashed #d9d9d9; 131 | border-radius: 6px; 132 | box-sizing: border-box; 133 | width: 360px; 134 | height: 180px; 135 | text-align: center; 136 | cursor: pointer; 137 | position: relative; 138 | overflow: hidden; 139 | } 140 | 141 | .el-upload--text .el-icon-upload { 142 | font-size: 67px; 143 | color: #97a8be; 144 | margin: 40px 0 16px; 145 | line-height: 50px; 146 | } 147 | 148 | .el-upload--text { 149 | color: #97a8be; 150 | font-size: 14px; 151 | text-align: center; 152 | } 153 | 154 | .el-upload--text em { 155 | font-style: normal; 156 | } 157 | 158 | /*VueEditor*/ 159 | 160 | .ql-container { 161 | min-height: 400px; 162 | } 163 | 164 | .ql-snow .ql-tooltip { 165 | transform: translateX(117.5px) translateY(10px) !important; 166 | } 167 | 168 | .editor-btn { 169 | margin-top: 20px; 170 | } 171 | 172 | /*markdown*/ 173 | .v-note-wrapper .v-note-panel { 174 | min-height: 500px; 175 | } 176 | -------------------------------------------------------------------------------- /acess-control-vue/src/assets/img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangjunhui6/access-control-system/1377d5399f40a8d97479ddc0e60c3c08dca17585/acess-control-vue/src/assets/img.jpg -------------------------------------------------------------------------------- /acess-control-vue/src/assets/login-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangjunhui6/access-control-system/1377d5399f40a8d97479ddc0e60c3c08dca17585/acess-control-vue/src/assets/login-bg.jpg -------------------------------------------------------------------------------- /acess-control-vue/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangjunhui6/access-control-system/1377d5399f40a8d97479ddc0e60c3c08dca17585/acess-control-vue/src/assets/logo.png -------------------------------------------------------------------------------- /acess-control-vue/src/components/Home.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 43 | 44 | 47 | -------------------------------------------------------------------------------- /acess-control-vue/src/components/Login.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 门禁管理系统 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 登录 23 | 24 | 25 | 26 | 27 | 28 | 29 | 82 | 83 | 132 | -------------------------------------------------------------------------------- /acess-control-vue/src/components/admin/AdminManager.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 人员管理 6 | 管理员管理 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 搜索 15 | 16 | 17 | 添加管理员 18 | 19 | 20 | 批量删除 21 | 22 | 23 | 24 | 32 | 35 | 36 | 43 | 44 | 49 | 50 | 57 | {{ tag }} 58 | 59 | 60 | 61 | 66 | 67 | 71 | 权限设置 72 | 73 | 77 | 删除 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 全选 104 | 105 | 106 | 107 | {{ device }} 108 | 109 | 110 | 111 | 112 | 113 | 114 | 取消 115 | 确定 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 全选 128 | 129 | 130 | 131 | {{ device }} 132 | 133 | 134 | 135 | 136 | 137 | 138 | 取消 139 | 添加 140 | 141 | 142 | 143 | 144 | 145 | 146 | 351 | 352 | 365 | -------------------------------------------------------------------------------- /acess-control-vue/src/components/admin/DeviceManager.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 门禁设备管理 6 | 设备列表 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 搜索 15 | 16 | 18 | 添加设备 19 | 20 | 21 | 22 | 29 | 37 | 38 | 45 | 46 | 52 | 53 | 63 | 64 | 70 | 71 | 75 | 编辑 76 | 77 | 81 | 删除 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 取消 111 | 确定 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 取消 132 | 添加 133 | 134 | 135 | 136 | 137 | 138 | 139 | 305 | 306 | 321 | -------------------------------------------------------------------------------- /acess-control-vue/src/components/admin/RecordsManager.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 门禁管理 6 | 人员出入记录表 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 搜索 15 | 16 | 17 | 批量删除 18 | 19 | 20 | 21 | 29 | 30 | 37 | 38 | 45 | 46 | 53 | 54 | 63 | 64 | 71 | 72 | 81 | 82 | 83 | {{scope.row.temp}} 84 | 85 | 86 | {{scope.row.temp}} 87 | 88 | 89 | 90 | 96 | 97 | 102 | 103 | 108 | 删除 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 265 | 266 | 282 | -------------------------------------------------------------------------------- /acess-control-vue/src/components/admin/SystemView.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 最近一次访问记录 14 | 15 | 16 | 17 | {{lastRecord.userName}} 18 | 19 | 20 | {{lastRecord.time}} 21 | 22 | 23 | {{lastRecord.deviceName}} 24 | 25 | 26 | {{lastRecord.temp}}℃ 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 37 | 体温检测情况 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 181 | 182 | 187 | -------------------------------------------------------------------------------- /acess-control-vue/src/components/admin/UserManager.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 人员管理 6 | 用户管理 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 搜索 15 | 16 | 17 | 添加用户 18 | 19 | 20 | 批量注销 21 | 22 | 23 | 24 | 32 | 35 | 36 | 43 | 44 | 51 | 52 | 57 | 58 | 65 | 66 | 无 67 | 68 | 69 | 74 | 75 | 82 | {{ tag }} 83 | 84 | 85 | 86 | 91 | 92 | 96 | 权限设置 97 | 98 | 104 | 删除人脸 105 | 106 | 110 | 注销 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 全选 137 | 138 | 139 | 140 | {{ device }} 141 | 142 | 143 | 144 | 145 | 146 | 147 | 取消 148 | 确定 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 全选 161 | 162 | 163 | 164 | {{ device }} 165 | 166 | 167 | 168 | 169 | 170 | 171 | 取消 172 | 添加 173 | 174 | 175 | 176 | 177 | 178 | 179 | 411 | 412 | 425 | -------------------------------------------------------------------------------- /acess-control-vue/src/components/common/Header.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 门禁管理系统 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | {{ username }} 21 | 22 | 23 | 24 | 25 | 退出登录 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 68 | 126 | -------------------------------------------------------------------------------- /acess-control-vue/src/components/common/Sidebar.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | 16 | 17 | 18 | {{ item.title }} 19 | 20 | 21 | {{ subItem.title }} 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | {{ item.title }} 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 89 | 90 | 112 | -------------------------------------------------------------------------------- /acess-control-vue/src/components/common/Tags.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | {{ item.title }} 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 标签选项 21 | 22 | 23 | 24 | 25 | 关闭其他 26 | 关闭所有 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 103 | 104 | 105 | 176 | -------------------------------------------------------------------------------- /acess-control-vue/src/components/otherAdmin/Manager.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 门禁管理系统 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | {{ username }} 14 | 15 | 16 | 17 | 18 | 修改密码 19 | 退出登录 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 取消 40 | 确定 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 搜索 53 | 54 | 55 | 56 | 63 | 70 | 71 | 78 | 79 | 86 | 87 | 96 | 97 | 104 | 105 | 114 | 115 | 116 | {{ scope.row.temp }} 117 | 118 | 119 | {{ scope.row.temp }} 120 | 121 | 122 | 123 | 129 | 130 | 131 | 132 | 133 | 134 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 287 | 288 | 348 | -------------------------------------------------------------------------------- /acess-control-vue/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import router from './router' 6 | /* 引入ElementUI */ 7 | import ElementUI from 'element-ui' 8 | import 'element-ui/lib/theme-chalk/index.css' 9 | /* 引入store */ 10 | import store from './store' 11 | /* 引入Echarts */ 12 | import * as echarts from 'echarts' 13 | 14 | 15 | /* 引入axios,设置反向代理,前端默认发送到 http://localhost:8443/api */ 16 | var axios = require('axios'); 17 | axios.defaults.baseURL = 'http://localhost:8086/api'; 18 | // 全局注册,之后其他组件可以通过this.$axios发送数据 19 | Vue.prototype.$axios = axios; 20 | Vue.config.productionTip = false; 21 | 22 | /* 使用ElementUI */ 23 | Vue.use(ElementUI) 24 | 25 | /* 使用Echarts*/ 26 | Vue.prototype.$echarts = echarts; 27 | 28 | /* 阻止Vue启动时生成生产提示 */ 29 | Vue.config.productionTip = false 30 | 31 | /* 访问每个路由前调用钩子函数 */ 32 | router.beforeEach((to, from, next) => { 33 | // 判断是否需要超级管理员或管理员才能进入 34 | if (to.meta.requireAuth === "admin") { 35 | if (store.state.username === "admin"){ 36 | next() 37 | } else { 38 | next({ 39 | path: 'login', 40 | query: {redirect: to.fullPath} 41 | }) 42 | } 43 | } else if (to.meta.requireAuth === "otherAdmin") { 44 | if (store.state.username !== "" && store.state.username !== "admin"){ 45 | next() 46 | } else { 47 | next({ 48 | path: 'login', 49 | query: {redirect: to.fullPath} 50 | }) 51 | } 52 | } else { 53 | next() 54 | } 55 | }) 56 | 57 | /* eslint-disable no-new */ 58 | new Vue({ 59 | el: '#app', 60 | router, 61 | store, 62 | components: {App}, 63 | template: '' 64 | }) 65 | -------------------------------------------------------------------------------- /acess-control-vue/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | 4 | Vue.use(Router) 5 | 6 | import Login from "../components/Login"; 7 | import Home from "../components/Home"; 8 | import SystemView from "../components/admin/SystemView"; 9 | import RecordsManager from "../components/admin/RecordsManager"; 10 | import DeviceManager from "../components/admin/DeviceManager"; 11 | import UserManager from "../components/admin/UserManager"; 12 | import AdminManager from "../components/admin/AdminManager"; 13 | import Manager from "../components/otherAdmin/Manager"; 14 | 15 | export default new Router({ 16 | routes: [ 17 | { 18 | path: '/', /*登录*/ 19 | name: 'Login', 20 | redirect: '/login', 21 | component: Login 22 | }, 23 | { 24 | path: '/login', /*登录*/ 25 | name: 'Login', 26 | component: Login 27 | }, 28 | { 29 | path: '/home', /* 超级管理员 */ 30 | name: 'Home', 31 | component: Home, 32 | redirect: '/index', 33 | children: [ 34 | { 35 | path: '/index', 36 | name: 'Index', 37 | component: SystemView, 38 | meta:{ 39 | requireAuth: "admin", 40 | title: "主页" 41 | } 42 | }, 43 | { 44 | path: '/access', 45 | name: 'Access', 46 | component: RecordsManager, 47 | meta:{ 48 | requireAuth: "admin", 49 | title: "门禁管理" 50 | } 51 | }, 52 | { 53 | path: '/device', 54 | name: 'Device', 55 | component: DeviceManager, 56 | meta:{ 57 | requireAuth: "admin", 58 | title: "设备管理" 59 | } 60 | }, 61 | { 62 | path: '/user', 63 | name: 'User', 64 | component: UserManager, 65 | meta:{ 66 | requireAuth: "admin", 67 | title: "用户管理" 68 | } 69 | }, 70 | { 71 | path: '/admin', 72 | name: 'Admin', 73 | component: AdminManager, 74 | meta:{ 75 | requireAuth: "admin", 76 | title: "管理员管理" 77 | } 78 | }, 79 | ] 80 | }, 81 | { 82 | path: '/manager', /* 普通管理员 */ 83 | name: 'Manager', 84 | component: Manager, 85 | meta:{ 86 | requireAuth: "otherAdmin", 87 | title: "普通门禁管理" 88 | } 89 | }, 90 | ] 91 | }) 92 | -------------------------------------------------------------------------------- /acess-control-vue/src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | Vue.use(Vuex) 5 | 6 | export default new Vuex.Store({ 7 | state: { 8 | username: window.localStorage.getItem('username') == null ? "" : JSON.parse(window.localStorage.getItem('username')), 9 | devices: window.localStorage.getItem('devices') == null ? [] : JSON.parse(window.localStorage.getItem('devices')), 10 | collapse: false, 11 | tagsList: [] 12 | }, 13 | mutations: { 14 | login(state, username) { 15 | state.username = username; 16 | window.localStorage.setItem('username', JSON.stringify(username)); 17 | }, 18 | setDevices(state, devices) { 19 | state.devices = devices; 20 | window.localStorage.setItem("devices", JSON.stringify(devices)); 21 | }, 22 | logout(state) { 23 | window.localStorage.clear(); 24 | state.username = ""; 25 | state.devices = []; 26 | state.collapse = false; 27 | state.tagsList = []; 28 | }, 29 | handleCollapse(state, data) { 30 | state.collapse = data; 31 | }, 32 | /* 删除一个标签 */ 33 | delTagsItem(state, data) { 34 | state.tagsList.splice(data.index,1); 35 | }, 36 | /* 添加一个标签 */ 37 | setTagsItem(state, data) { 38 | state.tagsList.push(data) 39 | }, 40 | /* 清空 */ 41 | clearTags(state) { 42 | state.tagsList = [] 43 | }, 44 | /* 关闭其他标签 */ 45 | closeTagsOther(state, data) { 46 | state.tagsList = data; 47 | }, 48 | closeCurrentTag(state, data) { 49 | for (let i = 0, len = state.tagsList.length; i < len; i++) { 50 | const item = state.tagsList[i]; 51 | if (item.path === data.$route.fullPath) { 52 | if (i < len - 1) { 53 | data.$router.push(state.tagsList[i + 1].path); 54 | } else if (i > 0) { 55 | data.$router.push(state.tagsList[i - 1].path); 56 | } else { 57 | data.$router.push("/"); 58 | } 59 | state.tagsList.splice(i, 1); 60 | break; 61 | } 62 | } 63 | } 64 | } 65 | }) 66 | -------------------------------------------------------------------------------- /acess-control-vue/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangjunhui6/access-control-system/1377d5399f40a8d97479ddc0e60c3c08dca17585/acess-control-vue/static/.gitkeep -------------------------------------------------------------------------------- /images/access.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangjunhui6/access-control-system/1377d5399f40a8d97479ddc0e60c3c08dca17585/images/access.png -------------------------------------------------------------------------------- /images/admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangjunhui6/access-control-system/1377d5399f40a8d97479ddc0e60c3c08dca17585/images/admin.png -------------------------------------------------------------------------------- /images/device.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangjunhui6/access-control-system/1377d5399f40a8d97479ddc0e60c3c08dca17585/images/device.png -------------------------------------------------------------------------------- /images/index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangjunhui6/access-control-system/1377d5399f40a8d97479ddc0e60c3c08dca17585/images/index.png -------------------------------------------------------------------------------- /images/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangjunhui6/access-control-system/1377d5399f40a8d97479ddc0e60c3c08dca17585/images/login.png -------------------------------------------------------------------------------- /images/manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangjunhui6/access-control-system/1377d5399f40a8d97479ddc0e60c3c08dca17585/images/manager.png -------------------------------------------------------------------------------- /images/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangjunhui6/access-control-system/1377d5399f40a8d97479ddc0e60c3c08dca17585/images/user.png --------------------------------------------------------------------------------