创建新的小程序,进出码,体温上报功能迁移基本完成
5
TODOs.md
@ -1,8 +1,11 @@
|
|||||||
启动 Nacos
|
# 启动 Nacos
|
||||||
E:
|
E:
|
||||||
cd E:\nacos\bin
|
cd E:\nacos\bin
|
||||||
startup.cmd -m standalone
|
startup.cmd -m standalone
|
||||||
|
|
||||||
|
# 内网穿透
|
||||||
|
cd E:\Project\毕业设计\epp\intranet-penetration\bin
|
||||||
|
rathole.exe ../conf/client.toml
|
||||||
-----
|
-----
|
||||||
|
|
||||||
Nacos CPU 跑满问题 我提的 GitHub issue
|
Nacos CPU 跑满问题 我提的 GitHub issue
|
||||||
|
@ -82,6 +82,12 @@
|
|||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 密码 Hash 加密 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-codec</groupId>
|
||||||
|
<artifactId>commons-codec</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 热部署 -->
|
<!-- 热部署 -->
|
||||||
<!--<dependency>-->
|
<!--<dependency>-->
|
||||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||||
|
@ -4,6 +4,7 @@ import com.cxyxiaomo.epp.common.pojo.User;
|
|||||||
import com.cxyxiaomo.epp.common.response.Res;
|
import com.cxyxiaomo.epp.common.response.Res;
|
||||||
import com.cxyxiaomo.epp.common.vo.UserVO;
|
import com.cxyxiaomo.epp.common.vo.UserVO;
|
||||||
import com.cxyxiaomo.epp.user.service.UserServiceImpl;
|
import com.cxyxiaomo.epp.user.service.UserServiceImpl;
|
||||||
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@ -32,8 +33,8 @@ public class UserController {
|
|||||||
public Res login(@RequestParam("username") String username, @RequestParam("password") String password) {
|
public Res login(@RequestParam("username") String username, @RequestParam("password") String password) {
|
||||||
User user = userService.getUserByUsername(username);
|
User user = userService.getUserByUsername(username);
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
String passwordHash = user.getPassword();
|
String passwordHash = DigestUtils.sha512Hex(password);
|
||||||
if (passwordHash.equals(password)) {
|
if (passwordHash.equals(user.getPassword())) {
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
map.put("userInfo", UserVO.convertFrom(user));
|
map.put("userInfo", UserVO.convertFrom(user));
|
||||||
return Res.success(map);
|
return Res.success(map);
|
||||||
|
@ -158,6 +158,13 @@
|
|||||||
<version>${jackson.version}</version>
|
<version>${jackson.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 密码 Hash 加密 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-codec</groupId>
|
||||||
|
<artifactId>commons-codec</artifactId>
|
||||||
|
<version>1.15</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Log -->
|
<!-- Log -->
|
||||||
<!-- log4j -->
|
<!-- log4j -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
543
database/epp.sql
@ -1,272 +1,271 @@
|
|||||||
/*
|
/*
|
||||||
Navicat Premium Data Transfer
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
Source Server : localhost MySQL 8.0
|
Source Server : 192.168.2.29 测试库(装Nacos的Ubuntu)
|
||||||
Source Server Type : MySQL
|
Source Server Type : MySQL
|
||||||
Source Server Version : 80012
|
Source Server Version : 80032
|
||||||
Source Host : localhost:3306
|
Source Host : 192.168.2.29:3306
|
||||||
Source Schema : epp
|
Source Schema : epp
|
||||||
|
|
||||||
Target Server Type : MySQL
|
Target Server Type : MySQL
|
||||||
Target Server Version : 80012
|
Target Server Version : 80032
|
||||||
File Encoding : 65001
|
File Encoding : 65001
|
||||||
|
|
||||||
Date: 15/03/2023 15:55:32
|
Date: 17/03/2023 02:12:17
|
||||||
*/
|
*/
|
||||||
|
|
||||||
SET NAMES utf8mb4;
|
SET NAMES utf8mb4;
|
||||||
SET FOREIGN_KEY_CHECKS = 0;
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for apply1
|
-- Table structure for apply1
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
DROP TABLE IF EXISTS `apply1`;
|
DROP TABLE IF EXISTS `apply1`;
|
||||||
CREATE TABLE `apply1` (
|
CREATE TABLE `apply1` (
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`stu_id` int(11) NULL DEFAULT NULL COMMENT '用户id',
|
`stu_id` int NULL DEFAULT NULL COMMENT '用户id',
|
||||||
`issue` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '申请事由',
|
`issue` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '申请事由',
|
||||||
`transport` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '出行方式',
|
`transport` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '出行方式',
|
||||||
`place` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目的地',
|
`place` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '目的地',
|
||||||
`start_time` datetime NULL DEFAULT NULL COMMENT '开始时间',
|
`start_time` datetime NULL DEFAULT NULL COMMENT '开始时间',
|
||||||
`end_time` datetime NULL DEFAULT NULL COMMENT '结束时间',
|
`end_time` datetime NULL DEFAULT NULL COMMENT '结束时间',
|
||||||
`state` int(11) NULL DEFAULT 0 COMMENT '状态(0:审批中,1:通过,2:驳回)',
|
`state` int NULL DEFAULT 0 COMMENT '状态(0:审批中,1:通过,2:驳回)',
|
||||||
`reason` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '驳回原因',
|
`reason` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '驳回原因',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of apply1
|
-- Records of apply1
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
INSERT INTO `apply1` VALUES (1, 1, '11', '飞机', '33', '2022-02-15 11:20:00', '2022-02-15 13:20:00', 2, '格式错误');
|
INSERT INTO `apply1` VALUES (1, 1, '11', '飞机', '33', '2022-02-15 11:20:00', '2022-02-15 13:20:00', 2, '格式错误');
|
||||||
INSERT INTO `apply1` VALUES (2, 2, '333', '大巴', '333', '2022-02-15 11:51:00', '2022-02-15 13:51:00', 1, '');
|
INSERT INTO `apply1` VALUES (2, 2, '333', '大巴', '333', '2022-02-15 11:51:00', '2022-02-15 13:51:00', 1, '');
|
||||||
INSERT INTO `apply1` VALUES (3, 2, '333', '大巴', '333', '2022-02-15 11:51:00', '2022-02-15 13:51:00', 2, '格式错误');
|
INSERT INTO `apply1` VALUES (3, 2, '333', '大巴', '333', '2022-02-15 11:51:00', '2022-02-15 13:51:00', 2, '格式错误');
|
||||||
INSERT INTO `apply1` VALUES (4, 2, '1', '动车', '2', '2022-03-12 13:45:00', '2022-03-12 15:45:00', 1, '');
|
INSERT INTO `apply1` VALUES (4, 2, '1', '动车', '2', '2022-03-12 13:45:00', '2022-03-12 15:45:00', 1, '');
|
||||||
INSERT INTO `apply1` VALUES (5, 2, '11', '飞机', '22', '2022-03-12 20:29:00', '2022-03-12 22:29:00', 1, '');
|
INSERT INTO `apply1` VALUES (5, 2, '11', '飞机', '22', '2022-03-12 20:29:00', '2022-03-12 22:29:00', 1, '');
|
||||||
INSERT INTO `apply1` VALUES (6, 1, '123', '飞机', '123', '2022-03-19 13:37:00', '2022-03-19 15:37:00', 1, '');
|
INSERT INTO `apply1` VALUES (6, 1, '123', '飞机', '123', '2022-03-19 13:37:00', '2022-03-19 15:37:00', 1, '');
|
||||||
INSERT INTO `apply1` VALUES (9, 10, '1', '飞机', '1', '2022-06-15 10:41:00', '2022-06-15 12:41:00', 1, '');
|
INSERT INTO `apply1` VALUES (9, 10, '1', '飞机', '1', '2022-06-15 10:41:00', '2022-06-15 12:41:00', 1, '');
|
||||||
INSERT INTO `apply1` VALUES (10, 12, '1', '飞机', '1', '2022-06-15 10:53:00', '2022-06-15 12:53:00', 2, '格式错误');
|
INSERT INTO `apply1` VALUES (10, 12, '1', '飞机', '1', '2022-06-15 10:53:00', '2022-06-15 12:53:00', 2, '格式错误');
|
||||||
INSERT INTO `apply1` VALUES (11, 2, '1', '飞机', '1', '2022-10-23 16:17:00', '2022-10-23 18:17:00', 1, '');
|
INSERT INTO `apply1` VALUES (11, 2, '1', '飞机', '1', '2022-10-23 16:17:00', '2022-10-23 18:17:00', 1, '');
|
||||||
INSERT INTO `apply1` VALUES (12, 13, '1', '飞机', '1', '2022-10-26 19:25:00', '2022-10-26 21:25:00', 1, '');
|
INSERT INTO `apply1` VALUES (12, 13, '1', '飞机', '1', '2022-10-26 19:25:00', '2022-10-26 21:25:00', 1, '');
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for count1
|
-- Table structure for count1
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
DROP TABLE IF EXISTS `count1`;
|
DROP TABLE IF EXISTS `count1`;
|
||||||
CREATE TABLE `count1` (
|
CREATE TABLE `count1` (
|
||||||
`date` date NOT NULL COMMENT '日期',
|
`date` date NOT NULL COMMENT '日期',
|
||||||
`time` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '时间',
|
`time` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '时间',
|
||||||
`in_num` int(11) NULL DEFAULT NULL COMMENT '入校人数',
|
`in_num` int NULL DEFAULT NULL COMMENT '入校人数',
|
||||||
`out_num` int(11) NULL DEFAULT NULL COMMENT '出校人数',
|
`out_num` int NULL DEFAULT NULL COMMENT '出校人数',
|
||||||
PRIMARY KEY (`date`) USING BTREE
|
PRIMARY KEY (`date`) USING BTREE
|
||||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of count1
|
-- Records of count1
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for feedback1
|
-- Table structure for feedback1
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
DROP TABLE IF EXISTS `feedback1`;
|
DROP TABLE IF EXISTS `feedback1`;
|
||||||
CREATE TABLE `feedback1` (
|
CREATE TABLE `feedback1` (
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '反馈标题',
|
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '反馈标题',
|
||||||
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '反馈内容',
|
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '反馈内容',
|
||||||
`time` datetime NULL DEFAULT NULL COMMENT '反馈时间',
|
`time` datetime NULL DEFAULT NULL COMMENT '反馈时间',
|
||||||
`user_id` int(11) NULL DEFAULT NULL COMMENT '反馈用户id',
|
`user_id` int NULL DEFAULT NULL COMMENT '反馈用户id',
|
||||||
`reply` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '回复',
|
`reply` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '回复',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of feedback1
|
-- Records of feedback1
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
INSERT INTO `feedback1` VALUES (1, '111', '222', '2022-02-14 10:18:29', 1, '22');
|
INSERT INTO `feedback1` VALUES (1, '111', '222', '2022-02-14 10:18:29', 1, '22');
|
||||||
INSERT INTO `feedback1` VALUES (2, '111', '222', '2022-02-14 10:20:05', 1, '33');
|
INSERT INTO `feedback1` VALUES (2, '111', '222', '2022-02-14 10:20:05', 1, '33');
|
||||||
INSERT INTO `feedback1` VALUES (3, '22', '33', '2022-02-14 10:20:29', 1, 'no');
|
INSERT INTO `feedback1` VALUES (3, '22', '33', '2022-02-14 10:20:29', 1, 'no');
|
||||||
INSERT INTO `feedback1` VALUES (4, '``', '11', '2022-02-14 10:22:12', 1, '111');
|
INSERT INTO `feedback1` VALUES (4, '``', '11', '2022-02-14 10:22:12', 1, '111');
|
||||||
INSERT INTO `feedback1` VALUES (5, '123', '123456', '2022-03-28 19:34:04', 2, NULL);
|
INSERT INTO `feedback1` VALUES (5, '123', '123456', '2022-03-28 19:34:04', 2, NULL);
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for goods
|
-- Table structure for goods
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
DROP TABLE IF EXISTS `goods`;
|
DROP TABLE IF EXISTS `goods`;
|
||||||
CREATE TABLE `goods` (
|
CREATE TABLE `goods` (
|
||||||
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
`goods_name` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '商品名称',
|
`goods_name` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '商品名称',
|
||||||
`category_id` int(11) NULL DEFAULT 0 COMMENT '商品所属类目ID',
|
`category_id` int NULL DEFAULT 0 COMMENT '商品所属类目ID',
|
||||||
`brand` int(11) NULL DEFAULT 0 COMMENT '商品品牌',
|
`brand` int NULL DEFAULT 0 COMMENT '商品品牌',
|
||||||
`gallery` varchar(1023) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '商品宣传图片列表,采用JSON数组格式',
|
`gallery` varchar(1023) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '商品宣传图片列表,采用JSON数组格式',
|
||||||
`brief` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '商品简介',
|
`brief` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '商品简介',
|
||||||
`is_on_sale` tinyint(1) NULL DEFAULT 1 COMMENT '是否上架',
|
`is_on_sale` tinyint(1) NULL DEFAULT 1 COMMENT '是否上架',
|
||||||
`sort_order` smallint(4) NULL DEFAULT 100 COMMENT '排序',
|
`sort_order` smallint NULL DEFAULT 100 COMMENT '排序',
|
||||||
`pic_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '商品页面商品图片',
|
`pic_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '商品页面商品图片',
|
||||||
`type` tinyint(1) NULL DEFAULT 0 COMMENT '商品类型',
|
`type` tinyint(1) NULL DEFAULT 0 COMMENT '商品类型',
|
||||||
`unit` varchar(31) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '’件‘' COMMENT '商品单位,例如件、盒',
|
`unit` varchar(31) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '’件‘' COMMENT '商品单位,例如件、盒',
|
||||||
`counter_price` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '专柜价格',
|
`counter_price` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '专柜价格',
|
||||||
`retail_price` decimal(10, 2) NULL DEFAULT 100000.00 COMMENT '零售价格',
|
`retail_price` decimal(10, 2) NULL DEFAULT 100000.00 COMMENT '零售价格',
|
||||||
`detail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '商品详细介绍,是富文本格式',
|
`detail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '商品详细介绍,是富文本格式',
|
||||||
`deleted` tinyint(1) NULL DEFAULT 0 COMMENT '逻辑删除 0为正常 1为删除',
|
`deleted` tinyint(1) NULL DEFAULT 0 COMMENT '逻辑删除 0为正常 1为删除',
|
||||||
PRIMARY KEY (`id`) USING BTREE,
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
INDEX `category_id`(`category_id`) USING BTREE,
|
INDEX `category_id`(`category_id`) USING BTREE,
|
||||||
INDEX `brand_id`(`brand`) USING BTREE,
|
INDEX `brand_id`(`brand`) USING BTREE,
|
||||||
INDEX `sort_order`(`sort_order`) USING BTREE
|
INDEX `sort_order`(`sort_order`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品基本信息表' ROW_FORMAT = Dynamic;
|
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '商品基本信息表' ROW_FORMAT = DYNAMIC;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of goods
|
-- Records of goods
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
INSERT INTO `goods` VALUES (1, '口罩', 0, 0, NULL, NULL, 1, 100, NULL, 0, '’件‘', 0.00, 100000.00, NULL, 0);
|
INSERT INTO `goods` VALUES (1, '口罩', 0, 0, NULL, NULL, 1, 100, NULL, 0, '’件‘', 0.00, 100000.00, NULL, 0);
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for goods_category
|
-- Table structure for goods_category
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
DROP TABLE IF EXISTS `goods_category`;
|
DROP TABLE IF EXISTS `goods_category`;
|
||||||
CREATE TABLE `goods_category` (
|
CREATE TABLE `goods_category` (
|
||||||
`id` int(11) NOT NULL,
|
`id` int NOT NULL,
|
||||||
`category_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '商品分类名',
|
`category_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '商品分类名',
|
||||||
`order` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '排序',
|
`order` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '排序',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of goods_category
|
-- Records of goods_category
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for notice1
|
-- Table structure for notice1
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
DROP TABLE IF EXISTS `notice1`;
|
DROP TABLE IF EXISTS `notice1`;
|
||||||
CREATE TABLE `notice1` (
|
CREATE TABLE `notice1` (
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标题',
|
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标题',
|
||||||
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '内容',
|
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '内容',
|
||||||
`time` date NULL DEFAULT NULL COMMENT '时间',
|
`time` date NULL DEFAULT NULL COMMENT '时间',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of notice1
|
-- Records of notice1
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
INSERT INTO `notice1` VALUES (1, '请各位学生戴好口罩', NULL, '2022-03-15');
|
INSERT INTO `notice1` VALUES (1, '请各位学生戴好口罩', NULL, '2022-03-15');
|
||||||
INSERT INTO `notice1` VALUES (2, '请各位学生不要随意出入校门', NULL, '2022-03-15');
|
INSERT INTO `notice1` VALUES (2, '请各位学生不要随意出入校门', NULL, '2022-03-15');
|
||||||
INSERT INTO `notice1` VALUES (7, '11', '22', '2022-03-22');
|
INSERT INTO `notice1` VALUES (7, '11', '22', '2022-03-22');
|
||||||
INSERT INTO `notice1` VALUES (8, '22', '22', '2022-04-14');
|
INSERT INTO `notice1` VALUES (8, '22', '22', '2022-04-14');
|
||||||
INSERT INTO `notice1` VALUES (9, '33', '33', '2022-04-14');
|
INSERT INTO `notice1` VALUES (9, '33', '33', '2022-04-14');
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for report
|
-- Table structure for report
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
DROP TABLE IF EXISTS `report`;
|
DROP TABLE IF EXISTS `report`;
|
||||||
CREATE TABLE `report` (
|
CREATE TABLE `report` (
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`user_id` int(11) NULL DEFAULT NULL COMMENT '用户id',
|
`user_id` int NULL DEFAULT NULL COMMENT '用户id',
|
||||||
`name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '姓名',
|
`name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '姓名',
|
||||||
`time` datetime NULL DEFAULT NULL COMMENT '填报时间',
|
`time` datetime NULL DEFAULT NULL COMMENT '填报时间',
|
||||||
`temperature` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '体温是否正常',
|
`temperature` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '体温是否正常',
|
||||||
`address` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址',
|
`address` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '地址',
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 58 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
) ENGINE = InnoDB AUTO_INCREMENT = 58 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of report
|
-- Records of report
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
INSERT INTO `report` VALUES (53, 1, '管理员 密码root', '2022-12-26 20:35:38', '1', '湖北省武汉市洪山区文治街南湖雅园(洪山区信访局对面)');
|
INSERT INTO `report` VALUES (53, 1, '管理员 密码root', '2022-12-26 20:35:38', '1', '湖北省武汉市洪山区文治街南湖雅园(洪山区信访局对面)');
|
||||||
INSERT INTO `report` VALUES (55, 1, '管理员 密码root', '2022-12-27 21:03:24', '0', '湖北省武汉市洪山区文治街508号南湖雅园F栋2-104号');
|
INSERT INTO `report` VALUES (55, 1, '管理员 密码root', '2022-12-27 21:03:24', '0', '湖北省武汉市洪山区文治街508号南湖雅园F栋2-104号');
|
||||||
INSERT INTO `report` VALUES (57, 1, '管理员 密码root', '2022-12-28 21:47:57', '0', '湖北省武汉市洪山区文治街南湖雅园(洪山区信访局对面)');
|
INSERT INTO `report` VALUES (57, 1, '管理员 密码root', '2022-12-28 21:47:57', '0', '湖北省武汉市洪山区文治街南湖雅园(洪山区信访局对面)');
|
||||||
INSERT INTO `report` VALUES (58, 1, '管理员 密码root', '2022-12-29 18:20:00', '1', '湖北省武汉市洪山区鲁磨路209号');
|
INSERT INTO `report` VALUES (58, 1, '管理员 密码root', '2022-12-29 18:20:00', '1', '湖北省武汉市洪山区鲁磨路209号');
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Table structure for setting
|
-- Table structure for setting
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
DROP TABLE IF EXISTS `setting`;
|
DROP TABLE IF EXISTS `setting`;
|
||||||
CREATE TABLE `setting` (
|
CREATE TABLE `setting` (
|
||||||
`key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
|
`key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
`value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
|
`value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
`time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间或失效时间(具体根据key来判断)',
|
`time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间或失效时间(具体根据key来判断)',
|
||||||
UNIQUE INDEX `key`(`key`) USING BTREE
|
UNIQUE INDEX `key`(`key`) USING BTREE
|
||||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = DYNAMIC;
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of setting
|
-- Records of setting
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
INSERT INTO `setting` VALUES ('wechat_access_token', '66_sC2-1ygooBWjbLaEz2-or6IGqFs76UvUnRIpxXo_rJqw2BS45J_X128_xks1ekQPvF6LK22AcfA6d7OmcBWeulrRhUFNO3MPaog-_u-TqJxQ6XoRUPN9iUWR0Y8HQWiAGAUDJ', '2023-03-07 01:19:44');
|
|
||||||
|
-- ----------------------------
|
||||||
-- ----------------------------
|
-- Table structure for user
|
||||||
-- Table structure for user
|
-- ----------------------------
|
||||||
-- ----------------------------
|
DROP TABLE IF EXISTS `user`;
|
||||||
DROP TABLE IF EXISTS `user`;
|
CREATE TABLE `user` (
|
||||||
CREATE TABLE `user` (
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
`username` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名',
|
||||||
`username` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名',
|
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码',
|
||||||
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码',
|
`realname` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '真实姓名',
|
||||||
`realname` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '真实姓名',
|
`id_number` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '身份证号',
|
||||||
`id_number` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '身份证号',
|
`phone_number` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号',
|
||||||
`phone_number` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号',
|
`role` int NOT NULL COMMENT '角色 (0-超级管理员 1-工作人员 2-社区居民_房主 3-社区居民_家庭成员 4-社区居民_租客 5-访客)',
|
||||||
`role` int(11) NOT NULL COMMENT '角色 (0-超级管理员 1-工作人员 2-社区居民_房主 3-社区居民_家庭成员 4-社区居民_租客 5-访客)',
|
`building_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '门栋号+单元号',
|
||||||
`building_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '门栋号+单元号',
|
`doorplate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '门牌号',
|
||||||
`doorplate` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '门牌号',
|
`permission` int NOT NULL DEFAULT 0 COMMENT '进出权限 (0-无 1-继承(普通居民) 2-永久 3-限时)',
|
||||||
`permission` int(11) NOT NULL DEFAULT 0 COMMENT '进出权限 (0-无 1-继承(普通居民) 2-永久 3-限时)',
|
`permission_time` datetime NULL DEFAULT NULL COMMENT '进出权限失效时间',
|
||||||
`permission_time` datetime NULL DEFAULT NULL COMMENT '进出权限失效时间',
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
||||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
|
||||||
|
-- ----------------------------
|
||||||
-- ----------------------------
|
-- Records of user
|
||||||
-- Records of user
|
-- ----------------------------
|
||||||
-- ----------------------------
|
INSERT INTO `user` VALUES (1, 'root', '99adc231b045331e514a516b4b7680f588e3823213abe901738bc3ad67b2f6fcb3c64efb93d18002588d3ccc1a49efbae1ce20cb43df36b38651f11fa75678e8', '管理员 密码root', '420111111111111111', NULL, 1, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (1, 'root', '63a9f0ea7bb98050796b649e85481845', '管理员 密码root', '420111111111111111', NULL, 1, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (2, 'lhz', 'lhz', '廖鸿志', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (2, 'lhz', 'lhz', '廖鸿志', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (3, '21180000', '21180000', '李', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (3, '21180000', '21180000', '李', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (4, '211', '211', '11', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (4, '211', '211', '11', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (5, '2111', '2111', '111', NULL, NULL, 1, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (5, '2111', '2111', '111', NULL, NULL, 1, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (6, '222', '222', '33', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (6, '222', '222', '33', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (7, '33', '33', '44', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (7, '33', '33', '44', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (8, 'test', '1', 'test', NULL, NULL, 3, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (8, 'test', '1', 'test', NULL, NULL, 3, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (9, '123456', '123456', '123456', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (9, '123456', '123456', '123456', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (10, '211806336', '211806336', '211806336', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (10, '211806336', '211806336', '211806336', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (11, '001', '001', '老师', NULL, NULL, 1, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (11, '001', '001', '老师', NULL, NULL, 1, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (12, '002', '002', '刘鸿宇', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (12, '002', '002', '刘鸿宇', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (13, 'z', 'zz', 'z', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (13, 'z', 'zz', 'z', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (14, '111', '222', '222', NULL, NULL, 222, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (14, '111', '222', '222', NULL, NULL, 222, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (15, '222', '222', '222', NULL, NULL, 222, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (15, '222', '222', '222', NULL, NULL, 222, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (16, '222', '222', '222', NULL, NULL, 222, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (16, '222', '222', '222', NULL, NULL, 222, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (17, '111111111111', '111111111111', '111111111111', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (17, '111111111111', '111111111111', '111111111111', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (18, '12', '12', '12', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (18, '12', '12', '12', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (19, '210602212109', '210602212109', '曾子华', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (19, '210602212109', '210602212109', '曾子华', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (20, 'undefined', 'undefined', '信息2121', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (20, 'undefined', 'undefined', '信息2121', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
INSERT INTO `user` VALUES (21, '2', '2', '曾', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
||||||
INSERT INTO `user` VALUES (21, '2', '2', '曾', NULL, NULL, 2, NULL, NULL, 0, NULL);
|
|
||||||
|
-- ----------------------------
|
||||||
-- ----------------------------
|
-- Table structure for visitor1
|
||||||
-- Table structure for visitor1
|
-- ----------------------------
|
||||||
-- ----------------------------
|
DROP TABLE IF EXISTS `visitor1`;
|
||||||
DROP TABLE IF EXISTS `visitor1`;
|
CREATE TABLE `visitor1` (
|
||||||
CREATE TABLE `visitor1` (
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
`time` datetime NULL DEFAULT NULL COMMENT '预约时间',
|
||||||
`time` datetime NULL DEFAULT NULL COMMENT '预约时间',
|
`phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预约用户id',
|
||||||
`phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预约用户id',
|
`issue` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预约事由',
|
||||||
`issue` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预约事由',
|
`meet_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '会见人姓名',
|
||||||
`meet_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '会见人姓名',
|
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
`state` int NULL DEFAULT 0 COMMENT '状态(0:审批中,1:成功,2:驳回)',
|
||||||
`state` int(11) NULL DEFAULT 0 COMMENT '状态(0:审批中,1:成功,2:驳回)',
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
PRIMARY KEY (`id`) USING BTREE
|
) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
||||||
) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
|
|
||||||
|
-- ----------------------------
|
||||||
-- ----------------------------
|
-- Records of visitor1
|
||||||
-- Records of visitor1
|
-- ----------------------------
|
||||||
-- ----------------------------
|
INSERT INTO `visitor1` VALUES (1, '2022-03-09 09:46:50', '136', NULL, NULL, NULL, 1);
|
||||||
INSERT INTO `visitor1` VALUES (1, '2022-03-09 09:46:50', '136', NULL, NULL, NULL, 1);
|
INSERT INTO `visitor1` VALUES (2, '2022-03-09 00:00:00', '1', '2', '王老师', NULL, 1);
|
||||||
INSERT INTO `visitor1` VALUES (2, '2022-03-09 00:00:00', '1', '2', '王老师', NULL, 1);
|
INSERT INTO `visitor1` VALUES (3, '2022-03-13 00:00:00', '123', '123', '123', NULL, 1);
|
||||||
INSERT INTO `visitor1` VALUES (3, '2022-03-13 00:00:00', '123', '123', '123', NULL, 1);
|
INSERT INTO `visitor1` VALUES (4, '2022-03-17 00:00:00', '183', '11', '1111', NULL, 1);
|
||||||
INSERT INTO `visitor1` VALUES (4, '2022-03-17 00:00:00', '183', '11', '1111', NULL, 1);
|
INSERT INTO `visitor1` VALUES (5, '2022-03-20 07:00:00', '15555150781', '测试', '王德发', NULL, 1);
|
||||||
INSERT INTO `visitor1` VALUES (5, '2022-03-20 07:00:00', '15555150781', '测试', '王德发', NULL, 1);
|
INSERT INTO `visitor1` VALUES (6, '2022-03-20 07:00:00', '15555150782', '测试', '王德发', NULL, 1);
|
||||||
INSERT INTO `visitor1` VALUES (6, '2022-03-20 07:00:00', '15555150782', '测试', '王德发', NULL, 1);
|
INSERT INTO `visitor1` VALUES (7, '2022-03-20 00:00:00', '12345', '返校', '自己', NULL, 1);
|
||||||
INSERT INTO `visitor1` VALUES (7, '2022-03-20 00:00:00', '12345', '返校', '自己', NULL, 1);
|
INSERT INTO `visitor1` VALUES (8, '2022-03-21 00:00:00', '1', '1', '1', NULL, 1);
|
||||||
INSERT INTO `visitor1` VALUES (8, '2022-03-21 00:00:00', '1', '1', '1', NULL, 1);
|
INSERT INTO `visitor1` VALUES (9, '2022-03-22 00:00:00', '11', '11', '1', NULL, 1);
|
||||||
INSERT INTO `visitor1` VALUES (9, '2022-03-22 00:00:00', '11', '11', '1', NULL, 1);
|
INSERT INTO `visitor1` VALUES (10, '2022-03-22 00:00:00', '183', '1', '123', NULL, 1);
|
||||||
INSERT INTO `visitor1` VALUES (10, '2022-03-22 00:00:00', '183', '1', '123', NULL, 1);
|
INSERT INTO `visitor1` VALUES (11, '2022-04-20 00:00:00', '19851691582', '看吧', '哈哈', NULL, 0);
|
||||||
INSERT INTO `visitor1` VALUES (11, '2022-04-20 00:00:00', '19851691582', '看吧', '哈哈', NULL, 0);
|
INSERT INTO `visitor1` VALUES (12, '2022-04-26 00:00:00', '18835381168', 'jin', 'zhang ', NULL, 0);
|
||||||
INSERT INTO `visitor1` VALUES (12, '2022-04-26 00:00:00', '18835381168', 'jin', 'zhang ', NULL, 0);
|
INSERT INTO `visitor1` VALUES (13, '2022-06-15 00:00:00', '18250314786', '1', '1', NULL, 1);
|
||||||
INSERT INTO `visitor1` VALUES (13, '2022-06-15 00:00:00', '18250314786', '1', '1', NULL, 1);
|
INSERT INTO `visitor1` VALUES (14, '2022-10-08 00:00:00', '151000', '入校', '王龙', NULL, 0);
|
||||||
INSERT INTO `visitor1` VALUES (14, '2022-10-08 00:00:00', '151000', '入校', '王龙', NULL, 0);
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
SET FOREIGN_KEY_CHECKS = 1;
|
|
||||||
|
@ -88,7 +88,6 @@ export default {
|
|||||||
|
|
||||||
onHide() {
|
onHide() {
|
||||||
console.log('onHide')
|
console.log('onHide')
|
||||||
clearInterval(this.timeInterval)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
31
weixin-miniprogram/.eslintrc.js
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Eslint config file
|
||||||
|
* Documentation: https://eslint.org/docs/user-guide/configuring/
|
||||||
|
* Install the Eslint extension before using this feature.
|
||||||
|
*/
|
||||||
|
module.exports = {
|
||||||
|
env: {
|
||||||
|
es6: true,
|
||||||
|
browser: true,
|
||||||
|
node: true,
|
||||||
|
},
|
||||||
|
ecmaFeatures: {
|
||||||
|
modules: true,
|
||||||
|
},
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 2018,
|
||||||
|
sourceType: 'module',
|
||||||
|
},
|
||||||
|
globals: {
|
||||||
|
wx: true,
|
||||||
|
App: true,
|
||||||
|
Page: true,
|
||||||
|
getCurrentPages: true,
|
||||||
|
getApp: true,
|
||||||
|
Component: true,
|
||||||
|
requirePlugin: true,
|
||||||
|
requireMiniProgram: true,
|
||||||
|
},
|
||||||
|
// extends: 'eslint:recommended',
|
||||||
|
rules: {},
|
||||||
|
}
|
23
weixin-miniprogram/app.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// app.js
|
||||||
|
App({
|
||||||
|
onLaunch() {
|
||||||
|
// 展示本地存储能力
|
||||||
|
const logs = wx.getStorageSync('logs') || []
|
||||||
|
logs.unshift(Date.now())
|
||||||
|
wx.setStorageSync('logs', logs)
|
||||||
|
|
||||||
|
// 登录
|
||||||
|
wx.login({
|
||||||
|
success: res => {
|
||||||
|
// 发送 res.code 到后台换取 openId, sessionKey, unionId
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
globalData: {
|
||||||
|
debugMode: true, // 是否展示调试内容
|
||||||
|
baseUrl: true ? // Api 请求域名 不带最后的 /
|
||||||
|
"https://epp.only4.work" :
|
||||||
|
"http://localhost",
|
||||||
|
userInfo: null
|
||||||
|
}
|
||||||
|
})
|
61
weixin-miniprogram/app.json
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"pages": [
|
||||||
|
"pages/index/index",
|
||||||
|
"pages/index2/index",
|
||||||
|
"pages/logs/logs",
|
||||||
|
"pages/residents/code",
|
||||||
|
"pages/residents/report",
|
||||||
|
"pages/index/login",
|
||||||
|
"pages/scan/entrance",
|
||||||
|
"pages/person/person",
|
||||||
|
"pages/residents/reportHistory"
|
||||||
|
],
|
||||||
|
"window": {
|
||||||
|
"backgroundTextStyle": "dark",
|
||||||
|
"navigationBarBackgroundColor": "#000",
|
||||||
|
"navigationBarTitleText": "Weixin",
|
||||||
|
"navigationBarTextStyle": "white"
|
||||||
|
},
|
||||||
|
"tabBar": {
|
||||||
|
"custom": false,
|
||||||
|
"color": "#000000",
|
||||||
|
"backgroundColor": "#fff",
|
||||||
|
"selectedColor": "#FF8966",
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"pagePath": "pages/index/index",
|
||||||
|
"text": "首页",
|
||||||
|
"iconPath": "image/icon/_home.png",
|
||||||
|
"selectedIconPath": "image/icon/home.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/residents/code",
|
||||||
|
"text": "进出码",
|
||||||
|
"iconPath": "image/icon/_code.png",
|
||||||
|
"selectedIconPath": "image/icon/code.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/residents/report",
|
||||||
|
"text": "体温上报",
|
||||||
|
"iconPath": "image/icon/_report.png",
|
||||||
|
"selectedIconPath": "image/icon/report.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/person/person",
|
||||||
|
"text": "我",
|
||||||
|
"iconPath": "image/icon/_person.png",
|
||||||
|
"selectedIconPath": "image/icon/person.png"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"permission": {
|
||||||
|
"scope.userLocation": {
|
||||||
|
"desc": "你的位置信息将用于体温上报"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"requiredPrivateInfos": [
|
||||||
|
"chooseLocation"
|
||||||
|
],
|
||||||
|
"style": "v2",
|
||||||
|
"sitemapLocation": "sitemap.json"
|
||||||
|
}
|
1
weixin-miniprogram/app.wxss
Normal file
@ -0,0 +1 @@
|
|||||||
|
/**app.wxss**/
|
BIN
weixin-miniprogram/image/home.jpg
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
weixin-miniprogram/image/icon/_code.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
weixin-miniprogram/image/icon/_home.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
weixin-miniprogram/image/icon/_person.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
weixin-miniprogram/image/icon/_report.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
weixin-miniprogram/image/icon/apply.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
weixin-miniprogram/image/icon/code.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
weixin-miniprogram/image/icon/count.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
weixin-miniprogram/image/icon/danger.png
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
weixin-miniprogram/image/icon/feedback.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
weixin-miniprogram/image/icon/fk.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
weixin-miniprogram/image/icon/gg.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
weixin-miniprogram/image/icon/home.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
187
weixin-miniprogram/image/icon/login-background.svg
Normal file
@ -0,0 +1,187 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
viewBox="0 0 525 374.4" style="enable-background:new 0 0 525 374.4;" xml:space="preserve">
|
||||||
|
<style type="text/css">
|
||||||
|
.st0{opacity:7.000000e-02;}
|
||||||
|
.st1{fill:#2A94F4;}
|
||||||
|
.st2{opacity:0.51;}
|
||||||
|
.st3{fill:#CEF5EC;}
|
||||||
|
.st4{fill:#F7F7F7;}
|
||||||
|
.st5{opacity:0.17;fill:#2A94F4;enable-background:new ;}
|
||||||
|
.st6{clip-path:url(#SVGID_00000031901539733340069960000001638542864404409276_);fill:#2A94F4;}
|
||||||
|
.st7{fill:#B97A59;}
|
||||||
|
.st8{fill:#0B4870;}
|
||||||
|
.st9{fill:#AA6B4F;}
|
||||||
|
.st10{fill:#D3D3D3;}
|
||||||
|
</style>
|
||||||
|
<g class="st0">
|
||||||
|
<g>
|
||||||
|
<path class="st1" d="M467.2,141.9c6.6,12.1,16.3,23.5,17.1,37.1c1.3,21.9-20,38.3-28.7,58.6c-10.7,24.9-1.7,54.2-11.2,79.5
|
||||||
|
c-6.9,18.3-23.7,33-43.5,37.8c-14.8,3.6-30.4,2-45.7,2.1c-43.4,0.4-86.7,15.4-129.6,8.6c-21.2-3.4-41.2-12-62.4-14.7
|
||||||
|
c-25.5-3.3-55.2,0.7-73.4-16.6c-25.5-24.2-6.6-68.7-25.7-97.7c-6.2-9.4-16.1-16.7-19.4-27.2c-3.9-12.4,2.4-25.5,10.2-36.1
|
||||||
|
c7.8-10.5,17.5-20.2,21.7-32.5c3.8-11.1,1.5-23.2-3.2-34c-7.2-16.6,12.9-54.6,52.9-51.7c18.3,1.3,26.6-19.9,46.7-25.8
|
||||||
|
c23-6.7,51.9-1.3,68.8,4.3c17.2,5.7,38.5,8.7,48.4-5.9c13.9-20.7,55.5-23.9,74.2,9.7c6.8,12.2,12.9,21.8,27.4,20.8
|
||||||
|
C470.4,53.1,457.3,124,467.2,141.9z M252.9,28.6c0,2.8,0,7.6,12.4,6.8c3.8-0.2,6.9-2.3,6.9-5.1c0-2.8-3.1-5.1-6.9-5.1
|
||||||
|
C261.5,25.3,252.9,24.1,252.9,28.6z M130.8,42.3c-0.4,0.2-0.6,0.6-0.8,1c-0.8,1.2-2.2,2-3.6,2.6c-0.8,0.3-1.7,0.6-2.3,1.2
|
||||||
|
c-1,1-0.9,2.8,0.2,3.6c0.9,0.7,2.1,0.8,3.3,0.7c4.3-0.2,8.5-1.8,11.9-4.4C143.8,43.5,133.2,41,130.8,42.3z M119,48.7
|
||||||
|
c-1.5-1-3.3-0.4-4.8,0.3c-0.3,0.2-0.6,0.4-0.7,0.7c-0.2,0.7,0.7,1.2,1.4,1.4c1.1,0.3,2.3,0.7,3.4,0.3
|
||||||
|
C119.4,51.1,120.5,49.7,119,48.7z M64.2,138.4c-1.1-3.3-3.6-4.9-7.5-3c-2.3,1.1-3.9,3.2-5.3,5.3c-2.2,3.4-4.1,7.2-3.6,11.1
|
||||||
|
c0.3,2.9,2,5.6,4.4,7.3c1,0.7,2.2,1.2,3.4,1.2c1.4,0,2.6-0.8,3.7-1.6c2.5-1.9,4.4-4.5,6.3-6.9c1-1.3,2-2.7,2.2-4.2
|
||||||
|
C68.3,144.1,65.2,141.4,64.2,138.4z M466.2,239.4c-1,0.4-2,0.9-2.5,1.8c-0.4,0.7-0.6,1.5-0.6,2.3c-0.2,1.7-0.3,3.3-0.3,5
|
||||||
|
c0,1.8,0.2,3.8,1.6,5.1c1.9,1.7,4.9,1.1,7.3,0.4c1.4-0.4,2.9-0.8,3.8-1.9c0.7-0.8,0.9-1.8,1.1-2.8c0.6-3.3,2.4-8.3,0.4-10.1
|
||||||
|
C474.8,237.4,469.7,238,466.2,239.4z M327.3,367.8c-0.5,0.5-1,1-1.3,1.6c-0.8,1.7,0,3.9,1.8,4.6c0.9,0.4,1.9,0.4,2.9,0.3
|
||||||
|
c8.3-0.1,17.2-0.4,23.8-5.2c0.8-0.6,1.6-1.4,1.5-2.3c-0.2-1.2-1.6-1.7-2.8-1.9C344.9,363.4,333.9,361.6,327.3,367.8z M170.3,355
|
||||||
|
c-7.2-1-18.6-2.3-18.6,3.5c0,2.2,10.2,4.3,11.8,4.7c5.2,1.3,10.1,3.1,15.1,5c9.4,3.5,17-1.2,9.5-6.5
|
||||||
|
C182,357.4,176.1,355.8,170.3,355z"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g class="st2">
|
||||||
|
<path class="st3" d="M352.3,282.8c-2.3-4.4,3-9.1,7.9-10s10.4-0.2,14.2-3.3c5.2-4.1,4.9-13,10.6-16.3c4.6-2.6,10.7-0.1,15.5-2.2
|
||||||
|
c6-2.6,7.7-11,13.7-13.8c4.7-2.3,10.9,0.3,13.3,4.9c2.4,4.6,1.3,10.6-2,14.7c-2.6,3.1-6.5,5.4-8.1,9.1c-2.5,5.9,1.5,13-0.9,19
|
||||||
|
c-4.3,11-24.7,7.7-28.3,19c-0.8,2.5-0.5,5.2-0.7,7.9c-0.6,7.8-6.1,14.6-12.9,18.5c-6.8,3.9-14.8,5.2-22.6,5.8
|
||||||
|
c-3.2,0.2-6.6,0.3-9.4-1.2c-2.7-1.4-4.5-3.9-6-6.6C327.2,311.4,323.3,289.2,352.3,282.8"/>
|
||||||
|
</g>
|
||||||
|
<g class="st2">
|
||||||
|
<path class="st3" d="M200,267.5c3.2-5.2-2.8-11.4-8.7-12.9c-5.9-1.5-12.6-1.2-17.1-5.3c-5.9-5.5-4.8-16.4-11.5-20.9
|
||||||
|
c-5.4-3.6-13-1.1-18.8-4.1c-7.2-3.7-8.4-14.2-15.4-18.2c-5.6-3.2-13.4-0.7-16.8,4.8s-2.6,12.9,1.1,18.2c2.9,4.1,7.4,7.2,9.1,11.9
|
||||||
|
c2.6,7.4-3,15.8-0.7,23.3c4.3,13.9,29.6,11.7,32.8,25.9c0.7,3.2,0.1,6.4,0.1,9.7c0,9.6,6.1,18.5,14.1,23.9s17.6,7.8,27.1,9.2
|
||||||
|
c3.9,0.6,8,1,11.6-0.6c3.4-1.4,5.9-4.4,8-7.5C228,304.8,234.8,278,200,267.5"/>
|
||||||
|
</g>
|
||||||
|
<path class="st3" d="M409.2,27.1l-7,2.4l-3-8.7c-5.6-16.1-23.3-24.7-39.4-19.1c-16.1,5.6-24.7,23.3-19.1,39.4l3,8.7l-7,2.4
|
||||||
|
c-5.5,1.9-8.4,7.9-6.5,13.4l19.7,56.9c1.9,5.5,8,8.5,13.4,6.6l72.4-25.1c5.5-1.9,8.5-8,6.6-13.5l-19.7-56.9
|
||||||
|
C420.8,28.1,414.8,25.1,409.2,27.1z M354,36.4c-3.1-8.8,1.6-18.5,10.4-21.6c8.8-3.1,18.5,1.6,21.6,10.5l3,8.7l-32,11.1L354,36.4z
|
||||||
|
M396,88.3l5,14.5c0.2,0.6-0.2,1.2-0.8,1.5l-7,2.4c-0.5,0.2-1.2-0.1-1.4-0.7l-5-14.5c-5.4-0.2-10.4-3.6-12.3-9.1
|
||||||
|
c-2.4-7,1.3-14.7,8.3-17.2c7-2.4,14.7,1.3,17.2,8.3C401.9,79,400.1,84.8,396,88.3z"/>
|
||||||
|
<g>
|
||||||
|
<g>
|
||||||
|
<path class="st3" d="M334.1,308.8c7.1-3,13.4-8.7,18.7-14.1c14.2-14.7,23-33.8,27.7-53.6c4.2-17.9,5.1-36.3,4.3-54.6
|
||||||
|
c-0.1-1.5-2.5-1.6-2.4,0c2,41.1-6.2,91.4-42.9,116.4c-2.1,1.4-4.2,2.8-6.5,3.8C331.5,307.3,332.7,309.4,334.1,308.8L334.1,308.8z"
|
||||||
|
/>
|
||||||
|
</g>
|
||||||
|
<path class="st3" d="M380.8,234.2c0,0,2.3-13.3,19.9-15.4C400.8,218.8,394.3,234.5,380.8,234.2z"/>
|
||||||
|
<path class="st3" d="M375.1,253.8c0,0,5.4-12.4,23-10.3C398,243.5,388.1,257.3,375.1,253.8z"/>
|
||||||
|
<path class="st3" d="M367.6,271.2c0,0,8-10.9,24.7-4.9C392.3,266.3,379.5,277.5,367.6,271.2z"/>
|
||||||
|
<path class="st3" d="M383.5,213.5c0,0,2.3-13.1,19.6-15.1C403.1,198.4,396.8,213.9,383.5,213.5z"/>
|
||||||
|
<path class="st3" d="M383.8,190.8c0,0-9.9-8.9-2.4-24.7C381.4,166.2,391.1,179.7,383.8,190.8z"/>
|
||||||
|
<path class="st3" d="M383.8,204.3c0,0-13.1-2.4-15-19.7C368.9,184.5,384.3,191,383.8,204.3z"/>
|
||||||
|
<path class="st3" d="M382.5,224.2c0,0-13.1-2.4-15-19.7C367.6,204.5,383,210.9,382.5,224.2z"/>
|
||||||
|
<path class="st3" d="M379.1,242.9c0,0-12.9-3.3-13.5-20.7C365.6,222.1,380.5,229.6,379.1,242.9z"/>
|
||||||
|
<path class="st3" d="M373.2,261.5c0,0-12.9-3.3-13.5-20.7C359.7,240.8,374.6,248.3,373.2,261.5z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<g>
|
||||||
|
<path class="st3" d="M200.3,303.8c-7.1-3-13.4-8.7-18.7-14.1c-14.2-14.7-23-33.8-27.7-53.6c-4.2-17.9-5.1-36.3-4.3-54.6
|
||||||
|
c0.1-1.5,2.5-1.6,2.4,0c-2,41.1,6.2,91.4,42.9,116.4c2.1,1.4,4.2,2.8,6.5,3.8C202.9,302.3,201.7,304.4,200.3,303.8L200.3,303.8z"
|
||||||
|
/>
|
||||||
|
</g>
|
||||||
|
<path class="st3" d="M153.6,229.2c0,0-2.3-13.3-19.9-15.4C133.6,213.8,140.1,229.5,153.6,229.2z"/>
|
||||||
|
<path class="st3" d="M159.4,248.8c0,0-5.4-12.4-23-10.3C136.4,238.5,146.3,252.3,159.4,248.8z"/>
|
||||||
|
<path class="st3" d="M166.9,266.2c0,0-8-10.9-24.7-4.9C142.1,261.3,154.9,272.5,166.9,266.2z"/>
|
||||||
|
<path class="st3" d="M150.9,208.5c0,0-2.3-13.1-19.6-15.1C131.3,193.4,137.6,208.9,150.9,208.5z"/>
|
||||||
|
<path class="st3" d="M150.7,185.8c0,0,9.9-8.9,2.4-24.7C153.1,161.2,143.3,174.7,150.7,185.8z"/>
|
||||||
|
<path class="st3" d="M150.6,199.3c0,0,13.1-2.4,15-19.7C165.6,179.5,150.1,186,150.6,199.3z"/>
|
||||||
|
<path class="st3" d="M151.9,219.2c0,0,13.1-2.4,15-19.7C166.9,199.5,151.4,205.9,151.9,219.2z"/>
|
||||||
|
<path class="st3" d="M155.3,237.9c0,0,12.9-3.3,13.5-20.7C168.8,217.1,153.9,224.6,155.3,237.9z"/>
|
||||||
|
<path class="st3" d="M161.2,256.5c0,0,12.9-3.3,13.5-20.7C174.7,235.8,159.8,243.3,161.2,256.5z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path class="st1" d="M326.9,338.6H213.6c-11.7,0-21.1-9.5-21.1-21.1V54.8c0-11.7,9.5-21.1,21.1-21.1h113.2
|
||||||
|
c11.7,0,21.1,9.5,21.1,21.1v262.7C348,329.1,338.5,338.6,326.9,338.6z"/>
|
||||||
|
<path class="st4" d="M326,327.8H214.5c-8.2,0-14.8-6.6-14.8-14.8V57.4c0-8.2,6.6-14.8,14.8-14.8H326c8.2,0,14.8,6.6,14.8,14.8V313
|
||||||
|
C340.8,321.2,334.2,327.8,326,327.8z"/>
|
||||||
|
<path class="st1" d="M312.5,42.6h-9.2c-2.8,0-5.1,2.3-5.1,5.1v3.6c0,2.8-2.3,5.1-5.1,5.1h-40.9c-2.8,0-5.1-2.3-5.1-5.1v-3.6
|
||||||
|
c0-2.8-2.3-5.1-5.1-5.1h-26.1V40h96.6L312.5,42.6L312.5,42.6z"/>
|
||||||
|
<g>
|
||||||
|
<circle class="st5" cx="268.3" cy="142.4" r="20.4"/>
|
||||||
|
<g>
|
||||||
|
<g>
|
||||||
|
<defs>
|
||||||
|
<circle id="SVGID_1_" cx="268.3" cy="142.4" r="20.4"/>
|
||||||
|
</defs>
|
||||||
|
<clipPath id="SVGID_00000096774277113628933520000010358380364922621880_">
|
||||||
|
<use xlink:href="#SVGID_1_" style="overflow:visible;"/>
|
||||||
|
</clipPath>
|
||||||
|
<path style="clip-path:url(#SVGID_00000096774277113628933520000010358380364922621880_);fill:#2A94F4;" d="M276.2,137.7
|
||||||
|
c0,4.4-3.5,7.9-7.9,7.9s-7.9-3.5-7.9-7.9s3.5-7.9,7.9-7.9S276.2,133.3,276.2,137.7z M280.2,170.2v-11.3
|
||||||
|
c0-6.3-5.1-11.5-11.5-11.5h-0.9c-6.3,0-11.5,5.1-11.5,11.5v11.3c0,1.8,1.4,3.2,3.2,3.2H277C278.8,173.4,280.2,172,280.2,170.2z"
|
||||||
|
/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<path class="st5" d="M317.2,186.1h-97.8c-4.5,0-8.1-3.6-8.1-8.1l0,0c0-4.5,3.6-8.1,8.1-8.1h97.8c4.5,0,8.1,3.6,8.1,8.1l0,0
|
||||||
|
C325.3,182.4,321.7,186.1,317.2,186.1z"/>
|
||||||
|
<path class="st1" d="M313.8,180.1h-91c-1.2,0-2.1-0.9-2.1-2.1l0,0c0-1.2,0.9-2.1,2.1-2.1h91c1.2,0,2.1,0.9,2.1,2.1l0,0
|
||||||
|
C315.9,179.1,315,180.1,313.8,180.1z"/>
|
||||||
|
<path class="st5" d="M317.3,215.1h-97.8c-4.5,0-8.1-3.6-8.1-8.1l0,0c0-4.5,3.6-8.1,8.1-8.1h97.8c4.5,0,8.1,3.6,8.1,8.1l0,0
|
||||||
|
C325.4,211.5,321.7,215.1,317.3,215.1z"/>
|
||||||
|
<path class="st1" d="M222,209.3L222,209.3c-1.2,0-2.1-0.9-2.1-2.1l0,0c0-1.2,0.9-2.1,2.1-2.1l0,0c1.2,0,2.1,0.9,2.1,2.1l0,0
|
||||||
|
C224.1,208.4,223.1,209.3,222,209.3z M230.4,207.2L230.4,207.2c0-1.2-0.9-2.1-2.1-2.1l0,0c-1.2,0-2.1,0.9-2.1,2.1l0,0
|
||||||
|
c0,1.2,0.9,2.1,2.1,2.1l0,0C229.4,209.3,230.4,208.4,230.4,207.2z M236.6,207.2L236.6,207.2c0-1.2-0.9-2.1-2.1-2.1l0,0
|
||||||
|
c-1.2,0-2.1,0.9-2.1,2.1l0,0c0,1.2,0.9,2.1,2.1,2.1l0,0C235.7,209.3,236.6,208.4,236.6,207.2z M242.9,207.2L242.9,207.2
|
||||||
|
c0-1.2-0.9-2.1-2.1-2.1l0,0c-1.2,0-2.1,0.9-2.1,2.1l0,0c0,1.2,0.9,2.1,2.1,2.1l0,0C242,209.3,242.9,208.4,242.9,207.2z
|
||||||
|
M249.2,207.2L249.2,207.2c0-1.2-0.9-2.1-2.1-2.1l0,0c-1.2,0-2.1,0.9-2.1,2.1l0,0c0,1.2,0.9,2.1,2.1,2.1l0,0
|
||||||
|
C248.3,209.3,249.2,208.4,249.2,207.2z M255.5,207.2L255.5,207.2c0-1.2-0.9-2.1-2.1-2.1l0,0c-1.2,0-2.1,0.9-2.1,2.1l0,0
|
||||||
|
c0,1.2,0.9,2.1,2.1,2.1l0,0C254.5,209.3,255.5,208.4,255.5,207.2z M261.8,207.2L261.8,207.2c0-1.2-0.9-2.1-2.1-2.1l0,0
|
||||||
|
c-1.2,0-2.1,0.9-2.1,2.1l0,0c0,1.2,0.9,2.1,2.1,2.1l0,0C260.8,209.3,261.8,208.4,261.8,207.2z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path class="st7" d="M135.2,308.8c0,0-2.1,11.6-2.6,13.6c-0.4,1.6-1.6,2.8-2.8,4c-0.4,0.4-0.7,1.2-0.9,1.8
|
||||||
|
c-0.2,0.5-0.1,1.1,0.2,1.6c5.3,8.5,16.4,10.1,16.5,9.4c0.2-1.3-1.9-3.5-4.3-4.4c-2.4-0.8-4.2-3-4.8-5.5l0,0c-0.5-2-0.5-4.1,0.1-6.1
|
||||||
|
l2.6-8.9L135.2,308.8z"/>
|
||||||
|
<path class="st7" d="M128.7,310.1l2.6,11.7c0.8,3.6,0.3,7.3-1.4,10.6l0,0c-1,1.8-0.1,4.1,1.8,4.8c6.3,2.2,18.4,6.5,18.9,6
|
||||||
|
c2.8-2.3-4.5-6.2-9.9-10.2c-3.6-2.7-5-15.5-5.3-25.2l-5.8,1.5C129.2,309.3,128.8,309.6,128.7,310.1z"/>
|
||||||
|
<path class="st8" d="M139.5,336.3c2.6,0.9,5.4,1.1,8,1.5c0.3,0,0.6,0.2,0.8,0.3c2.5,1.9,3.8,3.9,2.3,5.1
|
||||||
|
c-0.6,0.5-14.9-4.6-20.4-6.5c-1.2-0.4-1.7-1.8-1.1-2.9l1.1-2C133.1,333.6,136.2,335.2,139.5,336.3z"/>
|
||||||
|
<path class="st8" d="M131.4,190.3c-6.6,2.3-10.7,11.3-7.7,19.7c1.7,4.9,10,21.8,18.1,34.9c3.1,5,3.5,11.3,0.8,16.5
|
||||||
|
c-0.4,0.8-0.8,1.7-1.1,2.6c-1.3,4.4-4.7,29.2-6.4,45.7c0.8,1.9,2.5,4.3,4.2,4.8c5.8-14.9,14.6-41.7,16-46.4
|
||||||
|
c0.8-2.6,1.6-5.5,2.1-8.3c4-8.4-5.4-48.7-8.2-56.6C146.2,194.9,137.9,188,131.4,190.3z"/>
|
||||||
|
<ellipse class="st8" cx="135.5" cy="129.9" rx="10.6" ry="13.7"/>
|
||||||
|
<path class="st8" d="M133,131.3c-0.2-7.6-6.3-14-13.9-14.4c-6.7-0.4-12.5,3.7-14.7,9.6c-0.8,2.1-2.8,3.4-5,3.4
|
||||||
|
c-0.9,0-1.8,0.1-2.8,0.3c-5.5,1.1-9.9,5.8-10.4,11.5c-0.5,5.1,1.9,9.6,5.7,12.2c1.6,1.1,2.6,2.9,2.8,4.9c1.3,9,9.5,15.7,18.9,14.6
|
||||||
|
c8-0.9,14.5-7.5,15.2-15.6c0.4-4.9-1.3-9.5-4.3-12.9C129.6,142.6,133.1,137.3,133,131.3z"/>
|
||||||
|
<path class="st8" d="M135.5,111.7c0,0,6,3.8,5.2,8.8c0,0,3.2-2.3,3.9-10C145.2,105.1,135.5,111.7,135.5,111.7z"/>
|
||||||
|
<path class="st7" d="M145.2,138.4c3.2,1.6,6.4,2.9,9.7,3.7c3.3,0.8,6.7,0.8,10.2,0.3c3.6-0.5,7.3-1.5,11.3-2.2s8.2-0.9,12.1-0.3
|
||||||
|
c0.7,0.1,1.2,0.8,1.1,1.5c-0.1,0.6-0.6,1.1-1.2,1.1l0,0c-3.8,0.2-7.3,0.9-10.9,2.2c-3.5,1.2-7.1,2.8-11.1,4s-8.5,1.7-12.8,1.2
|
||||||
|
s-8.4-1.7-12.3-3.3c-2.3-0.9-3.5-3.6-2.6-5.9c0.9-2.3,3.6-3.5,5.9-2.6c0.1,0,0.2,0.1,0.3,0.1L145.2,138.4z"/>
|
||||||
|
<path class="st3" d="M142.2,168.8c2.4-7.2,7.2-22.5,6.8-27.4c-0.3-3.2-2.9-5.6-6.1-5.6H122c-3.4,0-6.3,2.7-6.4,6.2
|
||||||
|
c-0.2,6,2.6,19.7,4.2,26.9h22.4V168.8z"/>
|
||||||
|
<path class="st8" d="M135.3,310.2c0.3-0.2,0.5-0.6,0.5-1c-0.4-15.3-1.4-34.8-1.7-38.5c0-0.4-0.1-0.8-0.2-1.3
|
||||||
|
c3.3-18.1,3.8-56.9,4.1-63.7c0.4-8.9-5-19-11.9-19.4c-7-0.3-14.5,6.9-16.7,15.1c-1.5,5.4,4.2,34.2,10.4,55.1
|
||||||
|
c1.3,4.4,1.5,9,0.8,13.5c-0.5,3.1-0.6,6.4-0.4,8.8c0.3,3.7,4.4,18.6,8.3,31.5c0.1,0.4,0.4,0.7,0.8,0.7
|
||||||
|
C131.4,311.5,133.4,311.4,135.3,310.2z"/>
|
||||||
|
<path class="st3" d="M117.5,177.9c1.1-3,1.4-6.3,0.9-9.4c-1-7.4-2.9-21.2-2.7-27.1c0.1-3.2,2.7-5.6,5.8-5.6h3.1
|
||||||
|
c1.2,2.7,3.7,4.8,7.5,4.8c3.9,0,6.3-2.1,7.5-4.8h2.9c-3.1,6.7-2,15.6,3.4,20.8c-1,3.6-1.9,7.1-2.5,10c-0.9,3.9-0.5,8,1.1,11.7
|
||||||
|
c2.7,6.4,4.8,16.6,4.1,20.7c-21.9,6.2-37-4.8-37-4.8L117.5,177.9z"/>
|
||||||
|
<g>
|
||||||
|
<polygon class="st7" points="135.5,137.2 126.1,136.2 129.1,125.9 135.2,126.6 "/>
|
||||||
|
</g>
|
||||||
|
<path class="st9" d="M135.2,126.6l-6.1-0.8l-0.9,3.2c1.4,1.5,3.1,4.9,5.3,4.9c0.7,0,1.3-0.2,1.9-0.6L135.2,126.6z"/>
|
||||||
|
<path class="st7" d="M135.4,131.6c-2.1,0-4.3-1-7.4-3.7c-1.8-1.5-3.1-4.2-3.1-6.1v-10.1h15.5c0,0,1.2,5.4,0,10.7
|
||||||
|
C139.6,126.4,137,131.6,135.4,131.6z"/>
|
||||||
|
<path class="st7" d="M127.5,119.9c0,2-0.9,3.6-2.1,3.6s-2.4-2.6-2.4-4.5c0-2,1.3-2.6,2.4-2.6C126.6,116.3,127.5,117.9,127.5,119.9z
|
||||||
|
"/>
|
||||||
|
<path class="st8" d="M123,112.9c0-3.1,2.6-5.7,5.7-5.7h5.2c1.5,0,3-0.4,4.2-1.1c1.8-1,4.2-0.7,5.4,1c1.4,1.8,2,4.3-1.5,6.6
|
||||||
|
c-1.7,1.1-4.2-0.1-5.9,0.4c-0.1,0-0.2,0-0.3,0h-4.6c-1.6,0-2.8,1.3-2.9,2.9c0,1-0.9,1.8-1.9,1.8h-0.2l-0.7-2.4l-2.6,3.5L123,112.9
|
||||||
|
L123,112.9z"/>
|
||||||
|
<path class="st7" d="M194,138.8c0,0-2.5,4.9-4.2,4.6c-1.7-0.3-2.9-0.7-2.6-3.3c0.3-2.5,1.9-5.9,3.2-7.7s4.9-3.9,5.5-3.9
|
||||||
|
c1.9,0.1-0.9,3.1-2.2,4.7c-1.3,1.5-2.6,3.4-1.7,3.8c0.9,0.4,3.2-2.7,4.4-2.6C197.6,134.5,194,138.8,194,138.8z"/>
|
||||||
|
<path class="st8" d="M139.3,111.5c-0.5,2.3,0.2,3.6-7.3,7.2c-7.6,3.6-9.9,2.1-12.3,5.9c0,0,1-6.4,5.2-8.6
|
||||||
|
c4.2-2.2,11.4-3.6,13.7-8.7C138.6,107.3,139.6,110,139.3,111.5z"/>
|
||||||
|
<path class="st7" d="M122,145.2c-0.4,0.3-0.7,0.5-1,0.8c-0.3,0.2-0.6,0.4-0.9,0.6c-0.6,0.4-1.2,0.8-1.8,1.1
|
||||||
|
c-1.2,0.7-2.5,1.3-3.8,1.9c-2.6,1.1-5.4,1.8-8.2,2.3c-5.7,0.8-11.5,0-16.7-2c-2.6-1-5-2.3-7.3-3.8s-4.4-3.2-6.4-5
|
||||||
|
c-3.9-3.6-7.3-7.8-10.2-12.1c-0.3-0.5-0.2-1.1,0.3-1.4c0.4-0.3,1-0.2,1.3,0.2l0,0c3.5,3.8,7.1,7.3,11.1,10.3
|
||||||
|
c4,2.9,8.3,5.4,12.9,6.7c2.3,0.6,4.6,1.1,6.9,1.2c2.3,0.1,4.6-0.1,6.9-0.5s4.5-1.2,6.6-2.1c1-0.5,2.1-1,3.1-1.6
|
||||||
|
c0.5-0.3,1-0.6,1.4-0.9c0.2-0.2,0.5-0.3,0.7-0.5l0.6-0.4l0.2-0.2c1.5-1.2,3.7-0.9,4.9,0.6C123.7,141.9,123.5,144,122,145.2z"/>
|
||||||
|
<path class="st8" d="M137.8,112c0,0,0.3,7.8,7.1,11.5c0,0-3-5.9-2.8-9.7C142.3,109.9,137.4,109.3,137.8,112z"/>
|
||||||
|
<path class="st8" d="M127.2,333c-0.5-0.4-0.7-1.2-0.4-1.8c0.3-0.5,1-1.8,1.5-2.8c0.2-0.4,0.8-0.5,1.1-0.1c3.4,4.5,8.1,7.5,13.4,7.1
|
||||||
|
c1.9,0.8,3.5,3.1,3.3,4.2c0,0.2-2.3,0.8-5-0.1C129.3,335.6,127.2,333,127.2,333z"/>
|
||||||
|
<path class="st7" d="M67.7,124.4c0,0,3.3,4.4,2.3,5.9s-2,2.3-4.1,0.9c-2.2-1.4-4.5-4.3-5.6-6.4s-1.3-6.2-1.1-6.7
|
||||||
|
c1-1.7,2.5,2.2,3.3,4.1c0.8,1.9,1.9,3.9,2.7,3.2c0.8-0.6-1.1-4.1-0.4-5.1C65.5,119.2,67.7,124.4,67.7,124.4z"/>
|
||||||
|
</g>
|
||||||
|
<path class="st10" d="M509.5,367.8h-494c-8.6,0-15.5-6.9-15.5-15.5l0,0c0-8.6,6.9-15.5,15.5-15.5h494c8.6,0,15.5,6.9,15.5,15.5l0,0
|
||||||
|
C525,360.9,518.1,367.8,509.5,367.8z"/>
|
||||||
|
<path class="st3" d="M122.8,71.7l-6.5-7.1l-79.6,72.8c-5.5-3.5-12.5-4.4-19.1-1.9C6.6,139.7,1.1,152,5.4,163s16.5,16.5,27.5,12.2
|
||||||
|
c11-4.2,16.5-16.5,12.2-27.5c-0.3-0.8-0.7-1.6-1.1-2.4L104.3,89l7.2,7.1l7.2-7.3l-5.7-5.7l2.2-2.6l5.9,5.3l5-5.7l-6.2-5.7
|
||||||
|
L122.8,71.7z M30.2,168.2c-7.1,2.7-15.2-0.8-17.9-8c-2.7-7.1,0.8-15.2,8-17.9c7.1-2.7,15.2,0.8,17.9,8S37.3,165.5,30.2,168.2z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 14 KiB |
BIN
weixin-miniprogram/image/icon/notice.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
weixin-miniprogram/image/icon/password.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
weixin-miniprogram/image/icon/person.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
weixin-miniprogram/image/icon/report.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
weixin-miniprogram/image/icon/updPwd.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
weixin-miniprogram/image/icon/username.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
weixin-miniprogram/image/icon/visitor.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
12
weixin-miniprogram/node_modules/.package-lock.json
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name": "weixin-miniprogram",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"node_modules/blueimp-md5": {
|
||||||
|
"version": "2.19.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/blueimp-md5/-/blueimp-md5-2.19.0.tgz",
|
||||||
|
"integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
20
weixin-miniprogram/node_modules/blueimp-md5/LICENSE.txt
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright © 2011 Sebastian Tschan, https://blueimp.net
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
134
weixin-miniprogram/node_modules/blueimp-md5/README.md
generated
vendored
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
# JavaScript MD5
|
||||||
|
|
||||||
|
## Contents
|
||||||
|
|
||||||
|
- [Demo](https://blueimp.github.io/JavaScript-MD5/)
|
||||||
|
- [Description](#description)
|
||||||
|
- [Usage](#usage)
|
||||||
|
- [Client-side](#client-side)
|
||||||
|
- [Server-side](#server-side)
|
||||||
|
- [Requirements](#requirements)
|
||||||
|
- [API](#api)
|
||||||
|
- [Tests](#tests)
|
||||||
|
- [License](#license)
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
JavaScript [MD5](https://en.wikipedia.org/wiki/MD5) implementation.
|
||||||
|
Compatible with server-side environments like [Node.js](https://nodejs.org/),
|
||||||
|
module loaders like [RequireJS](https://requirejs.org/) or
|
||||||
|
[webpack](https://webpack.js.org/) and all web browsers.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### Client-side
|
||||||
|
|
||||||
|
Install the **blueimp-md5** package with [NPM](https://www.npmjs.org/):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install blueimp-md5
|
||||||
|
```
|
||||||
|
|
||||||
|
Include the (minified) JavaScript [MD5](https://en.wikipedia.org/wiki/MD5)
|
||||||
|
script in your HTML markup:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<script src="js/md5.min.js"></script>
|
||||||
|
```
|
||||||
|
|
||||||
|
In your application code, calculate the
|
||||||
|
([hex](https://en.wikipedia.org/wiki/Hexadecimal)-encoded)
|
||||||
|
[MD5](https://en.wikipedia.org/wiki/MD5) hash of a string by calling the **md5**
|
||||||
|
method with the string as argument:
|
||||||
|
|
||||||
|
```js
|
||||||
|
var hash = md5('value') // "2063c1608d6e0baf80249c42e2be5804"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Server-side
|
||||||
|
|
||||||
|
The following is an example how to use the JavaScript MD5 module on the
|
||||||
|
server-side with [Node.js](https://nodejs.org/).
|
||||||
|
|
||||||
|
Install the **blueimp-md5** package with [NPM](https://www.npmjs.org/):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install blueimp-md5
|
||||||
|
```
|
||||||
|
|
||||||
|
Add a file **server.js** with the following content:
|
||||||
|
|
||||||
|
```js
|
||||||
|
require('http')
|
||||||
|
.createServer(function (req, res) {
|
||||||
|
// The md5 module exports the md5() function:
|
||||||
|
var md5 = require('./md5'),
|
||||||
|
// Use the following version if you installed the package with npm:
|
||||||
|
// var md5 = require("blueimp-md5"),
|
||||||
|
url = require('url'),
|
||||||
|
query = url.parse(req.url).query
|
||||||
|
res.writeHead(200, { 'Content-Type': 'text/plain' })
|
||||||
|
// Calculate and print the MD5 hash of the url query:
|
||||||
|
res.end(md5(query))
|
||||||
|
})
|
||||||
|
.listen(8080, 'localhost')
|
||||||
|
console.log('Server running at http://localhost:8080/')
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the application with the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
node server.js
|
||||||
|
```
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
The JavaScript MD5 script has zero dependencies.
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
Calculate the ([hex](https://en.wikipedia.org/wiki/Hexadecimal)-encoded)
|
||||||
|
[MD5](https://en.wikipedia.org/wiki/MD5) hash of a given string value:
|
||||||
|
|
||||||
|
```js
|
||||||
|
var hash = md5('value') // "2063c1608d6e0baf80249c42e2be5804"
|
||||||
|
```
|
||||||
|
|
||||||
|
Calculate the ([hex](https://en.wikipedia.org/wiki/Hexadecimal)-encoded)
|
||||||
|
[HMAC](https://en.wikipedia.org/wiki/HMAC)-MD5 hash of a given string value and
|
||||||
|
key:
|
||||||
|
|
||||||
|
```js
|
||||||
|
var hash = md5('value', 'key') // "01433efd5f16327ea4b31144572c67f6"
|
||||||
|
```
|
||||||
|
|
||||||
|
Calculate the raw [MD5](https://en.wikipedia.org/wiki/MD5) hash of a given
|
||||||
|
string value:
|
||||||
|
|
||||||
|
```js
|
||||||
|
var hash = md5('value', null, true)
|
||||||
|
```
|
||||||
|
|
||||||
|
Calculate the raw [HMAC](https://en.wikipedia.org/wiki/HMAC)-MD5 hash of a given
|
||||||
|
string value and key:
|
||||||
|
|
||||||
|
```js
|
||||||
|
var hash = md5('value', 'key', true)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Tests
|
||||||
|
|
||||||
|
The JavaScript MD5 project comes with
|
||||||
|
[Unit Tests](https://en.wikipedia.org/wiki/Unit_testing).
|
||||||
|
There are two different ways to run the tests:
|
||||||
|
|
||||||
|
- Open test/index.html in your browser or
|
||||||
|
- run `npm test` in the Terminal in the root path of the repository package.
|
||||||
|
|
||||||
|
The first one tests the browser integration, the second one the
|
||||||
|
[Node.js](https://nodejs.org/) integration.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
The JavaScript MD5 script is released under the
|
||||||
|
[MIT license](https://opensource.org/licenses/MIT).
|
402
weixin-miniprogram/node_modules/blueimp-md5/js/md5.js
generated
vendored
Normal file
@ -0,0 +1,402 @@
|
|||||||
|
/*
|
||||||
|
* JavaScript MD5
|
||||||
|
* https://github.com/blueimp/JavaScript-MD5
|
||||||
|
*
|
||||||
|
* Copyright 2011, Sebastian Tschan
|
||||||
|
* https://blueimp.net
|
||||||
|
*
|
||||||
|
* Licensed under the MIT license:
|
||||||
|
* https://opensource.org/licenses/MIT
|
||||||
|
*
|
||||||
|
* Based on
|
||||||
|
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
||||||
|
* Digest Algorithm, as defined in RFC 1321.
|
||||||
|
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
|
||||||
|
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
||||||
|
* Distributed under the BSD License
|
||||||
|
* See http://pajhome.org.uk/crypt/md5 for more info.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* global define */
|
||||||
|
|
||||||
|
/* eslint-disable strict */
|
||||||
|
|
||||||
|
;(function ($) {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add integers, wrapping at 2^32.
|
||||||
|
* This uses 16-bit operations internally to work around bugs in interpreters.
|
||||||
|
*
|
||||||
|
* @param {number} x First integer
|
||||||
|
* @param {number} y Second integer
|
||||||
|
* @returns {number} Sum
|
||||||
|
*/
|
||||||
|
function safeAdd(x, y) {
|
||||||
|
var lsw = (x & 0xffff) + (y & 0xffff)
|
||||||
|
var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
|
||||||
|
return (msw << 16) | (lsw & 0xffff)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bitwise rotate a 32-bit number to the left.
|
||||||
|
*
|
||||||
|
* @param {number} num 32-bit number
|
||||||
|
* @param {number} cnt Rotation count
|
||||||
|
* @returns {number} Rotated number
|
||||||
|
*/
|
||||||
|
function bitRotateLeft(num, cnt) {
|
||||||
|
return (num << cnt) | (num >>> (32 - cnt))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Basic operation the algorithm uses.
|
||||||
|
*
|
||||||
|
* @param {number} q q
|
||||||
|
* @param {number} a a
|
||||||
|
* @param {number} b b
|
||||||
|
* @param {number} x x
|
||||||
|
* @param {number} s s
|
||||||
|
* @param {number} t t
|
||||||
|
* @returns {number} Result
|
||||||
|
*/
|
||||||
|
function md5cmn(q, a, b, x, s, t) {
|
||||||
|
return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b)
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Basic operation the algorithm uses.
|
||||||
|
*
|
||||||
|
* @param {number} a a
|
||||||
|
* @param {number} b b
|
||||||
|
* @param {number} c c
|
||||||
|
* @param {number} d d
|
||||||
|
* @param {number} x x
|
||||||
|
* @param {number} s s
|
||||||
|
* @param {number} t t
|
||||||
|
* @returns {number} Result
|
||||||
|
*/
|
||||||
|
function md5ff(a, b, c, d, x, s, t) {
|
||||||
|
return md5cmn((b & c) | (~b & d), a, b, x, s, t)
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Basic operation the algorithm uses.
|
||||||
|
*
|
||||||
|
* @param {number} a a
|
||||||
|
* @param {number} b b
|
||||||
|
* @param {number} c c
|
||||||
|
* @param {number} d d
|
||||||
|
* @param {number} x x
|
||||||
|
* @param {number} s s
|
||||||
|
* @param {number} t t
|
||||||
|
* @returns {number} Result
|
||||||
|
*/
|
||||||
|
function md5gg(a, b, c, d, x, s, t) {
|
||||||
|
return md5cmn((b & d) | (c & ~d), a, b, x, s, t)
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Basic operation the algorithm uses.
|
||||||
|
*
|
||||||
|
* @param {number} a a
|
||||||
|
* @param {number} b b
|
||||||
|
* @param {number} c c
|
||||||
|
* @param {number} d d
|
||||||
|
* @param {number} x x
|
||||||
|
* @param {number} s s
|
||||||
|
* @param {number} t t
|
||||||
|
* @returns {number} Result
|
||||||
|
*/
|
||||||
|
function md5hh(a, b, c, d, x, s, t) {
|
||||||
|
return md5cmn(b ^ c ^ d, a, b, x, s, t)
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Basic operation the algorithm uses.
|
||||||
|
*
|
||||||
|
* @param {number} a a
|
||||||
|
* @param {number} b b
|
||||||
|
* @param {number} c c
|
||||||
|
* @param {number} d d
|
||||||
|
* @param {number} x x
|
||||||
|
* @param {number} s s
|
||||||
|
* @param {number} t t
|
||||||
|
* @returns {number} Result
|
||||||
|
*/
|
||||||
|
function md5ii(a, b, c, d, x, s, t) {
|
||||||
|
return md5cmn(c ^ (b | ~d), a, b, x, s, t)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate the MD5 of an array of little-endian words, and a bit length.
|
||||||
|
*
|
||||||
|
* @param {Array} x Array of little-endian words
|
||||||
|
* @param {number} len Bit length
|
||||||
|
* @returns {Array<number>} MD5 Array
|
||||||
|
*/
|
||||||
|
function binlMD5(x, len) {
|
||||||
|
/* append padding */
|
||||||
|
x[len >> 5] |= 0x80 << len % 32
|
||||||
|
x[(((len + 64) >>> 9) << 4) + 14] = len
|
||||||
|
|
||||||
|
var i
|
||||||
|
var olda
|
||||||
|
var oldb
|
||||||
|
var oldc
|
||||||
|
var oldd
|
||||||
|
var a = 1732584193
|
||||||
|
var b = -271733879
|
||||||
|
var c = -1732584194
|
||||||
|
var d = 271733878
|
||||||
|
|
||||||
|
for (i = 0; i < x.length; i += 16) {
|
||||||
|
olda = a
|
||||||
|
oldb = b
|
||||||
|
oldc = c
|
||||||
|
oldd = d
|
||||||
|
|
||||||
|
a = md5ff(a, b, c, d, x[i], 7, -680876936)
|
||||||
|
d = md5ff(d, a, b, c, x[i + 1], 12, -389564586)
|
||||||
|
c = md5ff(c, d, a, b, x[i + 2], 17, 606105819)
|
||||||
|
b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330)
|
||||||
|
a = md5ff(a, b, c, d, x[i + 4], 7, -176418897)
|
||||||
|
d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426)
|
||||||
|
c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341)
|
||||||
|
b = md5ff(b, c, d, a, x[i + 7], 22, -45705983)
|
||||||
|
a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416)
|
||||||
|
d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417)
|
||||||
|
c = md5ff(c, d, a, b, x[i + 10], 17, -42063)
|
||||||
|
b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162)
|
||||||
|
a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682)
|
||||||
|
d = md5ff(d, a, b, c, x[i + 13], 12, -40341101)
|
||||||
|
c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290)
|
||||||
|
b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329)
|
||||||
|
|
||||||
|
a = md5gg(a, b, c, d, x[i + 1], 5, -165796510)
|
||||||
|
d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632)
|
||||||
|
c = md5gg(c, d, a, b, x[i + 11], 14, 643717713)
|
||||||
|
b = md5gg(b, c, d, a, x[i], 20, -373897302)
|
||||||
|
a = md5gg(a, b, c, d, x[i + 5], 5, -701558691)
|
||||||
|
d = md5gg(d, a, b, c, x[i + 10], 9, 38016083)
|
||||||
|
c = md5gg(c, d, a, b, x[i + 15], 14, -660478335)
|
||||||
|
b = md5gg(b, c, d, a, x[i + 4], 20, -405537848)
|
||||||
|
a = md5gg(a, b, c, d, x[i + 9], 5, 568446438)
|
||||||
|
d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690)
|
||||||
|
c = md5gg(c, d, a, b, x[i + 3], 14, -187363961)
|
||||||
|
b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501)
|
||||||
|
a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467)
|
||||||
|
d = md5gg(d, a, b, c, x[i + 2], 9, -51403784)
|
||||||
|
c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473)
|
||||||
|
b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734)
|
||||||
|
|
||||||
|
a = md5hh(a, b, c, d, x[i + 5], 4, -378558)
|
||||||
|
d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463)
|
||||||
|
c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562)
|
||||||
|
b = md5hh(b, c, d, a, x[i + 14], 23, -35309556)
|
||||||
|
a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060)
|
||||||
|
d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353)
|
||||||
|
c = md5hh(c, d, a, b, x[i + 7], 16, -155497632)
|
||||||
|
b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640)
|
||||||
|
a = md5hh(a, b, c, d, x[i + 13], 4, 681279174)
|
||||||
|
d = md5hh(d, a, b, c, x[i], 11, -358537222)
|
||||||
|
c = md5hh(c, d, a, b, x[i + 3], 16, -722521979)
|
||||||
|
b = md5hh(b, c, d, a, x[i + 6], 23, 76029189)
|
||||||
|
a = md5hh(a, b, c, d, x[i + 9], 4, -640364487)
|
||||||
|
d = md5hh(d, a, b, c, x[i + 12], 11, -421815835)
|
||||||
|
c = md5hh(c, d, a, b, x[i + 15], 16, 530742520)
|
||||||
|
b = md5hh(b, c, d, a, x[i + 2], 23, -995338651)
|
||||||
|
|
||||||
|
a = md5ii(a, b, c, d, x[i], 6, -198630844)
|
||||||
|
d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415)
|
||||||
|
c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905)
|
||||||
|
b = md5ii(b, c, d, a, x[i + 5], 21, -57434055)
|
||||||
|
a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571)
|
||||||
|
d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606)
|
||||||
|
c = md5ii(c, d, a, b, x[i + 10], 15, -1051523)
|
||||||
|
b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799)
|
||||||
|
a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359)
|
||||||
|
d = md5ii(d, a, b, c, x[i + 15], 10, -30611744)
|
||||||
|
c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380)
|
||||||
|
b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649)
|
||||||
|
a = md5ii(a, b, c, d, x[i + 4], 6, -145523070)
|
||||||
|
d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379)
|
||||||
|
c = md5ii(c, d, a, b, x[i + 2], 15, 718787259)
|
||||||
|
b = md5ii(b, c, d, a, x[i + 9], 21, -343485551)
|
||||||
|
|
||||||
|
a = safeAdd(a, olda)
|
||||||
|
b = safeAdd(b, oldb)
|
||||||
|
c = safeAdd(c, oldc)
|
||||||
|
d = safeAdd(d, oldd)
|
||||||
|
}
|
||||||
|
return [a, b, c, d]
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert an array of little-endian words to a string
|
||||||
|
*
|
||||||
|
* @param {Array<number>} input MD5 Array
|
||||||
|
* @returns {string} MD5 string
|
||||||
|
*/
|
||||||
|
function binl2rstr(input) {
|
||||||
|
var i
|
||||||
|
var output = ''
|
||||||
|
var length32 = input.length * 32
|
||||||
|
for (i = 0; i < length32; i += 8) {
|
||||||
|
output += String.fromCharCode((input[i >> 5] >>> i % 32) & 0xff)
|
||||||
|
}
|
||||||
|
return output
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert a raw string to an array of little-endian words
|
||||||
|
* Characters >255 have their high-byte silently ignored.
|
||||||
|
*
|
||||||
|
* @param {string} input Raw input string
|
||||||
|
* @returns {Array<number>} Array of little-endian words
|
||||||
|
*/
|
||||||
|
function rstr2binl(input) {
|
||||||
|
var i
|
||||||
|
var output = []
|
||||||
|
output[(input.length >> 2) - 1] = undefined
|
||||||
|
for (i = 0; i < output.length; i += 1) {
|
||||||
|
output[i] = 0
|
||||||
|
}
|
||||||
|
var length8 = input.length * 8
|
||||||
|
for (i = 0; i < length8; i += 8) {
|
||||||
|
output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << i % 32
|
||||||
|
}
|
||||||
|
return output
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate the MD5 of a raw string
|
||||||
|
*
|
||||||
|
* @param {string} s Input string
|
||||||
|
* @returns {string} Raw MD5 string
|
||||||
|
*/
|
||||||
|
function rstrMD5(s) {
|
||||||
|
return binl2rstr(binlMD5(rstr2binl(s), s.length * 8))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates the HMAC-MD5 of a key and some data (raw strings)
|
||||||
|
*
|
||||||
|
* @param {string} key HMAC key
|
||||||
|
* @param {string} data Raw input string
|
||||||
|
* @returns {string} Raw MD5 string
|
||||||
|
*/
|
||||||
|
function rstrHMACMD5(key, data) {
|
||||||
|
var i
|
||||||
|
var bkey = rstr2binl(key)
|
||||||
|
var ipad = []
|
||||||
|
var opad = []
|
||||||
|
var hash
|
||||||
|
ipad[15] = opad[15] = undefined
|
||||||
|
if (bkey.length > 16) {
|
||||||
|
bkey = binlMD5(bkey, key.length * 8)
|
||||||
|
}
|
||||||
|
for (i = 0; i < 16; i += 1) {
|
||||||
|
ipad[i] = bkey[i] ^ 0x36363636
|
||||||
|
opad[i] = bkey[i] ^ 0x5c5c5c5c
|
||||||
|
}
|
||||||
|
hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8)
|
||||||
|
return binl2rstr(binlMD5(opad.concat(hash), 512 + 128))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert a raw string to a hex string
|
||||||
|
*
|
||||||
|
* @param {string} input Raw input string
|
||||||
|
* @returns {string} Hex encoded string
|
||||||
|
*/
|
||||||
|
function rstr2hex(input) {
|
||||||
|
var hexTab = '0123456789abcdef'
|
||||||
|
var output = ''
|
||||||
|
var x
|
||||||
|
var i
|
||||||
|
for (i = 0; i < input.length; i += 1) {
|
||||||
|
x = input.charCodeAt(i)
|
||||||
|
output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f)
|
||||||
|
}
|
||||||
|
return output
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Encode a string as UTF-8
|
||||||
|
*
|
||||||
|
* @param {string} input Input string
|
||||||
|
* @returns {string} UTF8 string
|
||||||
|
*/
|
||||||
|
function str2rstrUTF8(input) {
|
||||||
|
return unescape(encodeURIComponent(input))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Encodes input string as raw MD5 string
|
||||||
|
*
|
||||||
|
* @param {string} s Input string
|
||||||
|
* @returns {string} Raw MD5 string
|
||||||
|
*/
|
||||||
|
function rawMD5(s) {
|
||||||
|
return rstrMD5(str2rstrUTF8(s))
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Encodes input string as Hex encoded string
|
||||||
|
*
|
||||||
|
* @param {string} s Input string
|
||||||
|
* @returns {string} Hex encoded string
|
||||||
|
*/
|
||||||
|
function hexMD5(s) {
|
||||||
|
return rstr2hex(rawMD5(s))
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Calculates the raw HMAC-MD5 for the given key and data
|
||||||
|
*
|
||||||
|
* @param {string} k HMAC key
|
||||||
|
* @param {string} d Input string
|
||||||
|
* @returns {string} Raw MD5 string
|
||||||
|
*/
|
||||||
|
function rawHMACMD5(k, d) {
|
||||||
|
return rstrHMACMD5(str2rstrUTF8(k), str2rstrUTF8(d))
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Calculates the Hex encoded HMAC-MD5 for the given key and data
|
||||||
|
*
|
||||||
|
* @param {string} k HMAC key
|
||||||
|
* @param {string} d Input string
|
||||||
|
* @returns {string} Raw MD5 string
|
||||||
|
*/
|
||||||
|
function hexHMACMD5(k, d) {
|
||||||
|
return rstr2hex(rawHMACMD5(k, d))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates MD5 value for a given string.
|
||||||
|
* If a key is provided, calculates the HMAC-MD5 value.
|
||||||
|
* Returns a Hex encoded string unless the raw argument is given.
|
||||||
|
*
|
||||||
|
* @param {string} string Input string
|
||||||
|
* @param {string} [key] HMAC key
|
||||||
|
* @param {boolean} [raw] Raw output switch
|
||||||
|
* @returns {string} MD5 output
|
||||||
|
*/
|
||||||
|
function md5(string, key, raw) {
|
||||||
|
if (!key) {
|
||||||
|
if (!raw) {
|
||||||
|
return hexMD5(string)
|
||||||
|
}
|
||||||
|
return rawMD5(string)
|
||||||
|
}
|
||||||
|
if (!raw) {
|
||||||
|
return hexHMACMD5(key, string)
|
||||||
|
}
|
||||||
|
return rawHMACMD5(key, string)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof define === 'function' && define.amd) {
|
||||||
|
define(function () {
|
||||||
|
return md5
|
||||||
|
})
|
||||||
|
} else if (typeof module === 'object' && module.exports) {
|
||||||
|
module.exports = md5
|
||||||
|
} else {
|
||||||
|
$.md5 = md5
|
||||||
|
}
|
||||||
|
})(this)
|
2
weixin-miniprogram/node_modules/blueimp-md5/js/md5.min.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
!function(n){"use strict";function d(n,t){var r=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(r>>16)<<16|65535&r}function f(n,t,r,e,o,u){return d((u=d(d(t,n),d(e,u)))<<o|u>>>32-o,r)}function l(n,t,r,e,o,u,c){return f(t&r|~t&e,n,t,o,u,c)}function g(n,t,r,e,o,u,c){return f(t&e|r&~e,n,t,o,u,c)}function v(n,t,r,e,o,u,c){return f(t^r^e,n,t,o,u,c)}function m(n,t,r,e,o,u,c){return f(r^(t|~e),n,t,o,u,c)}function c(n,t){var r,e,o,u;n[t>>5]|=128<<t%32,n[14+(t+64>>>9<<4)]=t;for(var c=1732584193,f=-271733879,i=-1732584194,a=271733878,h=0;h<n.length;h+=16)c=l(r=c,e=f,o=i,u=a,n[h],7,-680876936),a=l(a,c,f,i,n[h+1],12,-389564586),i=l(i,a,c,f,n[h+2],17,606105819),f=l(f,i,a,c,n[h+3],22,-1044525330),c=l(c,f,i,a,n[h+4],7,-176418897),a=l(a,c,f,i,n[h+5],12,1200080426),i=l(i,a,c,f,n[h+6],17,-1473231341),f=l(f,i,a,c,n[h+7],22,-45705983),c=l(c,f,i,a,n[h+8],7,1770035416),a=l(a,c,f,i,n[h+9],12,-1958414417),i=l(i,a,c,f,n[h+10],17,-42063),f=l(f,i,a,c,n[h+11],22,-1990404162),c=l(c,f,i,a,n[h+12],7,1804603682),a=l(a,c,f,i,n[h+13],12,-40341101),i=l(i,a,c,f,n[h+14],17,-1502002290),c=g(c,f=l(f,i,a,c,n[h+15],22,1236535329),i,a,n[h+1],5,-165796510),a=g(a,c,f,i,n[h+6],9,-1069501632),i=g(i,a,c,f,n[h+11],14,643717713),f=g(f,i,a,c,n[h],20,-373897302),c=g(c,f,i,a,n[h+5],5,-701558691),a=g(a,c,f,i,n[h+10],9,38016083),i=g(i,a,c,f,n[h+15],14,-660478335),f=g(f,i,a,c,n[h+4],20,-405537848),c=g(c,f,i,a,n[h+9],5,568446438),a=g(a,c,f,i,n[h+14],9,-1019803690),i=g(i,a,c,f,n[h+3],14,-187363961),f=g(f,i,a,c,n[h+8],20,1163531501),c=g(c,f,i,a,n[h+13],5,-1444681467),a=g(a,c,f,i,n[h+2],9,-51403784),i=g(i,a,c,f,n[h+7],14,1735328473),c=v(c,f=g(f,i,a,c,n[h+12],20,-1926607734),i,a,n[h+5],4,-378558),a=v(a,c,f,i,n[h+8],11,-2022574463),i=v(i,a,c,f,n[h+11],16,1839030562),f=v(f,i,a,c,n[h+14],23,-35309556),c=v(c,f,i,a,n[h+1],4,-1530992060),a=v(a,c,f,i,n[h+4],11,1272893353),i=v(i,a,c,f,n[h+7],16,-155497632),f=v(f,i,a,c,n[h+10],23,-1094730640),c=v(c,f,i,a,n[h+13],4,681279174),a=v(a,c,f,i,n[h],11,-358537222),i=v(i,a,c,f,n[h+3],16,-722521979),f=v(f,i,a,c,n[h+6],23,76029189),c=v(c,f,i,a,n[h+9],4,-640364487),a=v(a,c,f,i,n[h+12],11,-421815835),i=v(i,a,c,f,n[h+15],16,530742520),c=m(c,f=v(f,i,a,c,n[h+2],23,-995338651),i,a,n[h],6,-198630844),a=m(a,c,f,i,n[h+7],10,1126891415),i=m(i,a,c,f,n[h+14],15,-1416354905),f=m(f,i,a,c,n[h+5],21,-57434055),c=m(c,f,i,a,n[h+12],6,1700485571),a=m(a,c,f,i,n[h+3],10,-1894986606),i=m(i,a,c,f,n[h+10],15,-1051523),f=m(f,i,a,c,n[h+1],21,-2054922799),c=m(c,f,i,a,n[h+8],6,1873313359),a=m(a,c,f,i,n[h+15],10,-30611744),i=m(i,a,c,f,n[h+6],15,-1560198380),f=m(f,i,a,c,n[h+13],21,1309151649),c=m(c,f,i,a,n[h+4],6,-145523070),a=m(a,c,f,i,n[h+11],10,-1120210379),i=m(i,a,c,f,n[h+2],15,718787259),f=m(f,i,a,c,n[h+9],21,-343485551),c=d(c,r),f=d(f,e),i=d(i,o),a=d(a,u);return[c,f,i,a]}function i(n){for(var t="",r=32*n.length,e=0;e<r;e+=8)t+=String.fromCharCode(n[e>>5]>>>e%32&255);return t}function a(n){var t=[];for(t[(n.length>>2)-1]=void 0,e=0;e<t.length;e+=1)t[e]=0;for(var r=8*n.length,e=0;e<r;e+=8)t[e>>5]|=(255&n.charCodeAt(e/8))<<e%32;return t}function e(n){for(var t,r="0123456789abcdef",e="",o=0;o<n.length;o+=1)t=n.charCodeAt(o),e+=r.charAt(t>>>4&15)+r.charAt(15&t);return e}function r(n){return unescape(encodeURIComponent(n))}function o(n){return i(c(a(n=r(n)),8*n.length))}function u(n,t){return function(n,t){var r,e=a(n),o=[],u=[];for(o[15]=u[15]=void 0,16<e.length&&(e=c(e,8*n.length)),r=0;r<16;r+=1)o[r]=909522486^e[r],u[r]=1549556828^e[r];return t=c(o.concat(a(t)),512+8*t.length),i(c(u.concat(t),640))}(r(n),r(t))}function t(n,t,r){return t?r?u(t,n):e(u(t,n)):r?o(n):e(o(n))}"function"==typeof define&&define.amd?define(function(){return t}):"object"==typeof module&&module.exports?module.exports=t:n.md5=t}(this);
|
||||||
|
//# sourceMappingURL=md5.min.js.map
|
1
weixin-miniprogram/node_modules/blueimp-md5/js/md5.min.js.map
generated
vendored
Normal file
74
weixin-miniprogram/node_modules/blueimp-md5/package.json
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
{
|
||||||
|
"name": "blueimp-md5",
|
||||||
|
"version": "2.19.0",
|
||||||
|
"title": "JavaScript MD5",
|
||||||
|
"description": "JavaScript MD5 implementation. Compatible with server-side environments like Node.js, module loaders like RequireJS, Browserify or webpack and all web browsers.",
|
||||||
|
"keywords": [
|
||||||
|
"javascript",
|
||||||
|
"md5"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/blueimp/JavaScript-MD5",
|
||||||
|
"author": {
|
||||||
|
"name": "Sebastian Tschan",
|
||||||
|
"url": "https://blueimp.net"
|
||||||
|
},
|
||||||
|
"contributors": [
|
||||||
|
{
|
||||||
|
"name": "Paul Johnston",
|
||||||
|
"url": "http://pajhome.org.uk/crypt/md5"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/blueimp/JavaScript-MD5.git"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"devDependencies": {
|
||||||
|
"chai": "4",
|
||||||
|
"eslint": "7",
|
||||||
|
"eslint-config-blueimp": "2",
|
||||||
|
"eslint-config-prettier": "8",
|
||||||
|
"eslint-plugin-jsdoc": "36",
|
||||||
|
"eslint-plugin-prettier": "4",
|
||||||
|
"mocha": "9",
|
||||||
|
"prettier": "2",
|
||||||
|
"uglify-js": "3"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"extends": [
|
||||||
|
"blueimp",
|
||||||
|
"plugin:jsdoc/recommended",
|
||||||
|
"plugin:prettier/recommended"
|
||||||
|
],
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"node": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"eslintIgnore": [
|
||||||
|
"js/*.min.js",
|
||||||
|
"test/vendor"
|
||||||
|
],
|
||||||
|
"prettier": {
|
||||||
|
"arrowParens": "avoid",
|
||||||
|
"proseWrap": "always",
|
||||||
|
"semi": false,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "none"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint .",
|
||||||
|
"unit": "mocha",
|
||||||
|
"test": "npm run lint && npm run unit",
|
||||||
|
"prebuild": "bin/sync-vendor-libs.sh",
|
||||||
|
"build": "cd js && uglifyjs md5.js -c -m -o md5.min.js --source-map url=md5.min.js.map",
|
||||||
|
"preversion": "npm test",
|
||||||
|
"version": "npm run build && git add -A js",
|
||||||
|
"postversion": "git push --tags origin master master:gh-pages && npm publish"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"js/*.js",
|
||||||
|
"js/*.js.map"
|
||||||
|
],
|
||||||
|
"main": "js/md5.js"
|
||||||
|
}
|
17
weixin-miniprogram/package-lock.json
generated
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "weixin-miniprogram",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"dependencies": {
|
||||||
|
"blueimp-md5": "^2.19.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/blueimp-md5": {
|
||||||
|
"version": "2.19.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/blueimp-md5/-/blueimp-md5-2.19.0.tgz",
|
||||||
|
"integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
5
weixin-miniprogram/package.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"dependencies": {
|
||||||
|
"blueimp-md5": "^2.19.0"
|
||||||
|
}
|
||||||
|
}
|
111
weixin-miniprogram/pages/index/index.js
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
// pages/index/index.js
|
||||||
|
const menuItemDict = require('../../utils/menuList.js')
|
||||||
|
const getUserGroupByRole = require('../../utils/getUserGroupByRole.js')
|
||||||
|
|
||||||
|
const app = getApp()
|
||||||
|
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
debugText: "调试",
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
console.log("index/index onLoad", options)
|
||||||
|
// console.log("wx.getLaunchOptionsSync()", wx.getLaunchOptionsSync())
|
||||||
|
this.setData({
|
||||||
|
debugText: JSON.stringify(options, null, 4),
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
console.log("menuItemDict", menuItemDict)
|
||||||
|
this.userInfo = wx.getStorageSync("userInfo")
|
||||||
|
this.displayUsername = this.userInfo?.username ?? "请登录"
|
||||||
|
if (!this.userInfo) {
|
||||||
|
console.log("用户未登录")
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '/pages/index/login'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 用户已登录
|
||||||
|
this.userGroup = getUserGroupByRole(this.userInfo.role)
|
||||||
|
this.debugObject = {
|
||||||
|
userGroup: this.userGroup
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断用户是否是通过扫小程序码进来的
|
||||||
|
if (options.scene) {
|
||||||
|
// 扫门禁的小程序码
|
||||||
|
if (options.scene.split('%')[0] == "guard") {
|
||||||
|
options.scene = null
|
||||||
|
wx.navigateTo({
|
||||||
|
url: "/pages/scan/entrance"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 开发模式下自动跳转到指定页面,节省开发时间
|
||||||
|
console.log("app.globalData", app.globalData)
|
||||||
|
if (app.globalData.debugMode) {
|
||||||
|
wx.switchTab({
|
||||||
|
url: '/pages/residents/report'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
console.log("index/index onReady")
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
console.log("index/index onShow")
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
console.log("index/index onHide")
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
console.log("index/index onUnload")
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
console.log("index/index onPullDownRefresh")
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
console.log("index/index onReachBottom")
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
console.log("index/index onShareAppMessage")
|
||||||
|
}
|
||||||
|
})
|
5
weixin-miniprogram/pages/index/index.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {},
|
||||||
|
"navigationBarTitleText": "首页",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
21
weixin-miniprogram/pages/index/index.wxml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<!--pages/index/index.wxml-->
|
||||||
|
<view>
|
||||||
|
<image src="../../image/home.jpg" style="width: 100vw; height: 41.5vw;"></image>
|
||||||
|
<view style="display: block; padding-left: 30px; padding-top: 12px;">
|
||||||
|
<text>欢迎你,{{ displayUsername }}!</text>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<text>调试信息:{{ debugText }}</text>
|
||||||
|
</view>
|
||||||
|
<view id="menu-view">
|
||||||
|
<view class="menu-item" v-for="menuItem in filterMenuItems" :key="menuItem.id">
|
||||||
|
<view :class="{ 'add-dot': menuItem.addDot }" style="display: inline-block;">
|
||||||
|
<image :src="'../../image/icon/' + menuItem.image" class="item-image" bindtap='switchTo(menuItem.switchFunc, menuItem.url)'></image>
|
||||||
|
</view>
|
||||||
|
<view>{{ menuItem.title }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<button type="primary" size="mini" bindtap="toggleDot('code', true)">显示小红点</button>
|
||||||
|
<button type="primary" size="mini" bindtap="toggleDot('code', false)">隐藏小红点</button>
|
||||||
|
<button type="warn" size="mini" bindtap="magicButton">魔法按钮</button>
|
||||||
|
</view>
|
1
weixin-miniprogram/pages/index/index.wxss
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* pages/index/index.wxss */
|
129
weixin-miniprogram/pages/index/login.js
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
// pages/index/login.js
|
||||||
|
const app = getApp();
|
||||||
|
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
username: '',
|
||||||
|
password: '',
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
bindKeyInput: function (e) {
|
||||||
|
// console.log('e', e)
|
||||||
|
let newData = {}
|
||||||
|
newData[e.target.id] = e.detail.value
|
||||||
|
this.setData(newData)
|
||||||
|
},
|
||||||
|
|
||||||
|
login() {
|
||||||
|
console.log("login userInput", this.data.username, this.data.password)
|
||||||
|
if (!this.data.username || !this.data.password) {
|
||||||
|
wx.showToast({
|
||||||
|
title: "请完善登录信息",
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中'
|
||||||
|
})
|
||||||
|
wx.request({
|
||||||
|
url: `${app.globalData.baseUrl}/user/login`,
|
||||||
|
method: "POST",
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded" //用于post
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
username: this.data.username,
|
||||||
|
password: this.data.password,
|
||||||
|
},
|
||||||
|
success: function (d) {
|
||||||
|
wx.hideLoading()
|
||||||
|
let result = d.data;
|
||||||
|
if (result.success) {
|
||||||
|
// 登录成功
|
||||||
|
wx.setStorageSync("userInfo", result.data.userInfo);
|
||||||
|
console.log("userInfo", wx.getStorageSync("userInfo"))
|
||||||
|
wx.switchTab({
|
||||||
|
url: '/pages/index/index'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: result.msg,
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function () {
|
||||||
|
wx.hideLoading()
|
||||||
|
wx.showToast({
|
||||||
|
title: "请求失败",
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
4
weixin-miniprogram/pages/index/login.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {},
|
||||||
|
"navigationBarTitleText": "登录"
|
||||||
|
}
|
19
weixin-miniprogram/pages/index/login.wxml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<!--pages/index/login.wxml-->
|
||||||
|
<view class="container">
|
||||||
|
<view class="login-icon">
|
||||||
|
<image class="login-img" src="../../image/icon/login-background.svg"></image>
|
||||||
|
</view>
|
||||||
|
<view class="login-from">
|
||||||
|
<view class="inputView">
|
||||||
|
<!--账号-->
|
||||||
|
<input class="inputText" placeholder="账号" id="username" bindinput="bindKeyInput" />
|
||||||
|
<!--密码-->
|
||||||
|
<input class="inputText" placeholder="密码" id="password" bindinput="bindKeyInput" password="true" />
|
||||||
|
</view>
|
||||||
|
<view class="loginBtnView">
|
||||||
|
<!--按钮-->
|
||||||
|
<button class="loginBtn" type="primary" bindtap="login">登录</button>
|
||||||
|
<button class="loginBtn" type="secondary" bindtap="visitor">访客申请</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
31
weixin-miniprogram/pages/index/login.wxss
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/* pages/index/login.wxss */
|
||||||
|
.container {
|
||||||
|
line-height: 1.5em;
|
||||||
|
padding: 30px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-icon {
|
||||||
|
text-align: center;
|
||||||
|
height: 35vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-img {
|
||||||
|
width: 50vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-from {
|
||||||
|
padding: 0 20vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inputText {
|
||||||
|
width: 95%;
|
||||||
|
border-bottom: solid 1px;
|
||||||
|
margin-bottom: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loginBtnView {
|
||||||
|
margin-top: 70px;
|
||||||
|
}
|
||||||
|
.loginBtn {
|
||||||
|
margin-bottom: 25px;
|
||||||
|
}
|
48
weixin-miniprogram/pages/index2/index.js
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
// index.js
|
||||||
|
// 获取应用实例
|
||||||
|
const app = getApp()
|
||||||
|
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
motto: 'Hello World',
|
||||||
|
userInfo: {},
|
||||||
|
hasUserInfo: false,
|
||||||
|
canIUse: wx.canIUse('button.open-type.getUserInfo'),
|
||||||
|
canIUseGetUserProfile: false,
|
||||||
|
canIUseOpenData: wx.canIUse('open-data.type.userAvatarUrl') && wx.canIUse('open-data.type.userNickName') // 如需尝试获取用户信息可改为false
|
||||||
|
},
|
||||||
|
// 事件处理函数
|
||||||
|
bindViewTap() {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: '../logs/logs'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
if (wx.getUserProfile) {
|
||||||
|
this.setData({
|
||||||
|
canIUseGetUserProfile: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getUserProfile(e) {
|
||||||
|
// 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认,开发者妥善保管用户快速填写的头像昵称,避免重复弹窗
|
||||||
|
wx.getUserProfile({
|
||||||
|
desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
|
||||||
|
success: (res) => {
|
||||||
|
console.log(res)
|
||||||
|
this.setData({
|
||||||
|
userInfo: res.userInfo,
|
||||||
|
hasUserInfo: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getUserInfo(e) {
|
||||||
|
// 不推荐使用getUserInfo获取用户信息,预计自2021年4月13日起,getUserInfo将不再弹出弹窗,并直接返回匿名的用户个人信息
|
||||||
|
console.log(e)
|
||||||
|
this.setData({
|
||||||
|
userInfo: e.detail.userInfo,
|
||||||
|
hasUserInfo: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
3
weixin-miniprogram/pages/index2/index.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
23
weixin-miniprogram/pages/index2/index.wxml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<!--index.wxml-->
|
||||||
|
<view class="container">
|
||||||
|
<view class="userinfo">
|
||||||
|
<block wx:if="{{canIUseOpenData}}">
|
||||||
|
<view class="userinfo-avatar" bindtap="bindViewTap">
|
||||||
|
<open-data type="userAvatarUrl"></open-data>
|
||||||
|
</view>
|
||||||
|
<open-data type="userNickName"></open-data>
|
||||||
|
</block>
|
||||||
|
<block wx:elif="{{!hasUserInfo}}">
|
||||||
|
<button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> 获取头像昵称 </button>
|
||||||
|
<button wx:elif="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
|
||||||
|
<view wx:else> 请使用1.4.4及以上版本基础库 </view>
|
||||||
|
</block>
|
||||||
|
<block wx:else>
|
||||||
|
<image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
|
||||||
|
<text class="userinfo-nickname">{{userInfo.nickName}}</text>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
<view class="usermotto">
|
||||||
|
<text class="user-motto">{{motto}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
19
weixin-miniprogram/pages/index2/index.wxss
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/**index.wxss**/
|
||||||
|
.userinfo {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
color: #aaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.userinfo-avatar {
|
||||||
|
overflow: hidden;
|
||||||
|
width: 128rpx;
|
||||||
|
height: 128rpx;
|
||||||
|
margin: 20rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.usermotto {
|
||||||
|
margin-top: 200px;
|
||||||
|
}
|
18
weixin-miniprogram/pages/logs/logs.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
// logs.js
|
||||||
|
const util = require('../../utils/util.js')
|
||||||
|
|
||||||
|
Page({
|
||||||
|
data: {
|
||||||
|
logs: []
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.setData({
|
||||||
|
logs: (wx.getStorageSync('logs') || []).map(log => {
|
||||||
|
return {
|
||||||
|
date: util.formatTime(new Date(log)),
|
||||||
|
timeStamp: log
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
4
weixin-miniprogram/pages/logs/logs.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"navigationBarTitleText": "查看启动日志",
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
6
weixin-miniprogram/pages/logs/logs.wxml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<!--logs.wxml-->
|
||||||
|
<view class="container log-list">
|
||||||
|
<block wx:for="{{logs}}" wx:key="timeStamp" wx:for-item="log">
|
||||||
|
<text class="log-item">{{index + 1}}. {{log.date}}</text>
|
||||||
|
</block>
|
||||||
|
</view>
|
8
weixin-miniprogram/pages/logs/logs.wxss
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
.log-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 40rpx;
|
||||||
|
}
|
||||||
|
.log-item {
|
||||||
|
margin: 10rpx;
|
||||||
|
}
|
66
weixin-miniprogram/pages/person/person.js
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
// pages/person/person.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
4
weixin-miniprogram/pages/person/person.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {},
|
||||||
|
"navigationBarTitleText": "我"
|
||||||
|
}
|
2
weixin-miniprogram/pages/person/person.wxml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<!--pages/person/person.wxml-->
|
||||||
|
<text>pages/person/person.wxml</text>
|
1
weixin-miniprogram/pages/person/person.wxss
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* pages/person/person.wxss */
|
215
weixin-miniprogram/pages/residents/code.js
Normal file
@ -0,0 +1,215 @@
|
|||||||
|
// pages/residents/code.js
|
||||||
|
import SparkMD5 from '../../utils/spark-md5.min'
|
||||||
|
import utils from '../../utils/util'
|
||||||
|
import drawQrcode from '../../utils/qrcode/index'
|
||||||
|
import scanQRCode from '../../utils/scanQRCode'
|
||||||
|
|
||||||
|
const app = getApp();
|
||||||
|
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
timeInterval: null,
|
||||||
|
isShow: 'none',
|
||||||
|
userText: '',
|
||||||
|
showText: '',
|
||||||
|
showTextColor: '',
|
||||||
|
time: '',
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
console.log('onShow')
|
||||||
|
// setTimeout(this.refershData, 100)
|
||||||
|
this.refershData()
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
console.log('onHide')
|
||||||
|
clearInterval(this.data.timeInterval);
|
||||||
|
this.setData({
|
||||||
|
isShow: 'none',
|
||||||
|
time: ''
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
console.log('onUnload')
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
console.log('onPullDownRefresh')
|
||||||
|
this.refershData(() => {
|
||||||
|
wx.stopPullDownRefresh();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
refershData(callback) {
|
||||||
|
console.log('this.refershData()')
|
||||||
|
wx.showNavigationBarLoading();
|
||||||
|
clearInterval(this.data.timeInterval);
|
||||||
|
this.setData({
|
||||||
|
isShow: 'none',
|
||||||
|
time: '',
|
||||||
|
userInfo: wx.getStorageSync("userInfo"),
|
||||||
|
})
|
||||||
|
if (!this.data.userInfo) {
|
||||||
|
wx.redirectTo({
|
||||||
|
url: '/pages/index/login'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中'
|
||||||
|
})
|
||||||
|
var that = this;
|
||||||
|
wx.request({
|
||||||
|
url: `${app.globalData.baseUrl}/access/code/getCodeInfo`,
|
||||||
|
method: "POST",
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded" //用于post
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
id: this.data.userInfo.id,
|
||||||
|
},
|
||||||
|
success: function (d) {
|
||||||
|
console.log("begin success")
|
||||||
|
wx.hideLoading()
|
||||||
|
let result = d.data;
|
||||||
|
if (result.success) {
|
||||||
|
console.log("result.data", result.data);
|
||||||
|
that.setData({
|
||||||
|
userText: `${that.data.userInfo.id} | ${that.data.userInfo.realname}`,
|
||||||
|
showText: result.data.infoText,
|
||||||
|
showTextColor: result.data.infoTextColor
|
||||||
|
})
|
||||||
|
|
||||||
|
let t = Date.now();
|
||||||
|
let chksum = SparkMD5.hash(JSON.stringify({
|
||||||
|
id: that.data.userInfo.id,
|
||||||
|
t: t
|
||||||
|
}));
|
||||||
|
console.log("chksum", chksum)
|
||||||
|
that.drawCode(`https://epp.cxyxiaomo.com/access/validCode?id=${that.data.userInfo.id}&t=${t}&chksum=${chksum}`, result.data.qrcodeColor)
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: result.msg,
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.setData({
|
||||||
|
isShow: ''
|
||||||
|
})
|
||||||
|
console.log("end success")
|
||||||
|
},
|
||||||
|
fail: function () {
|
||||||
|
console.log("begin fail")
|
||||||
|
wx.hideLoading()
|
||||||
|
wx.showToast({
|
||||||
|
title: "请求失败",
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
console.log("end fail")
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
console.log("begin complete")
|
||||||
|
if (typeof (callback) === "function")
|
||||||
|
callback();
|
||||||
|
wx.hideNavigationBarLoading();
|
||||||
|
console.log("end complete")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
drawCode(text = 'https://www.baidu.com/', foreground = 'red') {
|
||||||
|
console.log("drawCode was called.")
|
||||||
|
var that = this;
|
||||||
|
const query = wx.createSelectorQuery()
|
||||||
|
query.select('#myQrcode')
|
||||||
|
.fields({
|
||||||
|
node: true,
|
||||||
|
size: true
|
||||||
|
})
|
||||||
|
.exec(async (res) => {
|
||||||
|
console.log("before drawQrcode")
|
||||||
|
var canvas = res[0].node
|
||||||
|
if (!canvas) {
|
||||||
|
wx.showToast({
|
||||||
|
title: "canvas获取失败",
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log("canvas:", canvas, "res:", res)
|
||||||
|
// 调用方法drawQrcode生成二维码
|
||||||
|
await drawQrcode(wx, {
|
||||||
|
canvas: canvas,
|
||||||
|
canvasId: 'myQrcode',
|
||||||
|
width: 150,
|
||||||
|
padding: 0,
|
||||||
|
background: '#ffffff',
|
||||||
|
foreground: foreground,
|
||||||
|
text: text,
|
||||||
|
})
|
||||||
|
console.log("end drawQrcode")
|
||||||
|
|
||||||
|
this.updateTime();
|
||||||
|
this.setData({
|
||||||
|
timeInterval: setInterval(this.updateTime, 1000)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
updateTime() {
|
||||||
|
this.setData({
|
||||||
|
time: utils.formatTime(new Date())
|
||||||
|
})
|
||||||
|
console.log("刷新时间")
|
||||||
|
},
|
||||||
|
scan() {
|
||||||
|
scanQRCode(wx)
|
||||||
|
}
|
||||||
|
})
|
5
weixin-miniprogram/pages/residents/code.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {},
|
||||||
|
"navigationBarTitleText": "身份码",
|
||||||
|
"enablePullDownRefresh": true
|
||||||
|
}
|
10
weixin-miniprogram/pages/residents/code.wxml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<!--pages/residents/code.wxml-->
|
||||||
|
<view id="codeView" :style="{ display: isShow }">
|
||||||
|
<view id="user-text"><text>{{ userText }}</text></view>
|
||||||
|
<view id="time-text"><text>{{ time }}</text></view>
|
||||||
|
<canvas type="2d" style="width: 250px; height: 250px;" id="myQrcode"></canvas>
|
||||||
|
<view id="show-text"><text style="color: {{ showTextColor }}">{{ showText }}</text></view>
|
||||||
|
<view id="small-text"><text>下拉可刷新</text></view>
|
||||||
|
|
||||||
|
<button id="scan-btn" size="mini" bindtap="scan">扫门禁码</button>
|
||||||
|
</view>
|
37
weixin-miniprogram/pages/residents/code.wxss
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/* pages/residents/code.wxss */
|
||||||
|
#codeView {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#user-text {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#time-text {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 22px;
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#myQrcode {
|
||||||
|
display: block;
|
||||||
|
margin: 30px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#show-text {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#small-text {
|
||||||
|
margin-top: 30px;
|
||||||
|
color: grey;
|
||||||
|
font-size: small;
|
||||||
|
}
|
||||||
|
|
||||||
|
#scan-btn {
|
||||||
|
margin-top: 20px;
|
||||||
|
padding: 9px 60px;
|
||||||
|
font-size: initial;
|
||||||
|
}
|
291
weixin-miniprogram/pages/residents/report.js
Normal file
@ -0,0 +1,291 @@
|
|||||||
|
// pages/residents/report.js
|
||||||
|
import utils from '../../utils/util'
|
||||||
|
|
||||||
|
const app = getApp();
|
||||||
|
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
isSkipOnShowFunc: false, // 是否跳过 onShow
|
||||||
|
userInfo: null,
|
||||||
|
timeInterval: null,
|
||||||
|
formData: {
|
||||||
|
userId: '',
|
||||||
|
userRealname: '',
|
||||||
|
address: '',
|
||||||
|
time: '',
|
||||||
|
timestamp: '',
|
||||||
|
temperature: 0,
|
||||||
|
},
|
||||||
|
// 是否填报过
|
||||||
|
isFilled: true,
|
||||||
|
filledMsg: "",
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
if (this.data.isSkipOnShowFunc) {
|
||||||
|
this.setData({
|
||||||
|
isSkipOnShowFunc: false,
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('onShow')
|
||||||
|
let userInfo = wx.getStorageSync("userInfo")
|
||||||
|
console.log("userInfo", userInfo)
|
||||||
|
this.setData({
|
||||||
|
userInfo: userInfo,
|
||||||
|
"formData.userId": userInfo.id,
|
||||||
|
"formData.userRealname": userInfo.realname,
|
||||||
|
timeInterval: setInterval(this.updateTime, 1000)
|
||||||
|
})
|
||||||
|
console.log("formData", this.data.formData)
|
||||||
|
|
||||||
|
this.updateTime();
|
||||||
|
|
||||||
|
// 获取用户当日是否填报过
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中'
|
||||||
|
})
|
||||||
|
var that = this;
|
||||||
|
wx.request({
|
||||||
|
url: `${app.globalData.baseUrl}/access/report/getLatestRecord`,
|
||||||
|
method: "POST",
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded" //用于post
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
userId: this.data.userInfo.id
|
||||||
|
},
|
||||||
|
success: function (d) {
|
||||||
|
wx.hideLoading()
|
||||||
|
let result = d.data
|
||||||
|
console.log("result", result)
|
||||||
|
if (result.success) {
|
||||||
|
console.log("result.data", result.data);
|
||||||
|
if (result.data == null || new Date(result.data.time) < new Date(new Date().toISOString().substring(0, 10))) {
|
||||||
|
// 如果没有填报记录,或者填报记录不是今天,那么说明没有填报过
|
||||||
|
that.setData({
|
||||||
|
isFilled: false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 有今日记录,说明已经填报过
|
||||||
|
that.setData({
|
||||||
|
isFilled: true,
|
||||||
|
filledMsg: "您已完成今日体温填报"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: "加载填报信息失败",
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function () {
|
||||||
|
wx.hideLoading()
|
||||||
|
wx.showToast({
|
||||||
|
title: "请求失败",
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
wx.hideNavigationBarLoading();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
bindTemperatureChanged(e) {
|
||||||
|
this.setData({
|
||||||
|
"formData.temperature": e.detail.value
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
updateTime() {
|
||||||
|
let timestamp = Date.now()
|
||||||
|
this.setData({
|
||||||
|
"formData.timestamp": timestamp,
|
||||||
|
"formData.time": utils.formatTime(new Date(timestamp))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
chooseLocation: async function () {
|
||||||
|
wx.showLoading({
|
||||||
|
title: '正在获取权限'
|
||||||
|
})
|
||||||
|
await new Promise((resolve) => {
|
||||||
|
wx.getSetting({
|
||||||
|
success(res) {
|
||||||
|
wx.hideLoading()
|
||||||
|
if (!res.authSetting['scope.userLocation']) {
|
||||||
|
wx.authorize({
|
||||||
|
scope: 'scope.userLocationBackground',
|
||||||
|
success() {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
resolve();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
wx.showLoading({
|
||||||
|
title: '正在定位'
|
||||||
|
})
|
||||||
|
var that = this;
|
||||||
|
this.setData({
|
||||||
|
isSkipOnShowFunc: true, // 关闭位置选择器后,会触发 onShow,这里避免掉
|
||||||
|
})
|
||||||
|
wx.chooseLocation({
|
||||||
|
success: function (res) {
|
||||||
|
console.log("wx.chooseLocation success")
|
||||||
|
that.setData({
|
||||||
|
"formData.address": res.address
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: function () {
|
||||||
|
console.log("wx.chooseLocation fail", that.data.formData)
|
||||||
|
if (!that.data.formData.address) {
|
||||||
|
wx.showToast({
|
||||||
|
title: "请获取当前位置",
|
||||||
|
icon: 'error'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
wx.hideLoading()
|
||||||
|
},
|
||||||
|
// 体温上报 提交按钮
|
||||||
|
report() {
|
||||||
|
console.log("点击提交", "this.data.formData", this.data.formData)
|
||||||
|
if (!this.data.formData.address) {
|
||||||
|
wx.showToast({
|
||||||
|
title: "请获取当前位置",
|
||||||
|
icon: 'error'
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中'
|
||||||
|
})
|
||||||
|
var that = this;
|
||||||
|
wx.request({
|
||||||
|
url: `${app.globalData.baseUrl}/access/report/submit`,
|
||||||
|
method: "POST",
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded" //用于post
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
...this.data.formData,
|
||||||
|
},
|
||||||
|
success: function (d) {
|
||||||
|
console.log("begin success")
|
||||||
|
wx.hideLoading()
|
||||||
|
let result = d.data;
|
||||||
|
if (result.success) {
|
||||||
|
// 填报完成
|
||||||
|
that.setData({
|
||||||
|
isFilled: true,
|
||||||
|
filledMsg: "您已完成今日体温填报"
|
||||||
|
})
|
||||||
|
console.log("result.data", result.data);
|
||||||
|
wx.showToast({
|
||||||
|
title: "填报成功",
|
||||||
|
icon: 'success',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: result.msg || "出错啦",
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.isShow = ''
|
||||||
|
console.log("end success")
|
||||||
|
},
|
||||||
|
fail: function () {
|
||||||
|
console.log("begin fail")
|
||||||
|
wx.hideLoading()
|
||||||
|
wx.showToast({
|
||||||
|
title: "请求失败",
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
console.log("end fail")
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
console.log("begin complete")
|
||||||
|
if (typeof (callback) === "function")
|
||||||
|
callback();
|
||||||
|
wx.hideNavigationBarLoading();
|
||||||
|
console.log("end complete")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 历史填报
|
||||||
|
myreport() {
|
||||||
|
wx.navigateTo({
|
||||||
|
url: "/pages/residents/reportHistory"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
4
weixin-miniprogram/pages/residents/report.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {},
|
||||||
|
"navigationBarTitleText": "体温上报"
|
||||||
|
}
|
59
weixin-miniprogram/pages/residents/report.wxml
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<!--pages/residents/report.wxml-->
|
||||||
|
<view>
|
||||||
|
<view wx:if="{{ !isFilled }}" class="form">
|
||||||
|
<view class="row">
|
||||||
|
<view class="rowItem rowLeft center">
|
||||||
|
<text>姓名</text>
|
||||||
|
</view>
|
||||||
|
<view class="rowItem rowRight center">
|
||||||
|
<input class="rowRightElement" value="{{ formData.userRealname }}" disabled="true" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="row">
|
||||||
|
<view class="rowItem rowLeft center">
|
||||||
|
<text>填报时间</text>
|
||||||
|
</view>
|
||||||
|
<view class="rowItem rowRight center">
|
||||||
|
<input class="rowRightElement" value="{{ formData.time }}" disabled="true" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="row">
|
||||||
|
<view class="rowItem rowLeft center">
|
||||||
|
<text>地址</text>
|
||||||
|
</view>
|
||||||
|
<view class="rowItem rowRight center" bindtap="chooseLocation">
|
||||||
|
<input class="rowRightElement" placeholder="点击获取当前位置" value="{{ formData.address }}" disabled="true" maxlength="500" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="row">
|
||||||
|
<view class="rowItem rowLeft center">
|
||||||
|
<text>今日体温</text>
|
||||||
|
</view>
|
||||||
|
<view class="rowItem rowRight center">
|
||||||
|
<radio-group class="rowRightElement" bindchange="bindTemperatureChanged">
|
||||||
|
<radio value="0" checked="true" />正常
|
||||||
|
<radio value="1" />异常(≥37.3°)
|
||||||
|
</radio-group>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="tips-area">
|
||||||
|
<view class="tips" style="color: red;">
|
||||||
|
* 本人承诺以上所填报的内容全部真实,并愿意承担相应责任。
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view style="text-align: center;">
|
||||||
|
<button class="controlBtn" size="mini" type="none" bindtap="myreport">历史填报</button>
|
||||||
|
<button class="controlBtn" size="mini" type="primary" bindtap="report">提交</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view wx:else style="text-align: center;">
|
||||||
|
<!-- -->
|
||||||
|
<view style="margin: 40px 0;">{{ filledMsg }}</view>
|
||||||
|
<button class="controlBtn" size="mini" type="none" bindtap="myreport">历史填报</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
39
weixin-miniprogram/pages/residents/report.wxss
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
/* pages/residents/report.wxss */
|
||||||
|
.form {
|
||||||
|
padding: 20px 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row {
|
||||||
|
margin: 30px 0;
|
||||||
|
border-bottom: 2px solid grey;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rowItem {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
vertical-align: middle;
|
||||||
|
height: 1.6rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rowLeft {
|
||||||
|
width: 30%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rowRight {
|
||||||
|
width: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rowRightElement {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.controlBtn {
|
||||||
|
width: 250px;
|
||||||
|
margin: 0 30px;
|
||||||
|
}
|
125
weixin-miniprogram/pages/residents/reportHistory.js
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
// pages/residents/reportHistory.js
|
||||||
|
|
||||||
|
const app = getApp();
|
||||||
|
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
userInfo: null,
|
||||||
|
displayName: '',
|
||||||
|
displayResult: [],
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
console.log('onShow')
|
||||||
|
let userInfo = wx.getStorageSync("userInfo")
|
||||||
|
this.setData({
|
||||||
|
userInfo: userInfo,
|
||||||
|
displayName: userInfo.realname
|
||||||
|
})
|
||||||
|
|
||||||
|
// 获取用户填报历史
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中'
|
||||||
|
})
|
||||||
|
var that = this;
|
||||||
|
wx.request({
|
||||||
|
url: `${app.globalData.baseUrl}/access/report/getRecordList`,
|
||||||
|
method: "POST",
|
||||||
|
header: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded" //用于post
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
userId: this.data.userInfo.id
|
||||||
|
},
|
||||||
|
success: function (d) {
|
||||||
|
wx.hideLoading()
|
||||||
|
let result = d.data
|
||||||
|
console.log("result", result)
|
||||||
|
if (result.success) {
|
||||||
|
console.log("result.data", result.data)
|
||||||
|
that.setData({
|
||||||
|
displayResult: result.data.map(item => {
|
||||||
|
// 时间友好化显示
|
||||||
|
let t = new Date(item.time).getTime() + 8 * 3600 * 1000
|
||||||
|
item.time = new Date(t).toISOString().substring(0, 19).replace("T", " ")
|
||||||
|
return item
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: "加载填报信息失败",
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: function () {
|
||||||
|
wx.hideLoading()
|
||||||
|
wx.showToast({
|
||||||
|
title: "请求失败",
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
wx.hideNavigationBarLoading();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
4
weixin-miniprogram/pages/residents/reportHistory.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {},
|
||||||
|
"navigationBarTitleText": "体温上报 - 历史记录"
|
||||||
|
}
|
21
weixin-miniprogram/pages/residents/reportHistory.wxml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<!--pages/residents/reportHistory.wxml-->
|
||||||
|
<view>
|
||||||
|
<view style="margin: 20px; text-align: center;">
|
||||||
|
<text>姓名:{{ displayName }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="container">
|
||||||
|
<view class="item {{ item.temperature == 1 ? 'abnormal' : 'normal' }}" wx:for="{{displayResult}}" wx:for-item="item">
|
||||||
|
<view>
|
||||||
|
<view class="record_time">
|
||||||
|
<!-- 填报时间: -->
|
||||||
|
{{ item.time }}
|
||||||
|
</view>
|
||||||
|
<view class="record_address">
|
||||||
|
<!-- 地址: -->
|
||||||
|
{{ item.address }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="statusText">{{ item.temperature == 1 ? "异常" : "正常" }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
33
weixin-miniprogram/pages/residents/reportHistory.wxss
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
/* pages/residents/reportHistory.wxss */
|
||||||
|
.item {
|
||||||
|
/* background-color: #dedede; */
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 12px 20px;
|
||||||
|
padding: 18px;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr auto;
|
||||||
|
place-items: center;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item.normal {
|
||||||
|
background-color: green;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item.abnormal {
|
||||||
|
background-color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.record_time {
|
||||||
|
font-size: 17px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.record_address {
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.statusText {
|
||||||
|
font-size: large;
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
66
weixin-miniprogram/pages/scan/entrance.js
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
// pages/scan/entrance.js
|
||||||
|
Page({
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面的初始数据
|
||||||
|
*/
|
||||||
|
data: {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面加载
|
||||||
|
*/
|
||||||
|
onLoad(options) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面初次渲染完成
|
||||||
|
*/
|
||||||
|
onReady() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面显示
|
||||||
|
*/
|
||||||
|
onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面隐藏
|
||||||
|
*/
|
||||||
|
onHide() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生命周期函数--监听页面卸载
|
||||||
|
*/
|
||||||
|
onUnload() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
|
*/
|
||||||
|
onPullDownRefresh() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面上拉触底事件的处理函数
|
||||||
|
*/
|
||||||
|
onReachBottom() {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户点击右上角分享
|
||||||
|
*/
|
||||||
|
onShareAppMessage() {
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
4
weixin-miniprogram/pages/scan/entrance.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"usingComponents": {},
|
||||||
|
"navigationBarTitleText": "进入社区"
|
||||||
|
}
|
4
weixin-miniprogram/pages/scan/entrance.wxml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<!--pages/scan/entrance.wxml-->
|
||||||
|
<view>
|
||||||
|
您将要进入社区
|
||||||
|
</view>
|
1
weixin-miniprogram/pages/scan/entrance.wxss
Normal file
@ -0,0 +1 @@
|
|||||||
|
/* pages/scan/entrance.wxss */
|
51
weixin-miniprogram/project.config.json
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
{
|
||||||
|
"description": "项目配置文件",
|
||||||
|
"packOptions": {
|
||||||
|
"ignore": [],
|
||||||
|
"include": []
|
||||||
|
},
|
||||||
|
"setting": {
|
||||||
|
"bundle": false,
|
||||||
|
"userConfirmedBundleSwitch": false,
|
||||||
|
"urlCheck": true,
|
||||||
|
"scopeDataCheck": false,
|
||||||
|
"coverView": true,
|
||||||
|
"es6": true,
|
||||||
|
"postcss": true,
|
||||||
|
"compileHotReLoad": false,
|
||||||
|
"lazyloadPlaceholderEnable": false,
|
||||||
|
"preloadBackgroundData": false,
|
||||||
|
"minified": true,
|
||||||
|
"autoAudits": false,
|
||||||
|
"newFeature": false,
|
||||||
|
"uglifyFileName": false,
|
||||||
|
"uploadWithSourceMap": true,
|
||||||
|
"useIsolateContext": true,
|
||||||
|
"nodeModules": false,
|
||||||
|
"enhance": true,
|
||||||
|
"useMultiFrameRuntime": true,
|
||||||
|
"useApiHook": true,
|
||||||
|
"useApiHostProcess": true,
|
||||||
|
"showShadowRootInWxmlPanel": true,
|
||||||
|
"packNpmManually": false,
|
||||||
|
"enableEngineNative": false,
|
||||||
|
"packNpmRelationList": [],
|
||||||
|
"minifyWXSS": true,
|
||||||
|
"showES6CompileOption": false,
|
||||||
|
"minifyWXML": true,
|
||||||
|
"babelSetting": {
|
||||||
|
"ignore": [],
|
||||||
|
"disablePlugins": [],
|
||||||
|
"outputPath": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"compileType": "miniprogram",
|
||||||
|
"libVersion": "2.19.4",
|
||||||
|
"appid": "wx332e2e578f09873a",
|
||||||
|
"projectname": "miniprogram-92",
|
||||||
|
"condition": {},
|
||||||
|
"editorSetting": {
|
||||||
|
"tabIndent": "insertSpaces",
|
||||||
|
"tabSize": 2
|
||||||
|
}
|
||||||
|
}
|
8
weixin-miniprogram/project.private.config.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
||||||
|
"projectname": "weixin-miniprogram",
|
||||||
|
"setting": {
|
||||||
|
"compileHotReLoad": false,
|
||||||
|
"urlCheck": false
|
||||||
|
}
|
||||||
|
}
|
7
weixin-miniprogram/sitemap.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
|
||||||
|
"rules": [{
|
||||||
|
"action": "allow",
|
||||||
|
"page": "*"
|
||||||
|
}]
|
||||||
|
}
|
12
weixin-miniprogram/utils/const.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
module.exports = {
|
||||||
|
user: {
|
||||||
|
role: {
|
||||||
|
ADMIN: 0,
|
||||||
|
STAFF: 1,
|
||||||
|
RESIDENTS_OWNER: 2,
|
||||||
|
RESIDENTS_MEMBER: 3,
|
||||||
|
RESIDENTS_TENENT: 4,
|
||||||
|
VISITOR: 5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
29
weixin-miniprogram/utils/getUserGroupByRole.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
const ENUM = require('./const.js');
|
||||||
|
|
||||||
|
function getUserGroupByRole(userRole) {
|
||||||
|
const role = ENUM.user.role;
|
||||||
|
userRole = Number(userRole);
|
||||||
|
let userGroupDict = {
|
||||||
|
'visitor': [
|
||||||
|
role.VISITOR,
|
||||||
|
].includes(userRole),
|
||||||
|
'user': [
|
||||||
|
role.RESIDENTS_OWNER,
|
||||||
|
role.RESIDENTS_MEMBER,
|
||||||
|
role.RESIDENTS_TENENT,
|
||||||
|
].includes(userRole),
|
||||||
|
'admin': [
|
||||||
|
role.ADMIN,
|
||||||
|
role.STAFF,
|
||||||
|
].includes(userRole)
|
||||||
|
}
|
||||||
|
console.log("userGroupDict", userGroupDict, userRole, role)
|
||||||
|
for (let userGroup of Object.keys(userGroupDict)) {
|
||||||
|
if (userGroupDict[userGroup]) {
|
||||||
|
return userGroup;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 'unknown';
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = getUserGroupByRole;
|
104
weixin-miniprogram/utils/menuList.js
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
const switchTab = "switchTab";
|
||||||
|
const navigateTo = "navigateTo";
|
||||||
|
let id = 0;
|
||||||
|
|
||||||
|
let menuItemDict = {
|
||||||
|
'login': {
|
||||||
|
for: ['unknown'],
|
||||||
|
title: "登录",
|
||||||
|
image: "code.png",
|
||||||
|
switchFunc: switchTab,
|
||||||
|
url: '/pages/index/login',
|
||||||
|
},
|
||||||
|
'code': {
|
||||||
|
for: ['visitor', 'user'],
|
||||||
|
title: "进出码",
|
||||||
|
image: "code.png",
|
||||||
|
switchFunc: switchTab,
|
||||||
|
url: '/pages/residents/code'
|
||||||
|
},
|
||||||
|
'report': {
|
||||||
|
for: ['user'],
|
||||||
|
title: "体温上报",
|
||||||
|
image: "report.png",
|
||||||
|
switchFunc: switchTab,
|
||||||
|
url: '/pages/residents/report'
|
||||||
|
},
|
||||||
|
'apply-record': {
|
||||||
|
for: ['visitor', 'user'],
|
||||||
|
title: "申请记录",
|
||||||
|
image: "apply.png",
|
||||||
|
switchFunc: switchTab,
|
||||||
|
url: ''
|
||||||
|
},
|
||||||
|
'apply-approval': {
|
||||||
|
for: ['admin'],
|
||||||
|
title: "申请审批",
|
||||||
|
image: "apply.png", // ApplyReplay
|
||||||
|
switchFunc: switchTab,
|
||||||
|
url: ''
|
||||||
|
},
|
||||||
|
'visitor-apply': {
|
||||||
|
for: ['admin'],
|
||||||
|
title: "访客审批",
|
||||||
|
image: "visitor.png",
|
||||||
|
switchFunc: switchTab,
|
||||||
|
url: ''
|
||||||
|
},
|
||||||
|
'abnormal': {
|
||||||
|
for: ['admin'],
|
||||||
|
title: "异常人员",
|
||||||
|
image: "danger.png",
|
||||||
|
switchFunc: switchTab,
|
||||||
|
url: ''
|
||||||
|
},
|
||||||
|
'feedback-submit': {
|
||||||
|
for: ['visitor', 'user'],
|
||||||
|
title: "提交反馈",
|
||||||
|
image: "fk.png",
|
||||||
|
switchFunc: switchTab,
|
||||||
|
url: ''
|
||||||
|
},
|
||||||
|
'feedback-list': {
|
||||||
|
for: ['visitor', 'user'],
|
||||||
|
title: "反馈查看",
|
||||||
|
image: "feedback.png",
|
||||||
|
switchFunc: switchTab,
|
||||||
|
url: ''
|
||||||
|
},
|
||||||
|
'feedback-reply': {
|
||||||
|
for: ['admin'],
|
||||||
|
title: "反馈回复",
|
||||||
|
image: "feedback.png",
|
||||||
|
switchFunc: switchTab,
|
||||||
|
url: ''
|
||||||
|
},
|
||||||
|
'update-password': {
|
||||||
|
for: ['user', 'admin'],
|
||||||
|
title: "密码修改",
|
||||||
|
image: "updPwd.png",
|
||||||
|
switchFunc: switchTab,
|
||||||
|
url: ''
|
||||||
|
},
|
||||||
|
'assign': {
|
||||||
|
for: ['admin'],
|
||||||
|
title: "分配账号",
|
||||||
|
image: "count.png",
|
||||||
|
switchFunc: switchTab,
|
||||||
|
url: ''
|
||||||
|
},
|
||||||
|
'unfinish': {
|
||||||
|
for: ['admin'],
|
||||||
|
title: "今日未填", // RedList
|
||||||
|
image: "_report.png",
|
||||||
|
switchFunc: switchTab,
|
||||||
|
url: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let keys = Object.keys(menuItemDict);
|
||||||
|
for (let key of keys) {
|
||||||
|
menuItemDict[key].id = id++;
|
||||||
|
menuItemDict[key].addDot = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = menuItemDict
|
128
weixin-miniprogram/utils/qrcode/index.js
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
// import extend from 'extend'
|
||||||
|
import {
|
||||||
|
QRCode,
|
||||||
|
QRErrorCorrectLevel
|
||||||
|
} from './qrcode'
|
||||||
|
|
||||||
|
// support Chinese
|
||||||
|
function utf16to8(str) {
|
||||||
|
var out, i, len, c
|
||||||
|
out = ''
|
||||||
|
len = str.length
|
||||||
|
for (i = 0; i < len; i++) {
|
||||||
|
c = str.charCodeAt(i)
|
||||||
|
if ((c >= 0x0001) && (c <= 0x007F)) {
|
||||||
|
out += str.charAt(i)
|
||||||
|
} else if (c > 0x07FF) {
|
||||||
|
out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F))
|
||||||
|
out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F))
|
||||||
|
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F))
|
||||||
|
} else {
|
||||||
|
out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F))
|
||||||
|
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
function drawQrcode(Taro, opt) {
|
||||||
|
let defaultOpt = {
|
||||||
|
canvasId: 'myQrcode',
|
||||||
|
canvas: null,
|
||||||
|
text: '爱一个人就要勇敢说出来',
|
||||||
|
width: 260,
|
||||||
|
padding: 20,
|
||||||
|
paddingColor: null, // 默认与background一致
|
||||||
|
typeNumber: -1,
|
||||||
|
correctLevel: QRErrorCorrectLevel.H,
|
||||||
|
background: '#ffffff',
|
||||||
|
foreground: '#000000',
|
||||||
|
image: {
|
||||||
|
imageResource: '',
|
||||||
|
width: 80,
|
||||||
|
height: 80,
|
||||||
|
round: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let options = defaultOpt
|
||||||
|
for (let key in opt) {
|
||||||
|
options[key] = opt[key]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!options.canvasId && !options.canvas) {
|
||||||
|
console.warn('please set canvasId or canvas!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!options.paddingColor) options.paddingColor = options.background
|
||||||
|
|
||||||
|
// createCanvas
|
||||||
|
// create the qrcode itself
|
||||||
|
var qrcode = new QRCode(options.typeNumber, options.correctLevel)
|
||||||
|
qrcode.addData(utf16to8(options.text))
|
||||||
|
qrcode.make()
|
||||||
|
|
||||||
|
const dpr = Taro.getSystemInfoSync().pixelRatio
|
||||||
|
var canvas = options.canvas
|
||||||
|
const ctx = canvas.getContext('2d')
|
||||||
|
canvas.width = options.width * dpr
|
||||||
|
canvas.height = options.width * dpr
|
||||||
|
const width = canvas.width
|
||||||
|
console.log(`canvas, ctx, width, dpr, qrcode, options`, canvas, ctx, width, dpr, qrcode, options)
|
||||||
|
|
||||||
|
// 填充背景色
|
||||||
|
ctx.fillStyle = options.paddingColor
|
||||||
|
// ctx.clearRect(0, 0, width + options.padding * 2, width + options.padding * 2) // 绘制前清空画布
|
||||||
|
ctx.fillRect(0, 0, width + options.padding * 2, width + options.padding * 2);
|
||||||
|
|
||||||
|
var tileW = (width - options.padding * 2) / qrcode.getModuleCount()
|
||||||
|
var tileH = (width - options.padding * 2) / qrcode.getModuleCount()
|
||||||
|
|
||||||
|
// 绘制二维码
|
||||||
|
for (var row = 0; row < qrcode.getModuleCount(); row++) {
|
||||||
|
for (var col = 0; col < qrcode.getModuleCount(); col++) {
|
||||||
|
ctx.fillStyle = qrcode.isDark(row, col) ? options.foreground : options.background
|
||||||
|
var w = (Math.ceil((col + 1) * tileW) - Math.floor(col * tileW))
|
||||||
|
var h = (Math.ceil((row + 1) * tileW) - Math.floor(row * tileW))
|
||||||
|
ctx.fillRect(Math.round(col * tileW) + options.padding, Math.round(row * tileH) + options.padding, w, h);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 绘制中心图标
|
||||||
|
if (options.image.imageResource) {
|
||||||
|
const imgW = options.image.width * dpr
|
||||||
|
const imgH = options.image.height * dpr
|
||||||
|
const dx = (width - imgW) / 2
|
||||||
|
const dy = (width - imgH) / 2
|
||||||
|
if (options.image.round) {
|
||||||
|
// Logo边框
|
||||||
|
const imgW2 = options.image.width * dpr + 30
|
||||||
|
const dx2 = (width - imgW2) / 2
|
||||||
|
const r2 = imgW2 / 2
|
||||||
|
const cx2 = dx2 + r2;
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.arc(cx2, cx2, r2, 0, 2 * Math.PI);
|
||||||
|
ctx.fillStyle = '#ffffff'
|
||||||
|
ctx.fill();
|
||||||
|
ctx.restore();
|
||||||
|
|
||||||
|
// 画Logo
|
||||||
|
const r = imgW / 2
|
||||||
|
const cx = dx + r;
|
||||||
|
const cy = dy + r;
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.arc(cx, cy, r, 0, 2 * Math.PI);
|
||||||
|
ctx.clip();
|
||||||
|
|
||||||
|
ctx.drawImage(options.image.imageResource, dx, dy, imgW, imgW);
|
||||||
|
ctx.restore();
|
||||||
|
} else {
|
||||||
|
ctx.drawImage(options.image.imageResource, dx, dy, imgW, imgH)
|
||||||
|
ctx.restore();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ctx
|
||||||
|
}
|
||||||
|
|
||||||
|
export default drawQrcode
|
1242
weixin-miniprogram/utils/qrcode/qrcode.js
Normal file
1
weixin-miniprogram/utils/qrcode/refer.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
https://github.com/DoctorWei/weapp-qrcode-canvas-2d
|
25
weixin-miniprogram/utils/scanQRCode.js
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
function scanQRCode(Taro) {
|
||||||
|
// 只允许从相机扫码
|
||||||
|
Taro.scanCode({
|
||||||
|
onlyFromCamera: true,
|
||||||
|
success(res) {
|
||||||
|
console.log(res)
|
||||||
|
if (res.scanType == "WX_CODE" && res.path) {
|
||||||
|
let searchParams = res.path.split('?');
|
||||||
|
if (searchParams.length > 1 && searchParams[1].startsWith('scene=guard')) {
|
||||||
|
Taro.navigateTo({
|
||||||
|
url: "/pages/scan/entrance"
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Taro.showToast({
|
||||||
|
title: "您扫描的不是门禁码",
|
||||||
|
icon: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = scanQRCode;
|
1
weixin-miniprogram/utils/spark-md5.min.js
vendored
Normal file
27
weixin-miniprogram/utils/util.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
const formatTime = date => {
|
||||||
|
const year = date.getFullYear()
|
||||||
|
const month = date.getMonth() + 1
|
||||||
|
const day = date.getDate()
|
||||||
|
const hour = date.getHours()
|
||||||
|
const minute = date.getMinutes()
|
||||||
|
const second = date.getSeconds()
|
||||||
|
|
||||||
|
return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
|
||||||
|
}
|
||||||
|
|
||||||
|
const formatDate = date => {
|
||||||
|
const year = date.getFullYear()
|
||||||
|
const month = date.getMonth() + 1
|
||||||
|
const day = date.getDate()
|
||||||
|
|
||||||
|
return [year, month, day].map(formatNumber).join('-')
|
||||||
|
}
|
||||||
|
|
||||||
|
const formatNumber = n => {
|
||||||
|
n = n.toString()
|
||||||
|
return n[1] ? n : `0${n}`
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
formatTime
|
||||||
|
}
|