Bläddra i källkod

feat: 接口权限与设备注册逻辑调整
1. 更改用户权限部分逻辑, 区分为用户和管理员权限角色
2. 新增sip域管理, 设备注册时会比对sip配置表中的 域与密码等信息
docs: 设备绑定机制的优化
1. 确定的设备绑定机制的数据库更改
2. 细化设备绑定功能的数据模型

kindring 1 år sedan
förälder
incheckning
0ea74bc105
43 ändrade filer med 1368 tillägg och 827 borttagningar
  1. 1 1
      olDoc/_content/ability/proxy.md
  2. 1 1
      olDoc/_content/introduction/config.md
  3. 1 1
      package/my.cnf
  4. 767 284
      package/mysqlDocker/db.sql
  5. 12 12
      package/redisDocker/redis.conf
  6. 29 21
      sql/mysql.sql
  7. 29 21
      sql/初始化.sql
  8. 31 30
      sql/新版数据结构 1.11.sql
  9. 15 3
      src/main/java/com/genersoft/iot/vmp/conf/GlobalExceptionHandler.java
  10. 8 8
      src/main/java/com/genersoft/iot/vmp/conf/security/DefaultUserDetailsServiceImpl.java
  11. 6 6
      src/main/java/com/genersoft/iot/vmp/conf/security/SecurityUtils.java
  12. 15 12
      src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java
  13. 9 9
      src/main/java/com/genersoft/iot/vmp/conf/security/dto/LoginUser.java
  14. 2 3
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java
  15. 1 1
      src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
  16. 31 0
      src/main/java/com/genersoft/iot/vmp/service/IAdminService.java
  17. 17 0
      src/main/java/com/genersoft/iot/vmp/service/IDeviceService.java
  18. 0 31
      src/main/java/com/genersoft/iot/vmp/service/IUserService.java
  19. 1 1
      src/main/java/com/genersoft/iot/vmp/service/impl/AccountServiceImpl.java
  20. 92 0
      src/main/java/com/genersoft/iot/vmp/service/impl/AdminServiceImpl.java
  21. 22 1
      src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
  22. 7 4
      src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
  23. 0 92
      src/main/java/com/genersoft/iot/vmp/service/impl/UserServiceImpl.java
  24. 16 16
      src/main/java/com/genersoft/iot/vmp/storager/dao/AdminMapper.java
  25. 5 1
      src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
  26. 0 1
      src/main/java/com/genersoft/iot/vmp/storager/dao/RoleMapper.java
  27. 1 1
      src/main/java/com/genersoft/iot/vmp/storager/dao/dto/AdminAccount.java
  28. 2 3
      src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
  29. 1 8
      src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java
  30. 18 11
      src/main/java/com/genersoft/iot/vmp/vmanager/user/AccountController.java
  31. 48 71
      src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java
  32. 7 7
      src/main/java/com/genersoft/iot/vmp/web/gb28181/AuthController.java
  33. 3 3
      web_src/src/components/aiConfig.vue
  34. 1 1
      web_src/src/components/common/h265web.vue
  35. 1 1
      web_src/src/components/common/h265webJessibuca.vue
  36. 1 1
      web_src/src/components/common/jessibuca.vue
  37. 1 1
      web_src/src/components/common/microphone.vue
  38. 1 1
      web_src/src/components/u_page/u_info.vue
  39. 1 1
      web_src/src/layout/UiHeader.vue
  40. 9 2
      web_src/vue.config.js
  41. 151 151
      参考文档/rfc3261.txt
  42. 2 2
      参考文档/配置文件.md
  43. 2 2
      设备绑定机制.md

+ 1 - 1
olDoc/_content/ability/proxy.md

@@ -3,7 +3,7 @@
 不是所有的摄像机都支持国标或者推流的,但是这些设备可以得到一个视频播放地址,通常为rtsp协议,
 以大华为例:
 ```text
-rtsp://{user}:{passwd}@{ipc_ip}:{rtsp_port}/cam/realmonitor?channel=1&subtype=0
+rtsp://{adminAccount}:{passwd}@{ipc_ip}:{rtsp_port}/cam/realmonitor?channel=1&subtype=0
 ```
 可以得到这样一个流地址,可以直接用vlc进行播放,此时我们可以通过拉流代理功能将这个设备推送给其他国标平台了。
 流程如下:

+ 1 - 1
olDoc/_content/introduction/config.md

@@ -84,7 +84,7 @@ media:
 ### 2.4 个性化定制信息配置
 ```yaml
 # [根据业务需求配置]
-user-settings:
+adminAccount-settings:
     # [可选] 服务ID,不写则为000000
     server-id:
     # [可选] 自动点播, 使用固定流地址进行播放时,如果未点播则自动进行点播, 需要rtp.enable=true

+ 1 - 1
package/my.cnf

@@ -28,7 +28,7 @@ skip-name-resolve
 datadir=/var/lib/mysql
 socket=/var/run/mysqld/mysqld.sock
 secure-file-priv=/var/lib/mysql-files
-user=mysql
+adminAccount=mysql
 
 pid-file=/var/run/mysqld/mysqld.pid
 [client]

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 767 - 284
package/mysqlDocker/db.sql


+ 12 - 12
package/redisDocker/redis.conf

@@ -220,7 +220,7 @@ save 60 10000
 
 # By default Redis will stop accepting writes if RDB snapshots are enabled
 # (at least one save point) and the latest background save failed.
-# This will make the user aware (in a hard way) that data is not persisting
+# This will make the adminAccount aware (in a hard way) that data is not persisting
 # on disk properly, otherwise chances are that no one will notice and some
 # disaster will happen.
 #
@@ -278,7 +278,7 @@ dir /data/redis
 #    master if the replication link is lost for a relatively small amount of
 #    time. You may want to configure the replication backlog size (see the next
 #    sections of this file) with a sensible value depending on your needs.
-# 3) Replication is automatic and does not need user intervention. After a
+# 3) Replication is automatic and does not need adminAccount intervention. After a
 #    network partition replicas automatically try to reconnect to masters
 #    and resynchronize with them.
 #
@@ -499,7 +499,7 @@ replica-priority 100
 # This should stay commented out for backward compatibility and because most
 # people do not need auth (e.g. they run their own servers).
 #
-# Warning: since Redis is pretty fast an outside user can try up to
+# Warning: since Redis is pretty fast an outside adminAccount can try up to
 # 150k passwords per second against a good box. This means that you should
 # use a very strong password otherwise it will be very easy to break.
 #
@@ -643,11 +643,11 @@ requirepass hfyredis28181
 # are executed in constant time. Another thread will incrementally free the
 # object in the background as fast as possible.
 #
-# DEL, UNLINK and ASYNC option of FLUSHALL and FLUSHDB are user-controlled.
+# DEL, UNLINK and ASYNC option of FLUSHALL and FLUSHDB are adminAccount-controlled.
 # It's up to the design of the application to understand when it is a good
 # idea to use one or the other. However the Redis server sometimes has to
 # delete keys or flush the whole database as a side effect of other operations.
-# Specifically Redis deletes objects independently of a user call in the
+# Specifically Redis deletes objects independently of a adminAccount call in the
 # following scenarios:
 #
 # 1) On eviction, because of the maxmemory and maxmemory policy configurations,
@@ -781,9 +781,9 @@ auto-aof-rewrite-min-size 64mb
 # to be truncated at the end. The following option controls this behavior.
 #
 # If aof-load-truncated is set to yes, a truncated AOF file is loaded and
-# the Redis server starts emitting a log to inform the user of the event.
+# the Redis server starts emitting a log to inform the adminAccount of the event.
 # Otherwise if the option is set to no, the server aborts with an error
-# and refuses to start. When the option is set to no, the user requires
+# and refuses to start. When the option is set to no, the adminAccount requires
 # to fix the AOF file using the "redis-check-aof" utility before to restart
 # the server.
 #
@@ -816,7 +816,7 @@ aof-use-rdb-preamble yes
 # SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be
 # used to stop a script that did not yet called write commands. The second
 # is the only way to shut down the server in the case a write command was
-# already issued by the script but the user doesn't want to wait for the natural
+# already issued by the script but the adminAccount doesn't want to wait for the natural
 # termination of the script.
 #
 # Set it to 0 or a negative value for unlimited execution without warnings.
@@ -863,7 +863,7 @@ lua-time-limit 5000
 #    If the last interaction is too old, the replica will not try to failover
 #    at all.
 #
-# The point "2" can be tuned by user. Specifically a replica will not perform
+# The point "2" can be tuned by adminAccount. Specifically a replica will not perform
 # the failover if, since the last interaction with the master, the time
 # elapsed is greater than:
 #
@@ -997,7 +997,7 @@ slowlog-max-len 128
 # at runtime in order to collect data related to possible sources of
 # latency of a Redis instance.
 #
-# Via the LATENCY command this information is available to the user that can
+# Via the LATENCY command this information is available to the adminAccount that can
 # print graphs and obtain reports.
 #
 # The system only logs operations that were performed in a time equal or
@@ -1053,7 +1053,7 @@ latency-monitor-threshold 0
 #
 #  notify-keyspace-events Ex
 #
-#  By default all notifications are disabled because most users don't need
+#  By default all notifications are disabled because most adminAccounts don't need
 #  this feature and the feature has some overhead. Note that if you don't
 #  specify at least one of K or E, no events will be delivered.
 notify-keyspace-events ""
@@ -1219,7 +1219,7 @@ client-output-buffer-limit pubsub 32mb 8mb 60
 # handled with more precision.
 #
 # The range is between 1 and 500, however a value over 100 is usually not
-# a good idea. Most users should use the default of 10 and raise this up to
+# a good idea. Most adminAccounts should use the default of 10 and raise this up to
 # 100 only in environments where very low latency is required.
 hz 10
 

+ 29 - 21
sql/mysql.sql

@@ -499,40 +499,47 @@ CREATE TABLE `stream_push` (
 -- Dumping data for table `stream_push`
 --
 
-LOCK TABLES `stream_push` WRITE;
+LOCK
+TABLES `stream_push` WRITE;
 /*!40000 ALTER TABLE `stream_push` DISABLE KEYS */;
 /*!40000 ALTER TABLE `stream_push` ENABLE KEYS */;
-UNLOCK TABLES;
+UNLOCK
+TABLES;
 
 --
--- Table structure for table `user`
+-- Table structure for table `adminAccount`
 --
 
-DROP TABLE IF EXISTS `user`;
+DROP TABLE IF EXISTS `adminAccount`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!50503 SET character_set_client = utf8mb4 */;
-CREATE TABLE `user` (
-                        `id` int NOT NULL AUTO_INCREMENT,
-                        `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-                        `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-                        `roleId` int NOT NULL,
-                        `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-                        `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-                        `pushKey` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
-                        PRIMARY KEY (`id`) USING BTREE,
-                        UNIQUE KEY `user_username_uindex` (`username`) USING BTREE
+CREATE TABLE `adminAccount`
+(
+    `id`         int                                                           NOT NULL AUTO_INCREMENT,
+    `username`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+    `password`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+    `roleId`     int                                                           NOT NULL,
+    `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci  NOT NULL,
+    `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci  NOT NULL,
+    `pushKey`    varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    UNIQUE KEY `user_username_uindex` (`username`) USING BTREE
 ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 --
--- Dumping data for table `user`
+-- Dumping data for table `adminAccount`
 --
 
-LOCK TABLES `user` WRITE;
-/*!40000 ALTER TABLE `user` DISABLE KEYS */;
-INSERT INTO `user` VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021 - 04 - 13 14:14:57','2021 - 04 - 13 14:14:57','3e80d1762a324d5b0ff636e0bd16f1e3');
-/*!40000 ALTER TABLE `user` ENABLE KEYS */;
-UNLOCK TABLES;
+LOCK
+TABLES `adminAccount` WRITE;
+/*!40000 ALTER TABLE `adminAccount` DISABLE KEYS */;
+INSERT INTO `adminAccount`
+VALUES (1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 1, '2021 - 04 - 13 14:14:57', '2021 - 04 - 13 14:14:57',
+        '3e80d1762a324d5b0ff636e0bd16f1e3');
+/*!40000 ALTER TABLE `adminAccount` ENABLE KEYS */;
+UNLOCK
+TABLES;
 
 --
 -- Table structure for table `user_role`
@@ -541,7 +548,8 @@ UNLOCK TABLES;
 DROP TABLE IF EXISTS `user_role`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!50503 SET character_set_client = utf8mb4 */;
-CREATE TABLE `user_role` (
+CREATE TABLE `user_role`
+(
                              `id` int NOT NULL AUTO_INCREMENT,
                              `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
                              `authority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,

+ 29 - 21
sql/初始化.sql

@@ -505,40 +505,47 @@ CREATE TABLE `stream_push` (
 -- Dumping data for table `stream_push`
 --
 
-LOCK TABLES `stream_push` WRITE;
+LOCK
+TABLES `stream_push` WRITE;
 /*!40000 ALTER TABLE `stream_push` DISABLE KEYS */;
 /*!40000 ALTER TABLE `stream_push` ENABLE KEYS */;
-UNLOCK TABLES;
+UNLOCK
+TABLES;
 
 --
--- Table structure for table `user`
+-- Table structure for table `adminAccount`
 --
 
-DROP TABLE IF EXISTS `user`;
+DROP TABLE IF EXISTS `adminAccount`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!50503 SET character_set_client = utf8mb4 */;
-CREATE TABLE `user` (
-                        `id` int NOT NULL AUTO_INCREMENT,
-                        `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-                        `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-                        `roleId` int NOT NULL,
-                        `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-                        `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-                        `pushKey` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
-                        PRIMARY KEY (`id`) USING BTREE,
-                        UNIQUE KEY `user_username_uindex` (`username`) USING BTREE
+CREATE TABLE `adminAccount`
+(
+    `id`         int                                                           NOT NULL AUTO_INCREMENT,
+    `username`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+    `password`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+    `roleId`     int                                                           NOT NULL,
+    `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci  NOT NULL,
+    `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci  NOT NULL,
+    `pushKey`    varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    UNIQUE KEY `user_username_uindex` (`username`) USING BTREE
 ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 --
--- Dumping data for table `user`
+-- Dumping data for table `adminAccount`
 --
 
-LOCK TABLES `user` WRITE;
-/*!40000 ALTER TABLE `user` DISABLE KEYS */;
-INSERT INTO `user` VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021-04-13 14:14:57','2021-04-13 14:14:57','3e80d1762a324d5b0ff636e0bd16f1e3');
-/*!40000 ALTER TABLE `user` ENABLE KEYS */;
-UNLOCK TABLES;
+LOCK
+TABLES `adminAccount` WRITE;
+/*!40000 ALTER TABLE `adminAccount` DISABLE KEYS */;
+INSERT INTO `adminAccount`
+VALUES (1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 1, '2021-04-13 14:14:57', '2021-04-13 14:14:57',
+        '3e80d1762a324d5b0ff636e0bd16f1e3');
+/*!40000 ALTER TABLE `adminAccount` ENABLE KEYS */;
+UNLOCK
+TABLES;
 
 --
 -- Table structure for table `user_role`
@@ -547,7 +554,8 @@ UNLOCK TABLES;
 DROP TABLE IF EXISTS `user_role`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!50503 SET character_set_client = utf8mb4 */;
-CREATE TABLE `user_role` (
+CREATE TABLE `user_role`
+(
                              `id` int NOT NULL AUTO_INCREMENT,
                              `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
                              `authority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,

+ 31 - 30
sql/新版数据结构 1.11.sql

@@ -433,39 +433,40 @@ CREATE TABLE `stream_proxy`  (
 -- ----------------------------
 DROP TABLE IF EXISTS `stream_push`;
 CREATE TABLE `stream_push`  (
-  `id` int NOT NULL AUTO_INCREMENT,
-  `app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-  `stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-  `totalReaderCount` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
-  `originType` int NULL DEFAULT NULL,
-  `originTypeStr` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
-  `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
-  `aliveSecond` int NULL DEFAULT NULL,
-  `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
-  `serverId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-  `pushTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
-  `status` int NULL DEFAULT NULL,
-  `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
-  `pushIng` int NULL DEFAULT NULL,
-  `self` int NULL DEFAULT NULL,
-  PRIMARY KEY (`id`) USING BTREE,
-  UNIQUE INDEX `stream_push_pk`(`app` ASC, `stream` ASC) USING BTREE
+                                `id` int NOT NULL AUTO_INCREMENT,
+                                `app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+                                `stream`           varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+                                `totalReaderCount` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+                                `originType`       int NULL DEFAULT NULL,
+                                `originTypeStr`    varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+                                `createTime`       varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+                                `aliveSecond`      int NULL DEFAULT NULL,
+                                `mediaServerId`    varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+                                `serverId`         varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+                                `pushTime`         varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+                                `status`           int NULL DEFAULT NULL,
+                                `updateTime`       varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+                                `pushIng`          int NULL DEFAULT NULL,
+                                `self`             int NULL DEFAULT NULL,
+                                PRIMARY KEY (`id`) USING BTREE,
+                                UNIQUE INDEX `stream_push_pk`(`app` ASC, `stream` ASC) USING BTREE
 ) ENGINE = InnoDB AUTO_INCREMENT = 161 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
 
 -- ----------------------------
--- Table structure for user
--- ----------------------------
-DROP TABLE IF EXISTS `user`;
-CREATE TABLE `user`  (
-  `id` int NOT NULL AUTO_INCREMENT,
-  `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-  `roleId` int NOT NULL,
-  `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-  `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
-  `pushKey` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
-  PRIMARY KEY (`id`) USING BTREE,
-  UNIQUE INDEX `user_username_uindex`(`username` ASC) USING BTREE
+-- Table structure for adminAccount
+-- ----------------------------
+DROP TABLE IF EXISTS `adminAccount`;
+CREATE TABLE `adminAccount`
+(
+    `id`         int                                                           NOT NULL AUTO_INCREMENT,
+    `username`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+    `password`   varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+    `roleId`     int                                                           NOT NULL,
+    `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci  NOT NULL,
+    `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci  NOT NULL,
+    `pushKey`    varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    UNIQUE INDEX `user_username_uindex`(`username` ASC) USING BTREE
 ) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
 
 -- ----------------------------

+ 15 - 3
src/main/java/com/genersoft/iot/vmp/conf/GlobalExceptionHandler.java

@@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.authentication.BadCredentialsException;
+import org.springframework.web.bind.MissingServletRequestParameterException;
 import org.springframework.web.bind.annotation.ExceptionHandler;
 import org.springframework.web.bind.annotation.ResponseStatus;
 import org.springframework.web.bind.annotation.RestControllerAdvice;
@@ -130,12 +131,23 @@ public class GlobalExceptionHandler {
             return WVPResult.fail(ErrorCode.ERROR401);
         }
 
+        @ExceptionHandler(MissingServletRequestParameterException.class)
+        public ResponseEntity<String> handleMissingServletRequestParameterException(MissingServletRequestParameterException ex) {
+            // 确实请求参数
+            // 处理缺少请求参数异常
+            return new ResponseEntity<>("缺少请求参数: " + ex.getParameterName(), HttpStatus.BAD_REQUEST);
+        }
+
+
         // 拦截:其它所有异常
         @ExceptionHandler(Exception.class)
-        public WVPResult handlerException(Exception e) {
-            logger.error("其它所有异常");
+        public ResponseEntity<WVPResult> handlerException(Exception e) {
+
+            logger.error("其它所有异常: {}", e.getMessage());
             e.printStackTrace();
-            return WVPResult.fail(ErrorCode.ERROR500);
+            WVPResult result = WVPResult.fail(ErrorCode.ERROR500);
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(result);
+
         }
     }
 }

+ 8 - 8
src/main/java/com/genersoft/iot/vmp/conf/security/DefaultUserDetailsServiceImpl.java

@@ -2,8 +2,8 @@ package com.genersoft.iot.vmp.conf.security;
 
 import com.alibaba.excel.util.StringUtils;
 import com.genersoft.iot.vmp.conf.security.dto.LoginUser;
-import com.genersoft.iot.vmp.service.IUserService;
-import com.genersoft.iot.vmp.storager.dao.dto.User;
+import com.genersoft.iot.vmp.service.IAdminService;
+import com.genersoft.iot.vmp.storager.dao.dto.AdminAccount;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,7 +23,7 @@ public class DefaultUserDetailsServiceImpl implements UserDetailsService {
     private final static Logger logger = LoggerFactory.getLogger(DefaultUserDetailsServiceImpl.class);
 
     @Autowired
-    private IUserService userService;
+    private IAdminService userService;
 
     @Override
     public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
@@ -33,14 +33,14 @@ public class DefaultUserDetailsServiceImpl implements UserDetailsService {
         }
 
         // 查出密码
-        User user = userService.getUserByUsername(username);
-        if (user == null) {
+        AdminAccount adminAccount = userService.getUserByUsername(username);
+        if (adminAccount == null) {
             logger.info("登录用户:{} 不存在", username);
             throw new UsernameNotFoundException("登录用户:" + username + " 不存在");
         }
-        String password = SecurityUtils.encryptPassword(user.getPassword());
-        user.setPassword(password);
-        return new LoginUser(user, LocalDateTime.now());
+        String password = SecurityUtils.encryptPassword(adminAccount.getPassword());
+        adminAccount.setPassword(password);
+        return new LoginUser(adminAccount, LocalDateTime.now());
     }
 
 

+ 6 - 6
src/main/java/com/genersoft/iot/vmp/conf/security/SecurityUtils.java

@@ -1,7 +1,7 @@
 package com.genersoft.iot.vmp.conf.security;
 
 import com.genersoft.iot.vmp.conf.security.dto.LoginUser;
-import com.genersoft.iot.vmp.storager.dao.dto.User;
+import com.genersoft.iot.vmp.storager.dao.dto.AdminAccount;
 import org.springframework.security.authentication.AuthenticationManager;
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
 import org.springframework.security.core.Authentication;
@@ -53,15 +53,15 @@ public class SecurityUtils {
         Authentication authentication = getAuthentication();
         if(authentication!=null){
             Object principal = authentication.getPrincipal();
-            if(principal!=null && !"anonymousUser".equals(principal)){
+            if(principal!=null && !"anonymousUser".equals(principal)) {
 //                LoginUser user = (LoginUser) authentication.getPrincipal();
 
                 String username = (String) principal;
                 String password = (String) authentication.getCredentials();
-                User user = new User();
-                user.setUsername(username);
-                user.setPassword(password);
-                LoginUser loginUser = new LoginUser(user, LocalDateTime.now());
+                AdminAccount adminAccount = new AdminAccount();
+                adminAccount.setUsername(username);
+                adminAccount.setPassword(password);
+                LoginUser loginUser = new LoginUser(adminAccount, LocalDateTime.now());
                 return loginUser;
             }
         }

+ 15 - 12
src/main/java/com/genersoft/iot/vmp/conf/security/WebSecurityConfig.java

@@ -87,13 +87,14 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
             "/aiLib/",
             "/aiLib/mFile/",
             "/api/device/query/share/info",
+            "/account"
     };
 
     public static String[] matchShareUrl = new String[]{
             "/api/ptz",
             "/api/play",
             "/api/device/query/devices",
-            "/zlm/"
+            "/zlm/",
     };
 
 
@@ -168,21 +169,23 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
 //                .and().cors().configurationSource(configurationSource())
                 .and().cors()
                 .and().csrf().disable()
+//                .anyRequest()
+//                .permitAll()
 //                .sessionManagement()
 //                .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
 
-                // 配置拦截规则
+        // 配置拦截规则
 //                .and()
-                .authorizeRequests()
-                // 分享码验证
-                .accessDecisionManager(accessDecisionManager())
-                .anyRequest().authenticated()
-                // 异常处理器
-                .and()
-                .exceptionHandling()
-                .authenticationEntryPoint(anonymousAuthenticationEntryPoint)
-                .and().logout().logoutUrl("/api/user/logout").permitAll()
-                .logoutSuccessHandler(logoutHandler)
+//                .authorizeRequests()
+//                // 分享码验证
+////                .accessDecisionManager(accessDecisionManager())
+//                .anyRequest().authenticated()
+//                // 异常处理器
+//                .and()
+//                .exceptionHandling()
+//                .authenticationEntryPoint(anonymousAuthenticationEntryPoint)
+//                .and().logout().logoutUrl("/api/user/logout").permitAll()
+//                .logoutSuccessHandler(logoutHandler)
         ;
 //        http.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
 

+ 9 - 9
src/main/java/com/genersoft/iot/vmp/conf/security/dto/LoginUser.java

@@ -1,7 +1,7 @@
 package com.genersoft.iot.vmp.conf.security.dto;
 
+import com.genersoft.iot.vmp.storager.dao.dto.AdminAccount;
 import com.genersoft.iot.vmp.storager.dao.dto.Role;
-import com.genersoft.iot.vmp.storager.dao.dto.User;
 import org.springframework.security.core.CredentialsContainer;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.SpringSecurityCoreVersion;
@@ -17,7 +17,7 @@ public class LoginUser implements UserDetails, CredentialsContainer {
     /**
      * 用户
      */
-    private User user;
+    private AdminAccount adminAccount;
 
     private String accessToken;
 
@@ -27,8 +27,8 @@ public class LoginUser implements UserDetails, CredentialsContainer {
      */
     private LocalDateTime loginTime;
 
-    public LoginUser(User user, LocalDateTime loginTime) {
-        this.user = user;
+    public LoginUser(AdminAccount adminAccount, LocalDateTime loginTime) {
+        this.adminAccount = adminAccount;
         this.loginTime = loginTime;
     }
 
@@ -40,12 +40,12 @@ public class LoginUser implements UserDetails, CredentialsContainer {
 
     @Override
     public String getPassword() {
-        return user.getPassword();
+        return adminAccount.getPassword();
     }
 
     @Override
     public String getUsername() {
-        return user.getUsername();
+        return adminAccount.getUsername();
     }
 
     /**
@@ -88,16 +88,16 @@ public class LoginUser implements UserDetails, CredentialsContainer {
      */
     @Override
     public void eraseCredentials() {
-        user.setPassword(null);
+        adminAccount.setPassword(null);
     }
 
 
     public int getId() {
-        return user.getId();
+        return adminAccount.getId();
     }
 
     public Role getRole() {
-        return user.getRole();
+        return adminAccount.getRole();
     }
 
 

+ 2 - 3
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java

@@ -163,13 +163,13 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen
                 device.setTreeType("CivilCode");
                 device.setDeviceId(deviceId);
                 device.setOnline(0);
-                // todo 检查设备是否有绑定码
             }
             device.setIp(remoteAddressInfo.getIp());
             device.setPort(remoteAddressInfo.getPort());
             device.setHostAddress(remoteAddressInfo.getIp().concat(":").concat(String.valueOf(remoteAddressInfo.getPort())));
             device.setLocalIp(request.getLocalAddress().getHostAddress());
             device.setDomain(sipUserConfig.getSipDomain());
+
             if (request.getExpires().getExpires() == 0) {
                 // 注销成功
                 registerFlag = false;
@@ -194,8 +194,7 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen
 
                 if (sipUserConfig.isEnableBind()) {
                     logger.info("[sip注册成功] 设备:{} 连接的域启用绑定, 尝试获取设备绑定码中");
-                    // todo 获取设备注册码
-
+                    deviceService.loadBindCode(device);
                 }
             } else {
                 logger.info("[sip注销成功] deviceId: {}->{}", deviceId, requestAddress);

+ 1 - 1
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java

@@ -96,7 +96,7 @@ public class ZLMHttpHookListener {
     private UserSetting userSetting;
 
     @Autowired
-    private IUserService userService;
+    private IAdminService userService;
 
     @Autowired
     private VideoStreamSessionManager sessionManager;

+ 31 - 0
src/main/java/com/genersoft/iot/vmp/service/IAdminService.java

@@ -0,0 +1,31 @@
+package com.genersoft.iot.vmp.service;
+
+import com.genersoft.iot.vmp.storager.dao.dto.AdminAccount;
+import com.github.pagehelper.PageInfo;
+
+import java.util.List;
+
+public interface IAdminService {
+
+    AdminAccount getUser(String username, String password);
+
+    boolean changePassword(int id, String password);
+
+    AdminAccount getUserByUsername(String username);
+
+    int addUser(AdminAccount adminAccount);
+
+    int deleteUser(int id);
+
+    List<AdminAccount> getAllUsers();
+
+    int updateUsers(AdminAccount adminAccount);
+
+    boolean checkPushAuthority(String callId, String sign);
+
+    PageInfo<AdminAccount> getUsers(int page, int count);
+
+    int changePushKey(int id, String pushKey);
+
+    String getPushKey(int id);
+}

+ 17 - 0
src/main/java/com/genersoft/iot/vmp/service/IDeviceService.java

@@ -170,8 +170,25 @@ public interface IDeviceService {
 
     /**
      * 获取能够绑定的设备
+     *
      * @param bindCode 绑定码
      * @return
      */
     Device getBindDevice(String bindCode);
+
+    /**
+     * 加载设备绑定码
+     *
+     * @param device
+     */
+    public void loadBindCode(Device device);
+
+    /**
+     * 设备绑定码更新
+     *
+     * @param device
+     * @param bindCode
+     * @return
+     */
+    public boolean updateBindCode(Device device, String bindCode);
 }

+ 0 - 31
src/main/java/com/genersoft/iot/vmp/service/IUserService.java

@@ -1,31 +0,0 @@
-package com.genersoft.iot.vmp.service;
-
-import com.genersoft.iot.vmp.storager.dao.dto.User;
-import com.github.pagehelper.PageInfo;
-
-import java.util.List;
-
-public interface IUserService {
-
-    User getUser(String username, String password);
-
-    boolean changePassword(int id, String password);
-
-    User getUserByUsername(String username);
-
-    int addUser(User user);
-
-    int deleteUser(int id);
-
-    List<User> getAllUsers();
-
-    int updateUsers(User user);
-
-    boolean checkPushAuthority(String callId, String sign);
-
-    PageInfo<User> getUsers(int page, int count);
-
-    int changePushKey(int id, String pushKey);
-
-    String getPushKey(int id);
-}

+ 1 - 1
src/main/java/com/genersoft/iot/vmp/service/impl/AccountServiceImpl.java

@@ -64,7 +64,7 @@ public class AccountServiceImpl implements IAccountService {
 
     public Boolean checkIsAllowBind(String bindCode)
     {
-        if (deviceMapper.getBindDevice(bindCode) == null){
+        if (deviceMapper.getDeviceByBindCode(bindCode) == null) {
             return false;
         }
         Device device = accountMapper.findDeviceByDevCode(bindCode);

+ 92 - 0
src/main/java/com/genersoft/iot/vmp/service/impl/AdminServiceImpl.java

@@ -0,0 +1,92 @@
+package com.genersoft.iot.vmp.service.impl;
+
+import com.genersoft.iot.vmp.service.IAdminService;
+import com.genersoft.iot.vmp.storager.dao.AdminMapper;
+import com.genersoft.iot.vmp.storager.dao.dto.AdminAccount;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.ObjectUtils;
+
+import java.util.List;
+
+@Service
+public class AdminServiceImpl implements IAdminService {
+
+    @Autowired
+    private AdminMapper adminMapper;
+
+    @Override
+    public AdminAccount getUser(String username, String password) {
+        return adminMapper.select(username, password);
+    }
+
+    @Override
+    public boolean changePassword(int id, String password) {
+
+        AdminAccount adminAccount = adminMapper.selectById(id);
+        adminAccount.setPassword(password);
+        return adminMapper.update(adminAccount) > 0;
+    }
+
+    @Override
+    public AdminAccount getUserByUsername(String username) {
+        return adminMapper.getUserByUsername(username);
+    }
+
+    @Override
+    public int addUser(AdminAccount adminAccount) {
+        AdminAccount adminAccountByUsername = adminMapper.getUserByUsername(adminAccount.getUsername());
+        if (adminAccountByUsername != null) {
+            return 0;
+        }
+        return adminMapper.add(adminAccount);
+    }
+
+    @Override
+    public int deleteUser(int id) {
+        return adminMapper.delete(id);
+    }
+
+    @Override
+    public List<AdminAccount> getAllUsers() {
+        return adminMapper.selectAll();
+    }
+
+    @Override
+    public int updateUsers(AdminAccount adminAccount) {
+        return adminMapper.update(adminAccount);
+    }
+
+
+    @Override
+    public boolean checkPushAuthority(String callId, String sign) {
+        if (ObjectUtils.isEmpty(callId)) {
+            return adminMapper.checkPushAuthorityByCallId(sign).size() > 0;
+        }else {
+            return adminMapper.checkPushAuthorityByCallIdAndSign(callId, sign).size() > 0;
+        }
+    }
+
+    @Override
+    public PageInfo<AdminAccount> getUsers(int page, int count) {
+        PageHelper.startPage(page, count);
+        List<AdminAccount> adminAccounts = adminMapper.getUsers();
+        return new PageInfo<>(adminAccounts);
+    }
+
+    @Override
+    public int changePushKey(int id, String pushKey) {
+        return adminMapper.changePushKey(id, pushKey);
+    }
+
+    @Override
+    public String getPushKey(int id) {
+        List<AdminAccount> adminAccounts = adminMapper.getPushKey(id);
+        if (!adminAccounts.isEmpty()) {
+            return adminAccounts.get(0).getPushKey();
+        }
+        return null;
+    }
+}

+ 22 - 1
src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java

@@ -687,6 +687,27 @@ public class DeviceServiceImpl implements IDeviceService {
 
 
     public Device getBindDevice(String bindCode) {
-        return deviceMapper.getBindDevice(bindCode);
+        return deviceMapper.getDeviceByBindCode(bindCode);
     }
+
+
+    public void loadBindCode(Device device) {
+
+    }
+
+    // 更新设备 绑定码
+    public boolean updateBindCode(Device device, String bindCode) {
+        if (device == null || bindCode == null || bindCode.equals("")) {
+            logger.error("[绑定码更新] 设备或者绑定码错误");
+            return false;
+        }
+        Device oldDevice = deviceMapper.getDeviceByBindCode(bindCode);
+        if (oldDevice != null) {
+            oldDevice.setBindCode(null);
+            deviceMapper.updateBindCode(oldDevice.getDeviceId(), "");
+        }
+        return deviceMapper.updateBindCode(device.getDeviceId(), bindCode) > 0;
+    }
+
+
 }

+ 7 - 4
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java

@@ -198,17 +198,20 @@ public class MediaServerServiceImpl implements IMediaServerService {
             int rtpServerPort;
             // 创建
             Map<String, Object> rtpParam = zlmrtpServerFactory.createStartSendRtpStreamAudioData(mediaServerItem,app, recv_stream_id,audioStreamId,_ssrc,addr, Integer.parseInt(port),waitTime);
-            logger.info("[wvp ==> zlm:{}] {}",mediaServerItem.getId(),rtpParam.toString());
+            logger.info("[wvp ==> zlm:{}] {}", mediaServerItem.getId(), rtpParam.toString());
             if (mediaServerItem == null || mediaServerItem.getId() == null) {
                 logger.warn("无法连接至zlm!!!!!!!");
                 return null;
             }
             // 等待zlm回复时间为 waitTime+5 秒 毫秒转换为秒
-            JSONObject result = zlmrtpServerFactory.startSendRtpPassive(mediaServerItem,rtpParam,(waitTime / 1000) + 5);
+            JSONObject result = zlmrtpServerFactory.startSendRtpPassive(mediaServerItem, rtpParam, (waitTime / 1000) + 5);
 //            JSONObject result = zlmrtpServerFactory.startSendRtpStream(mediaServerItem,rtpParam);
-            logger.info("zlm start send {}",result.toJSONString());
+            logger.info("zlm start send {}", result.toJSONString());
             Integer code = (Integer) result.get("code");
-            if(code != null && code.intValue() != 0){ logger.error("[语音广播 流媒体异常] {}", result.get("msg")); return null; }
+            if (code != null && code.intValue() != 0) {
+                logger.error("[语音广播 流媒体异常] {}", result.get("msg"));
+                return null;
+            }
             RedisUtil.set(key, mediaServerItem);
             rtpServerPort = (int) result.get("local_port");
             return new SSRCInfo(rtpServerPort, ssrc, recv_stream_id);

+ 0 - 92
src/main/java/com/genersoft/iot/vmp/service/impl/UserServiceImpl.java

@@ -1,92 +0,0 @@
-package com.genersoft.iot.vmp.service.impl;
-
-import com.genersoft.iot.vmp.service.IUserService;
-import com.genersoft.iot.vmp.storager.dao.UserMapper;
-import com.genersoft.iot.vmp.storager.dao.dto.User;
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.util.ObjectUtils;
-import org.springframework.util.StringUtils;
-
-import java.util.List;
-
-@Service
-public class UserServiceImpl implements IUserService {
-
-    @Autowired
-    private UserMapper userMapper;
-
-    @Override
-    public User getUser(String username, String password) {
-        return userMapper.select(username, password);
-    }
-
-    @Override
-    public boolean changePassword(int id, String password) {
-
-        User user = userMapper.selectById(id);
-        user.setPassword(password);
-        return userMapper.update(user) > 0;
-    }
-
-    @Override
-    public User getUserByUsername(String username) {
-        return userMapper.getUserByUsername(username);
-    }
-
-    @Override
-    public int addUser(User user) {
-        User userByUsername = userMapper.getUserByUsername(user.getUsername());
-        if (userByUsername != null) {
-            return 0;
-        }
-        return userMapper.add(user);
-    }
-    @Override
-    public int deleteUser(int id) {
-        return userMapper.delete(id);
-    }
-
-    @Override
-    public List<User> getAllUsers() {
-        return userMapper.selectAll();
-    }
-
-    @Override
-    public int updateUsers(User user) {
-        return userMapper.update(user);
-    }
-
-
-    @Override
-    public boolean checkPushAuthority(String callId, String sign) {
-        if (ObjectUtils.isEmpty(callId)) {
-            return userMapper.checkPushAuthorityByCallId(sign).size() > 0;
-        }else {
-            return userMapper.checkPushAuthorityByCallIdAndSign(callId, sign).size() > 0;
-        }
-    }
-
-    @Override
-    public PageInfo<User> getUsers(int page, int count) {
-        PageHelper.startPage(page, count);
-        List<User> users = userMapper.getUsers();
-        return new PageInfo<>(users);
-    }
-
-    @Override
-    public int changePushKey(int id, String pushKey) {
-        return userMapper.changePushKey(id,pushKey);
-    }
-
-    @Override
-    public String getPushKey(int id) {
-        List<User> users = userMapper.getPushKey(id);
-        if (!users.isEmpty()) {
-            return users.get(0).getPushKey();
-        }
-        return null;
-    }
-}

+ 16 - 16
src/main/java/com/genersoft/iot/vmp/storager/dao/UserMapper.java → src/main/java/com/genersoft/iot/vmp/storager/dao/AdminMapper.java

@@ -1,6 +1,6 @@
 package com.genersoft.iot.vmp.storager.dao;
 
-import com.genersoft.iot.vmp.storager.dao.dto.User;
+import com.genersoft.iot.vmp.storager.dao.dto.AdminAccount;
 import org.apache.ibatis.annotations.*;
 import org.springframework.stereotype.Repository;
 
@@ -8,11 +8,11 @@ import java.util.List;
 
 @Mapper
 @Repository
-public interface UserMapper {
+public interface AdminMapper {
 
     @Insert("INSERT INTO user (username, password, roleId, pushKey, createTime, updateTime) VALUES" +
             "(#{username}, #{password}, #{role.id}, #{pushKey}, #{createTime}, #{updateTime})")
-    int add(User user);
+    int add(AdminAccount adminAccount);
 
     @Update(value = {" <script>" +
             "UPDATE user " +
@@ -23,7 +23,7 @@ public interface UserMapper {
             "<if test=\"username != null\">, username=#{username}</if>" +
             "WHERE id=#{id}" +
             " </script>"})
-    int update(User user);
+    int update(AdminAccount adminAccount);
 
     @Delete("DELETE FROM user WHERE id != 1 and id=#{id}")
     int delete(int id);
@@ -36,33 +36,33 @@ public interface UserMapper {
             @Result(column = "roleCreateTime", property = "role.createTime"),
             @Result(column = "roleUpdateTime", property = "role.updateTime")
     })
-    User select(String username, String password);
+    AdminAccount select(String username, String password);
 
     @Select("select u.*, r.id as roleID, r.name as roleName, r.authority as roleAuthority , r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u, user_role r WHERE u.roleId=r.id and u.id=#{id}")
-    @ResultMap(value="roleMap")
-    User selectById(int id);
+    @ResultMap(value = "roleMap")
+    AdminAccount selectById(int id);
 
     @Select("select u.*, r.id as roleID, r.name as roleName, r.authority as roleAuthority , r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u, user_role r WHERE u.roleId=r.id and u.username=#{username}")
-    @ResultMap(value="roleMap")
-    User getUserByUsername(String username);
+    @ResultMap(value = "roleMap")
+    AdminAccount getUserByUsername(String username);
 
     @Select("select u.*, r.id as roleID, r.name as roleName, r.authority as roleAuthority , r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u, user_role r WHERE u.roleId=r.id")
-    @ResultMap(value="roleMap")
-    List<User> selectAll();
+    @ResultMap(value = "roleMap")
+    List<AdminAccount> selectAll();
 
     @Select("select * from (select user.*, concat(concat(#{callId}, '_'), pushKey) as str1 from user) as u where md5(u.str1) = #{sign}")
-    List<User> checkPushAuthorityByCallIdAndSign(String callId, String sign);
+    List<AdminAccount> checkPushAuthorityByCallIdAndSign(String callId, String sign);
 
     @Select("select * from user where md5(pushKey) = #{sign}")
-    List<User> checkPushAuthorityByCallId(String sign);
+    List<AdminAccount> checkPushAuthorityByCallId(String sign);
 
     @Select("select u.id, u.username,u.pushKey,u.roleId, r.id as roleID, r.name as roleName, r.authority as roleAuthority , r.createTime as roleCreateTime , r.updateTime as roleUpdateTime FROM user u join user_role r on u.roleId=r.id")
-    @ResultMap(value="roleMap")
-    List<User> getUsers();
+    @ResultMap(value = "roleMap")
+    List<AdminAccount> getUsers();
 
     @Update("update user set pushKey=#{pushKey} where id=#{id}")
     int changePushKey(int id, String pushKey);
 
     @Select("select u.id,u.pushKey from user as u where id=#{id}")
-    List<User> getPushKey(int id);
+    List<AdminAccount> getPushKey(int id);
 }

+ 5 - 1
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java

@@ -421,7 +421,11 @@ public interface DeviceMapper {
     Integer getAutoUpdateByDeviceId(String deviceId);
 
     @Select("select * from device where bindCode = #{bindCode}")
-    Device getBindDevice(String bindCode);
+    Device getDeviceByBindCode(String bindCode);
+
+    // 设备绑定码更新
+    @Update("UPDATE device SET bindCode=#{bindCode} WHERE deviceId=#{deviceId}")
+    int updateBindCode(String deviceId, String bindCode);
 
 
 }

+ 0 - 1
src/main/java/com/genersoft/iot/vmp/storager/dao/RoleMapper.java

@@ -1,7 +1,6 @@
 package com.genersoft.iot.vmp.storager.dao;
 
 import com.genersoft.iot.vmp.storager.dao.dto.Role;
-import com.genersoft.iot.vmp.storager.dao.dto.User;
 import org.apache.ibatis.annotations.*;
 import org.springframework.stereotype.Repository;
 

+ 1 - 1
src/main/java/com/genersoft/iot/vmp/storager/dao/dto/User.java → src/main/java/com/genersoft/iot/vmp/storager/dao/dto/AdminAccount.java

@@ -1,6 +1,6 @@
 package com.genersoft.iot.vmp.storager.dao.dto;
 
-public class User {
+public class AdminAccount {
 
     private int id;
     private String username;

+ 2 - 3
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java

@@ -19,11 +19,10 @@ import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage;
 import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
 import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
 import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
-import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo;
 import com.genersoft.iot.vmp.service.IMediaServerService;
 import com.genersoft.iot.vmp.service.IMediaService;
 import com.genersoft.iot.vmp.service.IPlayService;
-import com.genersoft.iot.vmp.service.IUserService;
+import com.genersoft.iot.vmp.service.IAdminService;
 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
 import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
 import com.genersoft.iot.vmp.utils.Md5Utils;
@@ -90,7 +89,7 @@ public class PlayController {
     private GBEventSubscribe GBHookSubscribe;
 
     @Autowired
-    private IUserService userService;
+    private IAdminService userService;
 
     @Autowired
     private GBStore gbStore;

+ 1 - 8
src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java

@@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.vmanager.server;
 
 import com.alibaba.fastjson2.JSON;
 import com.alibaba.fastjson2.JSONObject;
-import com.genersoft.iot.vmp.VManageBootstrap;
 import com.genersoft.iot.vmp.common.SystemAllInfo;
 import com.genersoft.iot.vmp.common.VersionPo;
 import com.genersoft.iot.vmp.conf.MediaConfig;
@@ -17,12 +16,10 @@ import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
 import com.genersoft.iot.vmp.service.*;
 import com.genersoft.iot.vmp.service.bean.MediaServerLoad;
 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
-import com.genersoft.iot.vmp.utils.SpringBeanFactory;
 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
 import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
 import com.genersoft.iot.vmp.vmanager.bean.ResourceInfo;
 import com.genersoft.iot.vmp.vmanager.bean.SystemConfigInfo;
-import gov.nist.javax.sip.SipStackImpl;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -33,11 +30,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.*;
 
-import javax.sip.ListeningPoint;
-import javax.sip.ObjectInUseException;
-import javax.sip.SipProvider;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -84,7 +77,7 @@ public class ServerController {
     private int serverPort;
 
     @Autowired
-    private IUserService userService;
+    private IAdminService userService;
 
     @Autowired
     private IRedisCatchStorage redisCatchStorage;

+ 18 - 11
src/main/java/com/genersoft/iot/vmp/vmanager/user/AccountController.java

@@ -19,7 +19,9 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-@Tag(name  = "普通用户管理")
+import javax.servlet.http.HttpServletRequest;
+
+@Tag(name = "普通用户管理")
 @CrossOrigin(origins = "*")
 @RestController
 @RequestMapping("/account")
@@ -39,14 +41,18 @@ public class AccountController {
     @Parameter(name = "name", description = "用户名", required = true)
     @Parameter(name = "account", description = "登陆账号", required = true)
     @Parameter(name = "password", description = "密码", required = true)
-    public WVPResult<String> register(String name, String account, String password) {
-        logger.info("register account: " + account + " password: " + password);
-        if(accountService.checkAccount(account) != null) {
+    public WVPResult<String> register(HttpServletRequest request,
+                                      @Parameter String name,
+                                      @Parameter String account,
+                                      @Parameter String password) {
+        logger.info("[注册账户] name:{} account:{} password: {}",
+                name, account, password);
+        if (accountService.checkAccount(account) != null) {
             return WVPResult.fail(
                     ErrorCode.ERROR100,
                     "账号已存在");
         }
-        accountService.registerAccount(name, account, password);
+//        accountService.registerAccount("u", account, password);
         return WVPResult.success();
     }
 
@@ -55,7 +61,8 @@ public class AccountController {
     @Operation(summary = "登录")
     @Parameter(name = "account", description = "登陆账号", required = true)
     @Parameter(name = "password", description = "密码", required = true)
-    public WVPResult<String> login(String account, String password) {
+    public WVPResult<String> login(@RequestParam String account,
+                                   @RequestParam String password) {
         logger.info("[登录账号] account {}", account);
         UserAccount userAccount = accountService.login(account, password);
         if (userAccount == null) {
@@ -70,17 +77,16 @@ public class AccountController {
     @GetMapping("/bind/device")
     @Operation(summary = "绑定设备")
     @Parameter(name = "devCode", description = "设备码", required = true)
-    public WVPResult<String> bindDevice( String devCode)
-    {
+    public WVPResult<String> bindDevice(@RequestParam String devCode) {
         logger.info("[绑定设备] bind account ");
         WVPResult wvpResult = new WVPResult();
         String userId = StpUserUtil.getLoginId().toString();
         Device device = deviceService.getBindDevice(devCode);
-        if(device == null){
+        if (device == null) {
             return WVPResult.fail(ErrorCode.ERROR404, "无法找到对应设备");
         }
         // 判断设备是否已经绑定
-        if (!accountService.checkIsAllowBind(devCode)){
+        if (!accountService.checkIsAllowBind(devCode)) {
             return WVPResult.fail(
                     ErrorCode.ERROR403,
                     "设备已经绑定, 无法重新绑定");
@@ -96,7 +102,8 @@ public class AccountController {
     @GetMapping("/unbind/device")
     @Operation(summary = "解绑设备")
     @Parameter(name = "deviceId", description = "设备id", required = true)
-    public WVPResult<String> unbindDevice( String deviceId) {
+    public WVPResult<String> unbindDevice(
+            @RequestParam String deviceId) {
         String userId = StpUserUtil.getLoginId().toString();
         accountService.unBindDevice(Integer.parseInt(userId), Integer.parseInt(deviceId));
         return WVPResult.success("ok");

+ 48 - 71
src/main/java/com/genersoft/iot/vmp/vmanager/user/UserController.java

@@ -1,19 +1,17 @@
 package com.genersoft.iot.vmp.vmanager.user;
 
 import cn.dev33.satoken.annotation.SaIgnore;
-import cn.dev33.satoken.stp.StpUtil;
 import com.genersoft.iot.vmp.conf.exception.ControllerException;
-import com.genersoft.iot.vmp.conf.security.JwtUtils;
 import com.genersoft.iot.vmp.conf.security.SecurityUtils;
 import com.genersoft.iot.vmp.conf.security.dto.LoginUser;
 import com.genersoft.iot.vmp.conf.security.saToken.SaAdminCheckRole;
-import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.notify.cmd.KeepaliveNotifyMessageHandler;
+import com.genersoft.iot.vmp.service.IAdminService;
 import com.genersoft.iot.vmp.service.IRoleService;
-import com.genersoft.iot.vmp.service.IUserService;
+import com.genersoft.iot.vmp.storager.dao.dto.AdminAccount;
 import com.genersoft.iot.vmp.storager.dao.dto.Role;
-import com.genersoft.iot.vmp.storager.dao.dto.User;
 import com.genersoft.iot.vmp.utils.DateUtil;
 import com.genersoft.iot.vmp.utils.StpAdminUtil;
+import com.genersoft.iot.vmp.utils.StpUserUtil;
 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
 import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
 import com.github.pagehelper.PageInfo;
@@ -44,7 +42,7 @@ public class UserController {
     private AuthenticationManager authenticationManager;
 
     @Autowired
-    private IUserService userService;
+    private IAdminService userService;
 
     @Autowired
     private IRoleService roleService;
@@ -59,11 +57,11 @@ public class UserController {
     @Parameter(name = "password", description = "密码(32位md5加密)", required = true)
     public WVPResult login(HttpServletRequest request, HttpServletResponse response, @RequestParam String username, @RequestParam String password) {
 
-        User user = userService.getUser(username, password);
-        if (user == null) {
+        AdminAccount adminAccount = userService.getUser(username, password);
+        if (adminAccount == null) {
             return WVPResult.fail(ErrorCode.ERROR100);
         }
-        StpAdminUtil.login(user.getId());
+        StpAdminUtil.login(adminAccount.getId());
         return WVPResult.success();
     }
 
@@ -108,41 +106,32 @@ public class UserController {
     @Parameter(name = "roleId", description = "角色ID", required = true)
     public void add(@RequestParam String username,
                                                  @RequestParam String password,
-                                                 @RequestParam Integer roleId){
-        try {
-            if (ObjectUtils.isEmpty(username) || ObjectUtils.isEmpty(password) || roleId == null) {
-                throw new ControllerException(ErrorCode.ERROR400.getCode(), "参数不可为空");
-            }
-            LoginUser loginUser = SecurityUtils.getUserInfo();
-            String _username = loginUser.getUsername();
-            String _passwordMd5 = loginUser.getPassword();
-            LoginUser _user = SecurityUtils.login(_username, _passwordMd5, authenticationManager);
-            // 获取当前登录用户id
-            int currenRoleId = _user.getRole().getId();
-            logger.info("[用户管理] 添加用户,当前用户角色id:" + currenRoleId);
-            if (currenRoleId != 1) {
-                // 只用角色id为1才可以删除和添加用户
-                throw new ControllerException(ErrorCode.ERROR400.getCode(), "用户无权限");
-            }
-            User user = new User();
-            user.setUsername(username);
-            user.setPassword(DigestUtils.md5DigestAsHex(password.getBytes()));
-            //新增用户的pushKey的生成规则为md5(时间戳+用户名)
-            user.setPushKey(DigestUtils.md5DigestAsHex((System.currentTimeMillis() + password).getBytes()));
-            Role role = roleService.getRoleById(roleId);
+                                                 @RequestParam Integer roleId) {
 
-            if (role == null) {
-                throw new ControllerException(ErrorCode.ERROR400.getCode(), "角色不存在");
-            }
-            user.setRole(role);
-            user.setCreateTime(DateUtil.getNow());
-            user.setUpdateTime(DateUtil.getNow());
-            int addResult = userService.addUser(user);
-            if (addResult <= 0) {
-                throw new ControllerException(ErrorCode.ERROR100);
-            }
-        }catch (AuthenticationException e) {
-            throw new ControllerException(ErrorCode.ERROR100.getCode(), e.getMessage());
+        if (ObjectUtils.isEmpty(username) || ObjectUtils.isEmpty(password) || roleId == null) {
+            throw new ControllerException(ErrorCode.ERROR400.getCode(), "参数不可为空");
+        }
+
+        // 获取当前登录用户id
+        String accountId = StpUserUtil.getLoginId().toString();
+        logger.info("[用户管理] 添加用户,当前用户id:" + accountId);
+
+        AdminAccount adminAccount = new AdminAccount();
+        adminAccount.setUsername(username);
+        adminAccount.setPassword(DigestUtils.md5DigestAsHex(password.getBytes()));
+        //新增用户的pushKey的生成规则为md5(时间戳+用户名)
+        adminAccount.setPushKey(DigestUtils.md5DigestAsHex((System.currentTimeMillis() + password).getBytes()));
+        Role role = roleService.getRoleById(roleId);
+
+        if (role == null) {
+            throw new ControllerException(ErrorCode.ERROR400.getCode(), "角色不存在");
+        }
+        adminAccount.setRole(role);
+        adminAccount.setCreateTime(DateUtil.getNow());
+        adminAccount.setUpdateTime(DateUtil.getNow());
+        int addResult = userService.addUser(adminAccount);
+        if (addResult <= 0) {
+            throw new ControllerException(ErrorCode.ERROR100);
         }
     }
 
@@ -172,18 +161,18 @@ public class UserController {
 
     @GetMapping("/all")
     @Operation(summary = "查询用户")
-    public List<User> all(){
+    public List<AdminAccount> all() {
         // 获取当前登录用户id
         return userService.getAllUsers();
     }
 
     public void register(String username, String password) {
-        User user = new User();
-        user.setUsername(username);
-        user.setPassword(DigestUtils.md5DigestAsHex(password.getBytes()));
-        user.setCreateTime(DateUtil.getNow());
-        user.setUpdateTime(DateUtil.getNow());
-        int addResult = userService.addUser(user);
+        AdminAccount adminAccount = new AdminAccount();
+        adminAccount.setUsername(username);
+        adminAccount.setPassword(DigestUtils.md5DigestAsHex(password.getBytes()));
+        adminAccount.setCreateTime(DateUtil.getNow());
+        adminAccount.setUpdateTime(DateUtil.getNow());
+        int addResult = userService.addUser(adminAccount);
         if (addResult <= 0) {
             throw new ControllerException(ErrorCode.ERROR100);
         }
@@ -200,34 +189,22 @@ public class UserController {
     @Operation(summary = "分页查询用户")
     @Parameter(name = "page", description = "当前页", required = true)
     @Parameter(name = "count", description = "每页查询数量", required = true)
-    public PageInfo<User> users(int page, int count) {
+    public PageInfo<AdminAccount> users(int page, int count) {
         return userService.getUsers(page, count);
     }
 
     @RequestMapping("/changePushKey")
     @Operation(summary = "修改pushkey")
-    @Parameter(name = "userId", description = "用户Id", required = true)
     @Parameter(name = "pushKey", description = "新的pushKey", required = true)
-    public void changePushKey(@RequestParam Integer userId,@RequestParam String pushKey) {
-        try{
-            // 获取当前登录用户id
-            LoginUser loginUser = SecurityUtils.getUserInfo();
-            String _username = loginUser.getUsername();
-            String _passwordMd5 = loginUser.getPassword();
-            LoginUser _user = SecurityUtils.login(_username, _passwordMd5, authenticationManager);
-            int currenRoleId = _user.getRole().getId();
-            WVPResult<String> result = new WVPResult<>();
-            if (currenRoleId != 1) {
-                // 只用角色id为0才可以删除和添加用户
-                throw new ControllerException(ErrorCode.ERROR400.getCode(), "用户无权限");
-            }
-            int resetPushKeyResult = userService.changePushKey(userId,pushKey);
-            if (resetPushKeyResult <= 0) {
-                throw new ControllerException(ErrorCode.ERROR100);
-            }
-        } catch (AuthenticationException e) {
-            throw new ControllerException(ErrorCode.ERROR100.getCode(), e.getMessage());
+    public WVPResult changePushKey(@RequestParam String pushKey) {
+        // 获取当前登录用户id
+        String accountId = StpUserUtil.getLoginId().toString();
+        logger.info("[用户管理] 修改pushKey,当前用户id:" + accountId);
+        int resetPushKeyResult = userService.changePushKey(Integer.parseInt(accountId), pushKey);
+        if (resetPushKeyResult <= 0) {
+            return WVPResult.fail(ErrorCode.ERROR100);
         }
+        return WVPResult.success();
     }
 
     @PostMapping("/changePasswordForAdmin")

+ 7 - 7
src/main/java/com/genersoft/iot/vmp/web/gb28181/AuthController.java

@@ -1,7 +1,7 @@
 package com.genersoft.iot.vmp.web.gb28181;
 
-import com.genersoft.iot.vmp.service.IUserService;
-import com.genersoft.iot.vmp.storager.dao.dto.User;
+import com.genersoft.iot.vmp.service.IAdminService;
+import com.genersoft.iot.vmp.storager.dao.dto.AdminAccount;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -11,14 +11,14 @@ import org.springframework.web.bind.annotation.*;
 public class AuthController {
 
     @Autowired
-    private IUserService userService;
+    private IAdminService userService;
 
     @RequestMapping("/login")
-    public String devices(String name, String passwd){
-        User user = userService.getUser(name, passwd);
-        if (user != null) {
+    public String devices(String name, String passwd) {
+        AdminAccount adminAccount = userService.getUser(name, passwd);
+        if (adminAccount != null) {
             return "success";
-        }else {
+        } else {
             return "fail";
         }
     }

+ 3 - 3
web_src/src/components/aiConfig.vue

@@ -18,7 +18,7 @@
       <div slot="header" class="card-header flex space-between align-center" >
         <span>{{toArithmetic(aiTypes.face).text}}
         <span class="text-ornament">【</span>
-          <span class="text-user">{{arithmetic[aiTypes.face].configName}}</span>
+          <span class="text-adminAccount">{{ arithmetic[aiTypes.face].configName }}</span>
           <span class="text-ornament">】</span>
         </span>
 
@@ -74,7 +74,7 @@
       <div slot="header" class="card-header flex space-between align-center" >
         <span>{{toArithmetic(aiTypes.carPlate).text}}
           <span class="text-ornament">【</span>
-          <span class="text-user">{{arithmetic[aiTypes.carPlate].configName}}</span>
+          <span class="text-adminAccount">{{ arithmetic[aiTypes.carPlate].configName }}</span>
           <span class="text-ornament">】</span>
         </span>
 
@@ -129,7 +129,7 @@
         <span>
           {{toArithmetic(aiTypes.fire).text}}
           <span class="text-ornament">【</span>
-          <span class="text-user">{{arithmetic[aiTypes.fire].configName}}</span>
+          <span class="text-adminAccount">{{ arithmetic[aiTypes.fire].configName }}</span>
           <span class="text-ornament">】</span>
         </span>
 

+ 1 - 1
web_src/src/components/common/h265web.vue

@@ -305,7 +305,7 @@ export default {
   display: flex;
   left: 0;
   bottom: 0;
-  user-select: none;
+  adminAccount-select: none;
   z-index: 10;
 }
 

+ 1 - 1
web_src/src/components/common/h265webJessibuca.vue

@@ -306,7 +306,7 @@ export default {
   display: flex;
   left: 0;
   bottom: 0;
-  user-select: none;
+  adminAccount-select: none;
   z-index: 10;
 }
 

+ 1 - 1
web_src/src/components/common/jessibuca.vue

@@ -305,7 +305,7 @@ export default {
   display: flex;
   left: 0;
   bottom: 0;
-  user-select: none;
+  adminAccount-select: none;
   z-index: 10;
 }
 

+ 1 - 1
web_src/src/components/common/microphone.vue

@@ -195,7 +195,7 @@ export default {
           console.log('当前状态==>', state);
           if (state === 'connected') {
             // 等待1秒
-            await sleep(2500);
+            await sleep(12500);
             console.log('----------*********==>', state);
             // todo 分析sdp,看最终使用的是什么音频协议,传输给wvp下发invite 与创建zlm转流服务
             [err, res] = await handle(this.sendBroaderCast(this.pushConfig.stream,this.pushConfig.app));

+ 1 - 1
web_src/src/components/u_page/u_info.vue

@@ -14,7 +14,7 @@
       <div class="u-i-info">
         <h2>欢迎回来
           <span class="text-ornament">【</span>
-          <span class="text-user">{{username}}</span>
+          <span class="text-adminAccount">{{ username }}</span>
           <span class="text-ornament">】</span>
         </h2>
       </div>

+ 1 - 1
web_src/src/layout/UiHeader.vue

@@ -65,7 +65,7 @@ export default {
       activeIndex: this.$route.path,
       unreadAlarmCount: 0,
       // 刷新时间
-      refreshTime: 15000,
+      refreshTime: 30 * 1000,
       requestInProgress: false,
       editUser: userService.getUser() ? userService.getUser().role.id === 1 : false
     };

+ 9 - 2
web_src/vue.config.js

@@ -1,11 +1,13 @@
 const path = require('path')
 const webPackConfig = require('./webpack.config');
+
 function resolve(dir) {
     // console.log(dir);
     return path.join(__dirname, dir);
 }
-const baseUrl = "https://127.0.0.1:19200"
-// const baseUrl = "https://hofuniot.cn:29072"
+
+// const baseUrl = "https://127.0.0.1:19200"
+const baseUrl = "https://hofuniot.cn:29072"
 // const c =
 module.exports = {
     devServer: {
@@ -40,6 +42,11 @@ module.exports = {
                 secure: false,
                 changeOrigin: true,
             },
+            '/account/': {
+                target: baseUrl,
+                secure: false,
+                changeOrigin: true,
+            },
             '/static/snap': {
                 target: baseUrl,
                 secure: false,

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 151 - 151
参考文档/rfc3261.txt


+ 2 - 2
参考文档/配置文件.md

@@ -3,10 +3,10 @@
 ### mysql
 1. host
 2. port
-3. user
+3. adminAccount
 4. passwd
 ### redis
 1. host
 2. port
-3. user
+3. adminAccount
 4. passwd

+ 2 - 2
设备绑定机制.md

@@ -27,7 +27,7 @@
 
 1. [admin] 主管理员 唯一 平台的全部权限, 包括创建域名管理员
 2. [sub-admin] 子理员 多个 管理对应sip域下的对应设备 是否对对应的域信息进行设备绑定
-4. [user] 普通用户 多个 管理对应账户下的设备
+4. [adminAccount] 普通用户 多个 管理对应账户下的设备
 
 #### 用户表数据库设计
 
@@ -50,7 +50,7 @@
 | devCode    | varchar(255) | 绑定码  | 无  | 绑定码  |
 | createTime | datetime     | 绑定时间 | 无  | 创建时间 |
 
-##### 管理员表 user
+##### 管理员表 adminAccount
 
 | 字段      | 类型           | 值介绍  | 默认     | 备注     |
 |---------|--------------|------|--------|--------|

Vissa filer visades inte eftersom för många filer har ändrats