Merge branch 'backend'
							
								
								
									
										65
									
								
								backend-mock/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,65 @@
 | 
			
		||||
// 1. 导入http模块
 | 
			
		||||
const http = require("http");
 | 
			
		||||
 | 
			
		||||
// 2. 创建一个web服务器对象
 | 
			
		||||
const server = http.createServer();
 | 
			
		||||
 | 
			
		||||
// 3. 监听请求事件
 | 
			
		||||
server.on("request", (req, res) => {
 | 
			
		||||
    //req-->request 请求对象, res-->response 响应对象
 | 
			
		||||
    // 通过响应头设置返回前台数据格式及编码。(解决中文乱码的问题)
 | 
			
		||||
    // res.setHeader('Content-Type', 'text/html;charset=utf-8');
 | 
			
		||||
    //res.write()表示向客户端输出的方法
 | 
			
		||||
    // res.write("hello world,你好nodejs")
 | 
			
		||||
 | 
			
		||||
    res.setHeader('Content-Type', 'text/json;charset=utf-8');
 | 
			
		||||
 | 
			
		||||
    let result = {};
 | 
			
		||||
    if (req.url.startsWith('/user/login')) {
 | 
			
		||||
        result = {
 | 
			
		||||
            success: true,
 | 
			
		||||
            msg: "登录成功",
 | 
			
		||||
            data: {
 | 
			
		||||
                userInfo: {
 | 
			
		||||
                    "id": 1,
 | 
			
		||||
                    "username": "root",
 | 
			
		||||
                    "realname": "管理员",
 | 
			
		||||
                    "idNumber": null,
 | 
			
		||||
                    "phoneNumber": null,
 | 
			
		||||
                    "role": 1,
 | 
			
		||||
                    "buildingId": null,
 | 
			
		||||
                    "doorplate": null,
 | 
			
		||||
                    "permission": "0",
 | 
			
		||||
                    "permissionTime": null
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            // success: false,
 | 
			
		||||
            // msg: "用户名或密码不正确",
 | 
			
		||||
            // data: null
 | 
			
		||||
        };
 | 
			
		||||
    } else {
 | 
			
		||||
        result = {
 | 
			
		||||
            code: 500,
 | 
			
		||||
            msg: "服务器内部错误",
 | 
			
		||||
            extra: {
 | 
			
		||||
                url: req.url,
 | 
			
		||||
                method: req.method,
 | 
			
		||||
                headers: req.headers,
 | 
			
		||||
                req: Object.keys(req),
 | 
			
		||||
                res: Object.keys(res)
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
    res.write(JSON.stringify(result));
 | 
			
		||||
 | 
			
		||||
    //res.end()每次响应完,需要调用此方法 来结束响束
 | 
			
		||||
    res.end();
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
// 4. 监听端口,为了避免端口冲突,这里给一个本机端口3000
 | 
			
		||||
server.listen(8080, () => {
 | 
			
		||||
    let baseUrl = 'http://localhost:8080';
 | 
			
		||||
    console.log(`服务启动成功: ${baseUrl}/`);
 | 
			
		||||
    console.log();
 | 
			
		||||
    console.log(`${baseUrl}/user/login`);
 | 
			
		||||
}) 
 | 
			
		||||
							
								
								
									
										4
									
								
								backend/.idea/encodings.xml
									
									
									
										generated
									
									
									
								
							
							
						
						@@ -1,10 +1,10 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
 | 
			
		||||
    <file url="file://$PROJECT_DIR$/microservice-common/src/main/java" charset="UTF-8" />
 | 
			
		||||
    <file url="file://$PROJECT_DIR$/microservice-common/src/main/resources" charset="UTF-8" />
 | 
			
		||||
    <file url="file://$PROJECT_DIR$/microservice-gateway/src/main/java" charset="UTF-8" />
 | 
			
		||||
    <file url="file://$PROJECT_DIR$/microservice-gateway/src/main/resources" charset="UTF-8" />
 | 
			
		||||
    <file url="file://$PROJECT_DIR$/microservice-pojo/src/main/java" charset="UTF-8" />
 | 
			
		||||
    <file url="file://$PROJECT_DIR$/microservice-pojo/src/main/resources" charset="UTF-8" />
 | 
			
		||||
    <file url="file://$PROJECT_DIR$/microservice-provider-miniprogram-8080/src/main/java" charset="UTF-8" />
 | 
			
		||||
    <file url="file://$PROJECT_DIR$/microservice-provider-miniprogram-8080/src/main/resources" charset="UTF-8" />
 | 
			
		||||
    <file url="file://$PROJECT_DIR$/microservice-provider-test-8011/src/main/java" charset="UTF-8" />
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								backend/.idea/misc.xml
									
									
									
										generated
									
									
									
								
							
							
						
						@@ -6,6 +6,7 @@
 | 
			
		||||
      <list>
 | 
			
		||||
        <option value="$PROJECT_DIR$/pom.xml" />
 | 
			
		||||
        <option value="$PROJECT_DIR$/microservice-api/pom.xml" />
 | 
			
		||||
        <option value="$PROJECT_DIR$/microservice-common/pom.xml" />
 | 
			
		||||
      </list>
 | 
			
		||||
    </option>
 | 
			
		||||
  </component>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								backend/.idea/runConfigurations/Gateway.xml
									
									
									
										generated
									
									
									
								
							
							
						
						@@ -2,7 +2,7 @@
 | 
			
		||||
  <configuration default="false" name="Gateway" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
 | 
			
		||||
    <option name="ACTIVE_PROFILES" />
 | 
			
		||||
    <module name="microservice-gateway" />
 | 
			
		||||
    <option name="SPRING_BOOT_MAIN_CLASS" value="com.cxyxiaomo.epp.Gateway" />
 | 
			
		||||
    <option name="SPRING_BOOT_MAIN_CLASS" value="com.cxyxiaomo.epp.gateway.Gateway" />
 | 
			
		||||
    <extension name="coverage">
 | 
			
		||||
      <pattern>
 | 
			
		||||
        <option name="PATTERN" value="com.cxyxiaomo.epp.*" />
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								backend/.idea/runConfigurations/MiniProgram.xml
									
									
									
										generated
									
									
									
								
							
							
						
						@@ -2,7 +2,7 @@
 | 
			
		||||
  <configuration default="false" name="MiniProgram" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
 | 
			
		||||
    <option name="ACTIVE_PROFILES" />
 | 
			
		||||
    <module name="microservice-provider-miniprogram-8080" />
 | 
			
		||||
    <option name="SPRING_BOOT_MAIN_CLASS" value="com.cxyxiaomo.epp.Application" />
 | 
			
		||||
    <option name="SPRING_BOOT_MAIN_CLASS" value="com.cxyxiaomo.epp.miniprogram.Application" />
 | 
			
		||||
    <method v="2">
 | 
			
		||||
      <option name="Make" enabled="true" />
 | 
			
		||||
    </method>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								backend/.idea/runConfigurations/TestProvider.xml
									
									
									
										generated
									
									
									
								
							
							
						
						@@ -2,7 +2,7 @@
 | 
			
		||||
  <configuration default="false" name="TestProvider" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
 | 
			
		||||
    <option name="ACTIVE_PROFILES" />
 | 
			
		||||
    <module name="microservice-provider-test-8011" />
 | 
			
		||||
    <option name="SPRING_BOOT_MAIN_CLASS" value="com.cxyxiaomo.epp.TestProvider" />
 | 
			
		||||
    <option name="SPRING_BOOT_MAIN_CLASS" value="com.cxyxiaomo.epp.test.TestProvider" />
 | 
			
		||||
    <extension name="coverage">
 | 
			
		||||
      <pattern>
 | 
			
		||||
        <option name="PATTERN" value="com.cxyxiaomo.epp.*" />
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@
 | 
			
		||||
      <env name="--spring.profiles.active" value="remote" />
 | 
			
		||||
    </envs>
 | 
			
		||||
    <module name="microservice-provider-user-8001" />
 | 
			
		||||
    <option name="SPRING_BOOT_MAIN_CLASS" value="com.cxyxiaomo.epp.UserProvider" />
 | 
			
		||||
    <option name="SPRING_BOOT_MAIN_CLASS" value="com.cxyxiaomo.epp.user.UserProvider" />
 | 
			
		||||
    <option name="WORKING_DIRECTORY" value="file://$MODULE_WORKING_DIR$" />
 | 
			
		||||
    <extension name="coverage">
 | 
			
		||||
      <pattern>
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@
 | 
			
		||||
    </parent>
 | 
			
		||||
    <modelVersion>4.0.0</modelVersion>
 | 
			
		||||
 | 
			
		||||
    <artifactId>microservice-pojo</artifactId>
 | 
			
		||||
    <artifactId>microservice-common</artifactId>
 | 
			
		||||
 | 
			
		||||
    <properties>
 | 
			
		||||
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 | 
			
		||||
@@ -24,10 +24,9 @@
 | 
			
		||||
            <optional>true</optional>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>junit</groupId>
 | 
			
		||||
            <artifactId>junit</artifactId>
 | 
			
		||||
            <version>4.11</version>
 | 
			
		||||
            <scope>test</scope>
 | 
			
		||||
            <groupId>org.springframework</groupId>
 | 
			
		||||
            <artifactId>spring-beans</artifactId>
 | 
			
		||||
            <version>5.3.22</version>
 | 
			
		||||
        </dependency>
 | 
			
		||||
    </dependencies>
 | 
			
		||||
</project>
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package com.cxyxiaomo.epp.pojo;
 | 
			
		||||
package com.cxyxiaomo.epp.common.pojo;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package com.cxyxiaomo.epp.pojo;
 | 
			
		||||
package com.cxyxiaomo.epp.common.pojo;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package com.cxyxiaomo.epp.pojo;
 | 
			
		||||
package com.cxyxiaomo.epp.common.pojo;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package com.cxyxiaomo.epp.pojo;
 | 
			
		||||
package com.cxyxiaomo.epp.common.pojo;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
@@ -1,10 +1,11 @@
 | 
			
		||||
package com.cxyxiaomo.epp.pojo;
 | 
			
		||||
package com.cxyxiaomo.epp.common.pojo;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
 | 
			
		||||
// 数据库关系映射
 | 
			
		||||
 | 
			
		||||
@@ -15,10 +16,13 @@ import java.io.Serializable;
 | 
			
		||||
public class User implements Serializable {
 | 
			
		||||
    private Integer id;
 | 
			
		||||
    private String username;
 | 
			
		||||
    private String name;
 | 
			
		||||
    private String password;
 | 
			
		||||
    private String img;
 | 
			
		||||
    private String stu_id;
 | 
			
		||||
    private String realname;
 | 
			
		||||
    private String idNumber;
 | 
			
		||||
    private String phoneNumber;
 | 
			
		||||
    private Integer role;
 | 
			
		||||
    private String state;
 | 
			
		||||
    private String buildingId;
 | 
			
		||||
    private String doorplate;
 | 
			
		||||
    private String permission;
 | 
			
		||||
    private LocalDateTime permissionTime;
 | 
			
		||||
}
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package com.cxyxiaomo.epp.pojo;
 | 
			
		||||
package com.cxyxiaomo.epp.common.pojo;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
@@ -1,9 +1,10 @@
 | 
			
		||||
package com.cxyxiaomo.epp.common;
 | 
			
		||||
package com.cxyxiaomo.epp.common.response;
 | 
			
		||||
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
public class Res<T> {
 | 
			
		||||
    private Boolean success;
 | 
			
		||||
    private String msg;
 | 
			
		||||
    private T data;
 | 
			
		||||
 | 
			
		||||
@@ -16,19 +17,22 @@ public class Res<T> {
 | 
			
		||||
 | 
			
		||||
    public static Res success() {
 | 
			
		||||
        Res res = new Res<>();
 | 
			
		||||
        res.setMsg("成功");
 | 
			
		||||
        res.setMsg("操作成功");
 | 
			
		||||
        res.setSuccess(true);
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static <T> Res<T> success(T data) {
 | 
			
		||||
        Res<T> res = new Res<>(data);
 | 
			
		||||
        res.setMsg("成功");
 | 
			
		||||
        res.setMsg("操作成功");
 | 
			
		||||
        res.setSuccess(true);
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static Res error(String msg) {
 | 
			
		||||
        Res res = new Res<>();
 | 
			
		||||
        res.setMsg(msg);
 | 
			
		||||
        res.setSuccess(false);
 | 
			
		||||
        return res;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,11 @@
 | 
			
		||||
package com.cxyxiaomo.epp.common.utils;
 | 
			
		||||
 | 
			
		||||
import org.springframework.util.DigestUtils;
 | 
			
		||||
 | 
			
		||||
import java.io.UnsupportedEncodingException;
 | 
			
		||||
 | 
			
		||||
public class Hash {
 | 
			
		||||
    public String getMd5(String text) throws UnsupportedEncodingException {
 | 
			
		||||
        return DigestUtils.md5DigestAsHex(text.getBytes("utf-8"));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,38 @@
 | 
			
		||||
package com.cxyxiaomo.epp.common.vo;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.User;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
import org.springframework.beans.BeanUtils;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
 | 
			
		||||
// 数据库关系映射
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@Accessors(chain = true) // 链式写法
 | 
			
		||||
// 微服务必须要实现Serializable
 | 
			
		||||
public class UserVO implements Serializable {
 | 
			
		||||
    private Integer id;
 | 
			
		||||
    private String username;
 | 
			
		||||
    private String realname;
 | 
			
		||||
    private String idNumber;
 | 
			
		||||
    private String phoneNumber;
 | 
			
		||||
    private Integer role;
 | 
			
		||||
    private String buildingId;
 | 
			
		||||
    private String doorplate;
 | 
			
		||||
    private String permission;
 | 
			
		||||
    private LocalDateTime permissionTime;
 | 
			
		||||
 | 
			
		||||
    public static UserVO convertFrom(User user) {
 | 
			
		||||
        if (user == null) {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
        UserVO userVO = new UserVO();
 | 
			
		||||
        BeanUtils.copyProperties(user, userVO);
 | 
			
		||||
        return userVO;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package com.cxyxiaomo.epp;
 | 
			
		||||
package com.cxyxiaomo.epp.gateway;
 | 
			
		||||
 | 
			
		||||
import org.springframework.boot.SpringApplication;
 | 
			
		||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package com.cxyxiaomo.epp.controller;
 | 
			
		||||
package com.cxyxiaomo.epp.gateway.controller;
 | 
			
		||||
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RestController;
 | 
			
		||||
@@ -19,8 +19,7 @@ spring:
 | 
			
		||||
          uri: lb://microservice-provider-user
 | 
			
		||||
          predicates:
 | 
			
		||||
            - Path=/user/**
 | 
			
		||||
          filters:
 | 
			
		||||
            - StripPrefix=1
 | 
			
		||||
            - Method=GET,POST
 | 
			
		||||
 | 
			
		||||
        - id: test1
 | 
			
		||||
          uri: lb://microservice-provider-test
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package com.cxyxiaomo.epp;
 | 
			
		||||
package com.cxyxiaomo.epp.gateway;
 | 
			
		||||
 | 
			
		||||
import static org.junit.Assert.assertTrue;
 | 
			
		||||
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package com.cxyxiaomo.epp;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram;
 | 
			
		||||
 | 
			
		||||
import org.springframework.boot.SpringApplication;
 | 
			
		||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
package com.cxyxiaomo.epp.index.controller;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.index.controller;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Apply;
 | 
			
		||||
import com.cxyxiaomo.epp.common.Res;
 | 
			
		||||
import com.cxyxiaomo.epp.index.service.ApplyService;
 | 
			
		||||
import com.cxyxiaomo.epp.common.response.Res;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Apply;
 | 
			
		||||
import com.cxyxiaomo.epp.miniprogram.index.service.ApplyService;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Controller;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
package com.cxyxiaomo.epp.index.controller;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.index.controller;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Notice;
 | 
			
		||||
import com.cxyxiaomo.epp.common.Res;
 | 
			
		||||
import com.cxyxiaomo.epp.index.service.NoticeService;
 | 
			
		||||
import com.cxyxiaomo.epp.common.response.Res;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Notice;
 | 
			
		||||
import com.cxyxiaomo.epp.miniprogram.index.service.NoticeService;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Controller;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
package com.cxyxiaomo.epp.index.controller;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.index.controller;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.common.Res;
 | 
			
		||||
import com.cxyxiaomo.epp.index.service.OtherService;
 | 
			
		||||
import com.cxyxiaomo.epp.common.response.Res;
 | 
			
		||||
import com.cxyxiaomo.epp.miniprogram.index.service.OtherService;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Controller;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
package com.cxyxiaomo.epp.index.controller;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.index.controller;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Report;
 | 
			
		||||
import com.cxyxiaomo.epp.common.Res;
 | 
			
		||||
import com.cxyxiaomo.epp.index.service.ReportService;
 | 
			
		||||
import com.cxyxiaomo.epp.common.response.Res;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Report;
 | 
			
		||||
import com.cxyxiaomo.epp.miniprogram.index.service.ReportService;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Controller;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package com.cxyxiaomo.epp.index.controller;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.index.controller;
 | 
			
		||||
 | 
			
		||||
import java.awt.image.BufferedImage;
 | 
			
		||||
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
package com.cxyxiaomo.epp.index.dao;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.index.dao;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Apply;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Apply;
 | 
			
		||||
import org.apache.ibatis.annotations.Mapper;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
package com.cxyxiaomo.epp.index.dao;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.index.dao;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Notice;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Notice;
 | 
			
		||||
import org.apache.ibatis.annotations.Mapper;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
package com.cxyxiaomo.epp.index.dao;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.index.dao;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Feedback;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Feedback;
 | 
			
		||||
import org.apache.ibatis.annotations.Mapper;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
package com.cxyxiaomo.epp.index.dao;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.index.dao;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Report;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Report;
 | 
			
		||||
import org.apache.ibatis.annotations.Mapper;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
package com.cxyxiaomo.epp.index.service;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.index.service;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Apply;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Apply;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
package com.cxyxiaomo.epp.index.service;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.index.service;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.index.dao.ApplyDao;
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Apply;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Apply;
 | 
			
		||||
import com.cxyxiaomo.epp.miniprogram.index.dao.ApplyDao;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
package com.cxyxiaomo.epp.index.service;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.index.service;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Notice;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Notice;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
package com.cxyxiaomo.epp.index.service;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.index.service;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.index.dao.NoticeDao;
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Notice;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Notice;
 | 
			
		||||
import com.cxyxiaomo.epp.miniprogram.index.dao.NoticeDao;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
package com.cxyxiaomo.epp.index.service;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.index.service;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Feedback;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Feedback;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
package com.cxyxiaomo.epp.index.service;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.index.service;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.index.dao.OtherDao;
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Feedback;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Feedback;
 | 
			
		||||
import com.cxyxiaomo.epp.miniprogram.index.dao.OtherDao;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
package com.cxyxiaomo.epp.index.service;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.index.service;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Report;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Report;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@@ -1,12 +1,10 @@
 | 
			
		||||
package com.cxyxiaomo.epp.index.service;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.index.service;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.index.dao.ReportDao;
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Report;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Report;
 | 
			
		||||
import com.cxyxiaomo.epp.miniprogram.index.dao.ReportDao;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
import java.text.SimpleDateFormat;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@Service
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
package com.cxyxiaomo.epp.visitor.controller;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.visitor.controller;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.common.Res;
 | 
			
		||||
import com.cxyxiaomo.epp.visitor.service.VisitorService;
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Visitor;
 | 
			
		||||
import com.cxyxiaomo.epp.common.response.Res;
 | 
			
		||||
import com.cxyxiaomo.epp.miniprogram.visitor.service.VisitorService;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Visitor;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Controller;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
package com.cxyxiaomo.epp.visitor.dao;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.visitor.dao;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Visitor;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Visitor;
 | 
			
		||||
import org.apache.ibatis.annotations.Mapper;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
package com.cxyxiaomo.epp.visitor.service;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.visitor.service;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Visitor;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Visitor;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
package com.cxyxiaomo.epp.visitor.service.impl;
 | 
			
		||||
package com.cxyxiaomo.epp.miniprogram.visitor.service.impl;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.Visitor;
 | 
			
		||||
import com.cxyxiaomo.epp.visitor.service.VisitorService;
 | 
			
		||||
import com.cxyxiaomo.epp.visitor.dao.VisitorDao;
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.Visitor;
 | 
			
		||||
import com.cxyxiaomo.epp.miniprogram.visitor.service.VisitorService;
 | 
			
		||||
import com.cxyxiaomo.epp.miniprogram.visitor.dao.VisitorDao;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
@@ -15,12 +15,12 @@
 | 
			
		||||
    <select id="lastApply" resultType="java.lang.Integer">
 | 
			
		||||
        select * from apply where stu_id = #{id} and state = 0 limit 1
 | 
			
		||||
    </select>
 | 
			
		||||
    <select id="applyListNoReplay" resultType="com.cxyxiaomo.epp.pojo.Apply">
 | 
			
		||||
    <select id="applyListNoReplay" resultType="com.cxyxiaomo.epp.common.pojo.Apply">
 | 
			
		||||
        select a.*,u.name,u.stu_id as stuId from apply a
 | 
			
		||||
        left join user u on a.stu_id = u.id
 | 
			
		||||
        where a.state = 0
 | 
			
		||||
    </select>
 | 
			
		||||
    <select id="myApply" resultType="com.cxyxiaomo.epp.pojo.Apply">
 | 
			
		||||
    <select id="myApply" resultType="com.cxyxiaomo.epp.common.pojo.Apply">
 | 
			
		||||
        select a.*,u.name,u.stu_id as stuId from apply a
 | 
			
		||||
        left join user u on a.stu_id = u.id
 | 
			
		||||
        where a.stu_id = #{id}
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@
 | 
			
		||||
    <delete id="delNotice">
 | 
			
		||||
        delete from notice where id = #{id}
 | 
			
		||||
    </delete>
 | 
			
		||||
    <select id="noticeList" resultType="com.cxyxiaomo.epp.pojo.Notice">
 | 
			
		||||
    <select id="noticeList" resultType="com.cxyxiaomo.epp.common.pojo.Notice">
 | 
			
		||||
        select * from notice order by time desc
 | 
			
		||||
        <if test="limit!= ''">
 | 
			
		||||
            limit ${limit}
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,7 @@
 | 
			
		||||
        update feedback set reply = #{replay}
 | 
			
		||||
        where id = #{id}
 | 
			
		||||
    </update>
 | 
			
		||||
    <select id="feedbackList" resultType="com.cxyxiaomo.epp.pojo.Feedback">
 | 
			
		||||
    <select id="feedbackList" resultType="com.cxyxiaomo.epp.common.pojo.Feedback">
 | 
			
		||||
        select * from feedback
 | 
			
		||||
        <where>
 | 
			
		||||
            <if test="id != null">
 | 
			
		||||
@@ -19,7 +19,7 @@
 | 
			
		||||
            </if>
 | 
			
		||||
        </where>
 | 
			
		||||
    </select>
 | 
			
		||||
    <select id="feedbackListNoReplay" resultType="com.cxyxiaomo.epp.pojo.Feedback">
 | 
			
		||||
    <select id="feedbackListNoReplay" resultType="com.cxyxiaomo.epp.common.pojo.Feedback">
 | 
			
		||||
        select * from feedback where reply is null
 | 
			
		||||
    </select>
 | 
			
		||||
</mapper>
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,7 @@
 | 
			
		||||
        (#{user_id},#{name},#{address},#{time},#{normal},#{yes_noon_temp},
 | 
			
		||||
        #{yes_night_temp},#{today_morning_temp},#{isolation})
 | 
			
		||||
    </insert>
 | 
			
		||||
    <select id="myReport" resultType="com.cxyxiaomo.epp.pojo.Report">
 | 
			
		||||
    <select id="myReport" resultType="com.cxyxiaomo.epp.common.pojo.Report">
 | 
			
		||||
        select name,time,normal,address from report where user_id = #{id}
 | 
			
		||||
        order by time desc
 | 
			
		||||
    </select>
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,7 @@
 | 
			
		||||
    <select id="showMyVisitor" resultType="java.lang.Integer">
 | 
			
		||||
        select state from visitor where phone = #{phone} and TO_DAYS(NOW( )) - TO_DAYS(time) = 0
 | 
			
		||||
    </select>
 | 
			
		||||
    <select id="showVisitorList" resultType="com.cxyxiaomo.epp.pojo.Visitor">
 | 
			
		||||
    <select id="showVisitorList" resultType="com.cxyxiaomo.epp.common.pojo.Visitor">
 | 
			
		||||
        select * from visitor where state = 0
 | 
			
		||||
    </select>
 | 
			
		||||
</mapper>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package com.cxyxiaomo.epp;
 | 
			
		||||
package com.cxyxiaomo.epp.test;
 | 
			
		||||
 | 
			
		||||
import org.springframework.boot.SpringApplication;
 | 
			
		||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package com.cxyxiaomo.epp.controller;
 | 
			
		||||
package com.cxyxiaomo.epp.test.controller;
 | 
			
		||||
 | 
			
		||||
// 提供 restful 服务
 | 
			
		||||
 | 
			
		||||
@@ -21,7 +21,7 @@
 | 
			
		||||
        <!-- 实体类 -->
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>com.cxyxiaomo</groupId>
 | 
			
		||||
            <artifactId>microservice-pojo</artifactId>
 | 
			
		||||
            <artifactId>microservice-common</artifactId>
 | 
			
		||||
            <version>0.0.1-SNAPSHOT</version>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <!-- mybatis -->
 | 
			
		||||
 
 | 
			
		||||
@@ -1,87 +0,0 @@
 | 
			
		||||
package com.cxyxiaomo.epp.controller;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.common.Res;
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.User;
 | 
			
		||||
import com.cxyxiaomo.epp.service.UserServiceImpl;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Controller;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.ResponseBody;
 | 
			
		||||
 | 
			
		||||
@Controller
 | 
			
		||||
@RequestMapping("/user")
 | 
			
		||||
public class UserController {
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private UserServiceImpl userService;
 | 
			
		||||
 | 
			
		||||
    @RequestMapping("/login")
 | 
			
		||||
    @ResponseBody
 | 
			
		||||
    public Res login(String username, String password){
 | 
			
		||||
        User user = userService.getUserByUsername(username);
 | 
			
		||||
        if (user!=null){
 | 
			
		||||
            if (user.getPassword().equals(password)){
 | 
			
		||||
                return Res.success(user);
 | 
			
		||||
            }else {
 | 
			
		||||
                return Res.error("密码错误");
 | 
			
		||||
            }
 | 
			
		||||
        }else{
 | 
			
		||||
            return Res.error("该用户名不存在");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @RequestMapping("/person")
 | 
			
		||||
    @ResponseBody
 | 
			
		||||
    public User person(String username){
 | 
			
		||||
        return userService.getUserByUsername(username);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @RequestMapping("/updateImg")
 | 
			
		||||
    @ResponseBody
 | 
			
		||||
    public String updateImg(Integer id,String img){
 | 
			
		||||
        if (userService.updateImg(id,img) != 0){
 | 
			
		||||
            return "修改成功";
 | 
			
		||||
        }else{
 | 
			
		||||
            return "修改失败";
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @RequestMapping("/updPwd")
 | 
			
		||||
    @ResponseBody
 | 
			
		||||
    public String updPwd(String username,String pwd1,String pwd2){
 | 
			
		||||
        User user = userService.getUserByUsername(username);
 | 
			
		||||
        if (user.getPassword().equals(pwd1)){
 | 
			
		||||
            userService.updPwd(username, pwd2);
 | 
			
		||||
            return "请重新登录";
 | 
			
		||||
        }else {
 | 
			
		||||
            return "原密码错误";
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @RequestMapping("/redCodeList")
 | 
			
		||||
    @ResponseBody
 | 
			
		||||
    public Res redCodeList(){
 | 
			
		||||
        return Res.success(userService.redCodeList());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @RequestMapping("/redCodeList2")
 | 
			
		||||
    @ResponseBody
 | 
			
		||||
    public Res redCodeList2(){
 | 
			
		||||
        return Res.success(userService.redCodeList2());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @RequestMapping("/addUser")
 | 
			
		||||
    @ResponseBody
 | 
			
		||||
    public Res addUser(String username,String name,Integer role){
 | 
			
		||||
        User user = new User();
 | 
			
		||||
        user.setUsername(username);
 | 
			
		||||
        user.setPassword(username);
 | 
			
		||||
        user.setName(name);
 | 
			
		||||
        if (role == 2){
 | 
			
		||||
            user.setStu_id(username);
 | 
			
		||||
        }
 | 
			
		||||
        user.setRole(role);
 | 
			
		||||
        return Res.success(userService.addUser(user));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,32 +0,0 @@
 | 
			
		||||
package com.cxyxiaomo.epp.controller;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.User;
 | 
			
		||||
import com.cxyxiaomo.epp.service.UserServiceImpl;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
// 提供 restful 服务
 | 
			
		||||
 | 
			
		||||
@RestController
 | 
			
		||||
public class UserControllerOld {
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private UserServiceImpl userService;
 | 
			
		||||
 | 
			
		||||
    @PostMapping("/user/add")
 | 
			
		||||
    public boolean addUser(User user) {
 | 
			
		||||
        return userService.addUser(user);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @GetMapping("/user/get/{id}")
 | 
			
		||||
    public User getUserById(@PathVariable("id") Long id) {
 | 
			
		||||
        return userService.getUserById(id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @GetMapping("/user/list")
 | 
			
		||||
    public List<User> addUser() {
 | 
			
		||||
        return userService.getUserList();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,39 +0,0 @@
 | 
			
		||||
package com.cxyxiaomo.epp.dao;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.User;
 | 
			
		||||
import org.apache.ibatis.annotations.Mapper;
 | 
			
		||||
import org.springframework.stereotype.Repository;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@Mapper
 | 
			
		||||
@Repository
 | 
			
		||||
public interface UserDao {
 | 
			
		||||
 | 
			
		||||
    public boolean addUser(User user);
 | 
			
		||||
 | 
			
		||||
    public User getUserById(Long id);
 | 
			
		||||
 | 
			
		||||
    public List<User> getUserList();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    List<User> selectAll();
 | 
			
		||||
 | 
			
		||||
    User getUser(String username,String role);
 | 
			
		||||
 | 
			
		||||
    User getUserByUsername(String username);
 | 
			
		||||
 | 
			
		||||
    int updateImg(Integer id,String img);
 | 
			
		||||
 | 
			
		||||
    int updPwd(String username, String pwd2);
 | 
			
		||||
 | 
			
		||||
    int updState(Integer id, String date);
 | 
			
		||||
 | 
			
		||||
    List<User> redCodeList();
 | 
			
		||||
 | 
			
		||||
    List<User> redCodeList2();
 | 
			
		||||
 | 
			
		||||
    int addUser2(User user);
 | 
			
		||||
}
 | 
			
		||||
@@ -1,33 +0,0 @@
 | 
			
		||||
package com.cxyxiaomo.epp.service;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.User;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
public interface UserService {
 | 
			
		||||
 | 
			
		||||
    public boolean addUser(User user);
 | 
			
		||||
 | 
			
		||||
    public User getUserById(Long id);
 | 
			
		||||
 | 
			
		||||
    public List<User> getUserList();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    User getUser(String username, String role);
 | 
			
		||||
 | 
			
		||||
    User getUserByUsername(String username);
 | 
			
		||||
 | 
			
		||||
    int updateImg(Integer id,String img);
 | 
			
		||||
 | 
			
		||||
    int updPwd(String username,String pwd2);
 | 
			
		||||
 | 
			
		||||
    List<User> redCodeList();
 | 
			
		||||
 | 
			
		||||
    List<User> redCodeList2();
 | 
			
		||||
 | 
			
		||||
    String addUser2(User user);
 | 
			
		||||
}
 | 
			
		||||
@@ -1,74 +0,0 @@
 | 
			
		||||
package com.cxyxiaomo.epp.service;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.dao.UserDao;
 | 
			
		||||
import com.cxyxiaomo.epp.pojo.User;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@Service
 | 
			
		||||
public class UserServiceImpl implements UserService {
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private UserDao userDao;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean addUser(User user) {
 | 
			
		||||
        return userDao.addUser(user);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public User getUserById(Long id) {
 | 
			
		||||
        return userDao.getUserById(id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<User> getUserList() {
 | 
			
		||||
        return userDao.getUserList();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public User getUser(String username, String role) {
 | 
			
		||||
        return userDao.getUser(username, role);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public User getUserByUsername(String username) {
 | 
			
		||||
        return userDao.getUserByUsername(username);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public int updateImg(Integer id, String img) {
 | 
			
		||||
        return userDao.updateImg(id,img);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public int updPwd(String username, String pwd2) {
 | 
			
		||||
        return userDao.updPwd(username, pwd2);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<User> redCodeList() {
 | 
			
		||||
        return userDao.redCodeList();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<User> redCodeList2() {
 | 
			
		||||
        return userDao.redCodeList2();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String addUser2(User user) {
 | 
			
		||||
        if (userDao.getUserByUsername(user.getUsername()) == null){
 | 
			
		||||
            userDao.addUser2(user);
 | 
			
		||||
            return "添加成功";
 | 
			
		||||
        }else{
 | 
			
		||||
            return "该用户已存在";
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package com.cxyxiaomo.epp;
 | 
			
		||||
package com.cxyxiaomo.epp.user;
 | 
			
		||||
 | 
			
		||||
import org.springframework.boot.SpringApplication;
 | 
			
		||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
 | 
			
		||||
@@ -0,0 +1,62 @@
 | 
			
		||||
package com.cxyxiaomo.epp.user.controller;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.User;
 | 
			
		||||
import com.cxyxiaomo.epp.common.response.Res;
 | 
			
		||||
import com.cxyxiaomo.epp.common.vo.UserVO;
 | 
			
		||||
import com.cxyxiaomo.epp.user.service.UserServiceImpl;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Controller;
 | 
			
		||||
import org.springframework.web.bind.annotation.PostMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.ResponseBody;
 | 
			
		||||
 | 
			
		||||
import java.util.HashMap;
 | 
			
		||||
 | 
			
		||||
@Controller
 | 
			
		||||
@RequestMapping("/user")
 | 
			
		||||
public class UserController {
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private UserServiceImpl userService;
 | 
			
		||||
 | 
			
		||||
    // @RequestMapping("/login")
 | 
			
		||||
    @PostMapping("/login")
 | 
			
		||||
    @ResponseBody
 | 
			
		||||
    public Res login(String username, String password) {
 | 
			
		||||
        User user = userService.getUserByUsername(username);
 | 
			
		||||
        if (user != null) {
 | 
			
		||||
            String passwordHash = user.getPassword();
 | 
			
		||||
            if (passwordHash.equals(password)) {
 | 
			
		||||
                HashMap<String, Object> map = new HashMap<>();
 | 
			
		||||
                map.put("userInfo", UserVO.convertFrom(user));
 | 
			
		||||
                return Res.success(map);
 | 
			
		||||
            } else {
 | 
			
		||||
                return Res.error("用户名或密码不正确");
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            return Res.error("用户不存在");
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @RequestMapping("/person")
 | 
			
		||||
    @ResponseBody
 | 
			
		||||
    public User person(String username) {
 | 
			
		||||
        return null;
 | 
			
		||||
        // return userService.getUserByUsername(username);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @RequestMapping("/addUser")
 | 
			
		||||
    @ResponseBody
 | 
			
		||||
    public Res addUser(String username, String name, Integer role) {
 | 
			
		||||
        // User user = new User();
 | 
			
		||||
        // user.setUsername(username);
 | 
			
		||||
        // user.setPassword(username);
 | 
			
		||||
        // user.setName(name);
 | 
			
		||||
        // if (role == 2) {
 | 
			
		||||
        //     user.setStu_id(username);
 | 
			
		||||
        // }
 | 
			
		||||
        // user.setRole(role);
 | 
			
		||||
        // return Res.success(userService.addUser(user));
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,16 @@
 | 
			
		||||
package com.cxyxiaomo.epp.user.dao;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.User;
 | 
			
		||||
import org.apache.ibatis.annotations.Mapper;
 | 
			
		||||
import org.springframework.stereotype.Repository;
 | 
			
		||||
 | 
			
		||||
@Mapper
 | 
			
		||||
@Repository
 | 
			
		||||
public interface UserDao {
 | 
			
		||||
 | 
			
		||||
    public boolean addUser(User user);
 | 
			
		||||
 | 
			
		||||
    public User getUserById(Long id);
 | 
			
		||||
 | 
			
		||||
    User getUserByUsername(String username);
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,8 @@
 | 
			
		||||
package com.cxyxiaomo.epp.user.service;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.User;
 | 
			
		||||
 | 
			
		||||
public interface UserService {
 | 
			
		||||
 | 
			
		||||
    User getUserByUsername(String username);
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,18 @@
 | 
			
		||||
package com.cxyxiaomo.epp.user.service;
 | 
			
		||||
 | 
			
		||||
import com.cxyxiaomo.epp.common.pojo.User;
 | 
			
		||||
import com.cxyxiaomo.epp.user.dao.UserDao;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
@Service
 | 
			
		||||
public class UserServiceImpl implements UserService {
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private UserDao userDao;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public User getUserByUsername(String username) {
 | 
			
		||||
        return userDao.getUserByUsername(username);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -2,55 +2,16 @@
 | 
			
		||||
<!DOCTYPE mapper
 | 
			
		||||
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
 | 
			
		||||
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 | 
			
		||||
<mapper namespace="com.cxyxiaomo.epp.dao.UserDao">
 | 
			
		||||
 | 
			
		||||
    <insert id="addUser" parameterType="com.cxyxiaomo.epp.pojo.User">
 | 
			
		||||
<mapper namespace="com.cxyxiaomo.epp.user.dao.UserDao">
 | 
			
		||||
    <insert id="addUser" parameterType="com.cxyxiaomo.epp.common.pojo.User">
 | 
			
		||||
        INSERT INTO user (username, password)
 | 
			
		||||
        VALUES (#{username}, #{password})
 | 
			
		||||
    </insert>
 | 
			
		||||
 | 
			
		||||
    <select id="getUserById" parameterType="java.lang.Long" resultType="com.cxyxiaomo.epp.pojo.User">
 | 
			
		||||
    <select id="getUserById" parameterType="java.lang.Long" resultType="com.cxyxiaomo.epp.common.pojo.User">
 | 
			
		||||
        SELECT * FROM user
 | 
			
		||||
        WHERE id = #{id}
 | 
			
		||||
    </select>
 | 
			
		||||
 | 
			
		||||
    <select id="getUserList" resultType="com.cxyxiaomo.epp.pojo.User">
 | 
			
		||||
        SELECT * FROM user
 | 
			
		||||
    </select>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    <insert id="addUser2">
 | 
			
		||||
        insert into user
 | 
			
		||||
            (username, name, password, role, stu_id) values
 | 
			
		||||
            (#{username},#{name},#{password},#{role},#{stu_id})
 | 
			
		||||
    </insert>
 | 
			
		||||
    <update id="updateImg">
 | 
			
		||||
        update user set img = #{img}
 | 
			
		||||
        where id = #{id}
 | 
			
		||||
    </update>
 | 
			
		||||
    <update id="updPwd">
 | 
			
		||||
        update user set password = #{pwd2}
 | 
			
		||||
        where username = #{username}
 | 
			
		||||
    </update>
 | 
			
		||||
    <update id="updState">
 | 
			
		||||
        update user set state = #{date}
 | 
			
		||||
        where id = #{id}
 | 
			
		||||
    </update>
 | 
			
		||||
    <select id="selectAll" resultType="com.cxyxiaomo.epp.pojo.User">
 | 
			
		||||
        select * from `user`
 | 
			
		||||
    </select>
 | 
			
		||||
    <select id="getUserByUsername" resultType="com.cxyxiaomo.epp.pojo.User">
 | 
			
		||||
    <select id="getUserByUsername" resultType="com.cxyxiaomo.epp.common.pojo.User">
 | 
			
		||||
        select * from user where username = #{username}
 | 
			
		||||
    </select>
 | 
			
		||||
    <select id="getUser" resultType="com.cxyxiaomo.epp.pojo.User">
 | 
			
		||||
        select * from user where username = #{username} and role_id = #{role}
 | 
			
		||||
    </select>
 | 
			
		||||
    <select id="redCodeList" resultType="com.cxyxiaomo.epp.pojo.User">
 | 
			
		||||
        select name,stu_id from user where TO_DAYS(NOW( )) != TO_DAYS(state) and role = 2
 | 
			
		||||
    </select>
 | 
			
		||||
 | 
			
		||||
    <select id="redCodeList2" resultType="com.cxyxiaomo.epp.pojo.User">
 | 
			
		||||
        select name,stu_id from user where state = "1999-01-01"
 | 
			
		||||
    </select>
 | 
			
		||||
</mapper>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package com.cxyxiaomo.epp;
 | 
			
		||||
package com.cxyxiaomo.epp.user;
 | 
			
		||||
 | 
			
		||||
import static org.junit.Assert.assertTrue;
 | 
			
		||||
 | 
			
		||||
@@ -14,7 +14,7 @@
 | 
			
		||||
    <packaging>pom</packaging>
 | 
			
		||||
    <modules>
 | 
			
		||||
        <module>microservice-gateway</module>
 | 
			
		||||
        <module>microservice-pojo</module>
 | 
			
		||||
        <module>microservice-common</module>
 | 
			
		||||
        <module>microservice-provider-user-8001</module>
 | 
			
		||||
        <module>microservice-provider-miniprogram-8080</module>
 | 
			
		||||
        <module>microservice-provider-test-8011</module>
 | 
			
		||||
 
 | 
			
		||||
@@ -21,7 +21,7 @@ const config = {
 | 
			
		||||
  framework: 'vue3',
 | 
			
		||||
  compiler: 'webpack5',
 | 
			
		||||
  cache: {
 | 
			
		||||
    enable: false // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
 | 
			
		||||
    enable: true // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
 | 
			
		||||
  },
 | 
			
		||||
  mini: {
 | 
			
		||||
    postcss: {
 | 
			
		||||
 
 | 
			
		||||
@@ -38,35 +38,35 @@
 | 
			
		||||
    "@babel/runtime": "^7.7.7",
 | 
			
		||||
    "@tarojs/components": "3.5.7",
 | 
			
		||||
    "@tarojs/helper": "3.5.7",
 | 
			
		||||
    "@tarojs/plugin-platform-weapp": "3.5.7",
 | 
			
		||||
    "@tarojs/plugin-framework-vue3": "3.5.7",
 | 
			
		||||
    "@tarojs/plugin-platform-alipay": "3.5.7",
 | 
			
		||||
    "@tarojs/plugin-platform-tt": "3.5.7",
 | 
			
		||||
    "@tarojs/plugin-platform-swan": "3.5.7",
 | 
			
		||||
    "@tarojs/plugin-platform-jd": "3.5.7",
 | 
			
		||||
    "@tarojs/plugin-platform-qq": "3.5.7",
 | 
			
		||||
    "@tarojs/plugin-platform-swan": "3.5.7",
 | 
			
		||||
    "@tarojs/plugin-platform-tt": "3.5.7",
 | 
			
		||||
    "@tarojs/plugin-platform-weapp": "3.5.7",
 | 
			
		||||
    "@tarojs/router": "3.5.7",
 | 
			
		||||
    "@tarojs/runtime": "3.5.7",
 | 
			
		||||
    "@tarojs/shared": "3.5.7",
 | 
			
		||||
    "@tarojs/taro": "3.5.7",
 | 
			
		||||
    "@tarojs/taro-h5": "3.5.7",
 | 
			
		||||
    "@tarojs/plugin-framework-vue3": "3.5.7",
 | 
			
		||||
    "vue": "^3.0.0"
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@babel/core": "^7.8.0",
 | 
			
		||||
    "@tarojs/cli": "3.5.7",
 | 
			
		||||
    "@types/webpack-env": "^1.13.6",
 | 
			
		||||
    "webpack": "5.69.0",
 | 
			
		||||
    "@tarojs/webpack5-runner": "3.5.7",
 | 
			
		||||
    "babel-preset-taro": "3.5.7",
 | 
			
		||||
    "css-loader": "3.4.2",
 | 
			
		||||
    "style-loader": "1.3.0",
 | 
			
		||||
    "@types/webpack-env": "^1.13.6",
 | 
			
		||||
    "@vue/babel-plugin-jsx": "^1.0.6",
 | 
			
		||||
    "@vue/compiler-sfc": "^3.0.0",
 | 
			
		||||
    "vue-loader": "^17.0.0",
 | 
			
		||||
    "eslint-plugin-vue": "^8.0.0",
 | 
			
		||||
    "eslint-config-taro": "3.5.7",
 | 
			
		||||
    "babel-preset-taro": "3.5.7",
 | 
			
		||||
    "css-loader": "3.4.2",
 | 
			
		||||
    "eslint": "^8.12.0",
 | 
			
		||||
    "stylelint": "^14.4.0"
 | 
			
		||||
    "eslint-config-taro": "3.5.7",
 | 
			
		||||
    "eslint-plugin-vue": "^8.0.0",
 | 
			
		||||
    "style-loader": "1.3.0",
 | 
			
		||||
    "stylelint": "^14.4.0",
 | 
			
		||||
    "vue-loader": "^17.0.0",
 | 
			
		||||
    "webpack": "5.69.0"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -2,14 +2,14 @@
 | 
			
		||||
    "miniprogramRoot": "dist/",
 | 
			
		||||
    "projectname": "epp",
 | 
			
		||||
    "description": "基于微服务的社区疫情防控系统",
 | 
			
		||||
    "appid": "touristappid",
 | 
			
		||||
    "appid": "wxa70348746d2b562f",
 | 
			
		||||
    "setting": {
 | 
			
		||||
        "urlCheck": true,
 | 
			
		||||
        "es6": false,
 | 
			
		||||
        "enhance": false,
 | 
			
		||||
        "compileHotReLoad": false,
 | 
			
		||||
        "postcss": false,
 | 
			
		||||
        "minified": false,
 | 
			
		||||
        "minified": true,
 | 
			
		||||
        "babelSetting": {
 | 
			
		||||
            "ignore": [],
 | 
			
		||||
            "disablePlugins": [],
 | 
			
		||||
 
 | 
			
		||||
@@ -2,6 +2,7 @@
 | 
			
		||||
    "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
 | 
			
		||||
    "projectname": "epp",
 | 
			
		||||
    "setting": {
 | 
			
		||||
        "compileHotReLoad": true
 | 
			
		||||
        "compileHotReLoad": true,
 | 
			
		||||
        "urlCheck": false
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,11 +1,53 @@
 | 
			
		||||
export default defineAppConfig({
 | 
			
		||||
  pages: [
 | 
			
		||||
    'pages/index/index'
 | 
			
		||||
    'pages/index/index',
 | 
			
		||||
    'pages/index/login', // 登录页
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 用户侧
 | 
			
		||||
     */
 | 
			
		||||
    'pages/residents/code', // 进出码
 | 
			
		||||
  ],
 | 
			
		||||
  window: {
 | 
			
		||||
    backgroundTextStyle: 'light',
 | 
			
		||||
    navigationBarBackgroundColor: '#fff',
 | 
			
		||||
    backgroundTextStyle: 'dark',
 | 
			
		||||
    navigationBarBackgroundColor: '#000',
 | 
			
		||||
    navigationBarTitleText: 'WeChat',
 | 
			
		||||
    navigationBarTextStyle: 'black'
 | 
			
		||||
  }
 | 
			
		||||
    navigationBarTextStyle: 'white'
 | 
			
		||||
  },
 | 
			
		||||
  "tabBar": {
 | 
			
		||||
    "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/report/report",
 | 
			
		||||
      //   "text": "日报",
 | 
			
		||||
      //   "iconPath": "/icon/_report.png",
 | 
			
		||||
      //   "selectedIconPath": "/icon/report.png"
 | 
			
		||||
      // },
 | 
			
		||||
      // {
 | 
			
		||||
      //   "pagePath": "pages/apply/apply",
 | 
			
		||||
      //   "text": "申请",
 | 
			
		||||
      //   "iconPath": "/icon/_apply.png",
 | 
			
		||||
      //   "selectedIconPath": "/icon/apply.png"
 | 
			
		||||
      // },
 | 
			
		||||
      // {
 | 
			
		||||
      //   "pagePath": "pages/person/person",
 | 
			
		||||
      //   "text": "我的",
 | 
			
		||||
      //   "selectedColor": "#FF8966",
 | 
			
		||||
      //   "iconPath": "/icon/_person.png",
 | 
			
		||||
      //   "selectedIconPath": "/icon/person.png"
 | 
			
		||||
      // }
 | 
			
		||||
    ]
 | 
			
		||||
  },
 | 
			
		||||
})
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,5 @@
 | 
			
		||||
import { createApp } from 'vue'
 | 
			
		||||
import { setGlobalDataPlugin } from '@tarojs/taro'
 | 
			
		||||
import './app.css'
 | 
			
		||||
 | 
			
		||||
const App = createApp({
 | 
			
		||||
@@ -6,4 +7,11 @@ const App = createApp({
 | 
			
		||||
  // 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
// 全局变量 refer: https://docs.taro.zone/docs/come-from-miniapp#%E5%85%A8%E5%B1%80%E5%8F%98%E9%87%8F
 | 
			
		||||
App.use(setGlobalDataPlugin, {
 | 
			
		||||
  globalData: {
 | 
			
		||||
    baseUrl: "http://localhost:8080", // 不带最后的 /
 | 
			
		||||
  }
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
export default App
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/home.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 34 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/icon/_code.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 4.0 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/icon/_home.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 5.3 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/icon/_report.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 14 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/icon/apply.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 7.4 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/icon/code.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 4.4 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/icon/count.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 5.4 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/icon/danger.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 5.7 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/icon/feedback.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 4.6 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/icon/fk.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 4.5 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/icon/gg.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 6.4 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/icon/home.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 6.4 KiB  | 
							
								
								
									
										187
									
								
								miniprogram-taro/src/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
										
									
								
								miniprogram-taro/src/image/icon/notice.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 3.9 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/icon/password.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 1.3 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/icon/report.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 14 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/icon/updPwd.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 4.1 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/icon/username.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 1.7 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/icon/visitor.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 7.2 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								miniprogram-taro/src/image/icon/yq.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 7.0 KiB  | 
@@ -1,18 +1,124 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <view class="index">
 | 
			
		||||
    <text>{{ msg }}</text>
 | 
			
		||||
  <view style="background-color: #F6F6F6;height: 100%;">
 | 
			
		||||
    <image src="../../image/home.jpg" style="width: 100%;height: 130px;"></image>
 | 
			
		||||
    <view style="display: block; padding-left: 30px; padding-top: 12px;">
 | 
			
		||||
      <text>欢迎你,{{ displayUsername }}!</text>
 | 
			
		||||
    </view>
 | 
			
		||||
    <view style="display: block;" v-if="isUser">
 | 
			
		||||
      <view style="display: flex;text-align: center;margin-top: 20px;">
 | 
			
		||||
        <view style="width: 25%;">
 | 
			
		||||
          <image src="../../image/icon/code.png" style="width: 40px;height: 40px;" @tap='goCode'></image>
 | 
			
		||||
          <view>进出码</view>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view style="width: 25%;">
 | 
			
		||||
          <image src="../../image/icon/feedback.png" style="width: 40px;height: 40px;" bindtap='goFeedback'></image>
 | 
			
		||||
          <view>反馈查看</view>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view style="width: 25%;">
 | 
			
		||||
          <image src="../../image/icon/apply.png" style="width: 40px;height: 40px;" bindtap='goApply'></image>
 | 
			
		||||
          <view>申请记录</view>
 | 
			
		||||
        </view>
 | 
			
		||||
      </view>
 | 
			
		||||
      <view style="display: flex;text-align: center;margin-top: 20px;">
 | 
			
		||||
        <view style="width: 25%;">
 | 
			
		||||
          <image src="../../image/icon/yq.png" style="width: 40px;height: 40px;" data-web="xgPage" bindtap='goWebPage'>
 | 
			
		||||
          </image>
 | 
			
		||||
          <view>疫情追踪</view>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view style="width: 25%;">
 | 
			
		||||
          <image src="../../image/icon/report.png" style="width: 40px;height: 40px;" bindtap='goReport'></image>
 | 
			
		||||
          <view>今日日报</view>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view style="width: 25%;">
 | 
			
		||||
          <image src="../../image/icon/updPwd.png" style="width: 40px;height: 40px;" bindtap='goUpdPwd'></image>
 | 
			
		||||
          <view>密码修改</view>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view style="width: 25%;">
 | 
			
		||||
          <image src="../../image/icon/fk.png" style="width: 40px;height: 40px;" bindtap='goKf'></image>
 | 
			
		||||
          <view>提交反馈</view>
 | 
			
		||||
        </view>
 | 
			
		||||
      </view>
 | 
			
		||||
    </view>
 | 
			
		||||
    <view style="display: block;" v-if="isAdmin">
 | 
			
		||||
      <view style="display: flex;text-align: center;margin-top: 20px;">
 | 
			
		||||
        <view style="width: 25%;">
 | 
			
		||||
          <image src="../../image/icon/danger.png" style="width: 40px;height: 40px;" bindtap='goCode'></image>
 | 
			
		||||
          <view>不健康人员</view>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view style="width: 25%;">
 | 
			
		||||
          <image src="../../image/icon/feedback.png" style="width: 40px;height: 40px;" bindtap='goFeedbackReplay'>
 | 
			
		||||
          </image>
 | 
			
		||||
          <view>反馈回复</view>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view style="width: 25%;">
 | 
			
		||||
          <image src="../../image/icon/apply.png" style="width: 40px;height: 40px;" bindtap='goApplyReplay'></image>
 | 
			
		||||
          <view>申请审批</view>
 | 
			
		||||
        </view>
 | 
			
		||||
      </view>
 | 
			
		||||
      <view style="display: flex;text-align: center;margin-top: 20px;">
 | 
			
		||||
        <view style="width: 25%;">
 | 
			
		||||
          <image src="../../image/icon/gg.png" style="width: 40px;height: 40px;" data-web="xgPage" bindtap='goNotice'>
 | 
			
		||||
          </image>
 | 
			
		||||
          <view>公告发布</view>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view style="width: 25%;">
 | 
			
		||||
          <image src="../../image/icon/visitor.png" style="width: 40px;height: 40px;" bindtap="goVisitor"></image>
 | 
			
		||||
          <view>访客审批</view>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view style="width: 25%;">
 | 
			
		||||
          <image src="../../image/icon/count.png" style="width: 40px;height: 40px;" bindtap='goCount'></image>
 | 
			
		||||
          <view>分配账号</view>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view style="width: 25%;">
 | 
			
		||||
          <image src="../../image/icon/_report.png" style="width: 40px;height: 40px;" bindtap='toRedList'></image>
 | 
			
		||||
          <view>今日未填</view>
 | 
			
		||||
        </view>
 | 
			
		||||
      </view>
 | 
			
		||||
    </view>
 | 
			
		||||
  </view>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { ref } from 'vue'
 | 
			
		||||
import Taro from '@tarojs/taro'
 | 
			
		||||
import { eventCenter, getCurrentInstance } from '@tarojs/taro'
 | 
			
		||||
 | 
			
		||||
import './index.css'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  setup() {
 | 
			
		||||
    const msg = ref('Hello world')
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      msg
 | 
			
		||||
      userInfo: null,
 | 
			
		||||
      displayUsername: "",
 | 
			
		||||
      isUser: false,
 | 
			
		||||
      isAdmin: false,
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    eventCenter.once(getCurrentInstance().router.onShow, () => {
 | 
			
		||||
      console.log('onShow')
 | 
			
		||||
      this.userInfo = Taro.getStorageSync("userInfo");
 | 
			
		||||
      this.displayUsername = this.userInfo?.username ?? "请登录";
 | 
			
		||||
      if (!this.userInfo) {
 | 
			
		||||
        console.log("用户未登录")
 | 
			
		||||
        Taro.redirectTo({
 | 
			
		||||
          url: '/pages/index/login'
 | 
			
		||||
        })
 | 
			
		||||
      } else {
 | 
			
		||||
        this.isUser = this.userInfo.userType == "user";
 | 
			
		||||
        this.isAdmin = this.userInfo.userType == "admin";
 | 
			
		||||
      }
 | 
			
		||||
    })
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    goCode() {
 | 
			
		||||
      // Taro.navigateTo({
 | 
			
		||||
      //   url: '/pages/residents/code'
 | 
			
		||||
      // })
 | 
			
		||||
      Taro.switchTab({
 | 
			
		||||
        url: '/pages/residents/code'
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								miniprogram-taro/src/pages/index/login.config.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,3 @@
 | 
			
		||||
export default definePageConfig({
 | 
			
		||||
  navigationBarTitleText: '登录'
 | 
			
		||||
})
 | 
			
		||||
							
								
								
									
										28
									
								
								miniprogram-taro/src/pages/index/login.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,28 @@
 | 
			
		||||
.container {
 | 
			
		||||
  line-height: 1.5em;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.login-icon {
 | 
			
		||||
  text-align: center;
 | 
			
		||||
  height: 35vh;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.login-img {
 | 
			
		||||
  width: 50vw;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.login-from {
 | 
			
		||||
  padding: 0 20vw;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.inputText {
 | 
			
		||||
  border-bottom: solid 1px;
 | 
			
		||||
  margin-bottom: 50px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.loginBtnView {
 | 
			
		||||
  margin-top: 70px;
 | 
			
		||||
}
 | 
			
		||||
.loginBtn {
 | 
			
		||||
  margin-bottom: 25px;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										85
									
								
								miniprogram-taro/src/pages/index/login.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,85 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <!--pages/login/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 v-model="username" class="inputText" placeholder="账号" />
 | 
			
		||||
        <!--密码-->
 | 
			
		||||
        <input v-model="password" class="inputText" placeholder="密码" password="true" />
 | 
			
		||||
      </view>
 | 
			
		||||
      <view class="loginBtnView">
 | 
			
		||||
        <!--按钮-->
 | 
			
		||||
        <button class="loginBtn" type="primary" @tap="login">登录</button>
 | 
			
		||||
        <button class="loginBtn" type="secondary" bindtap="visitor">访客申请</button>
 | 
			
		||||
      </view>
 | 
			
		||||
    </view>
 | 
			
		||||
  </view>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import Taro from '@tarojs/taro'
 | 
			
		||||
 | 
			
		||||
import './login.css'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      ...Taro.getApp().globalData,
 | 
			
		||||
      username: '',
 | 
			
		||||
      password: ''
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    login() {
 | 
			
		||||
      if (this.username == '' || this.password == '') {
 | 
			
		||||
        Taro.showToast({
 | 
			
		||||
          title: "请完善登录信息",
 | 
			
		||||
          icon: 'error',
 | 
			
		||||
          duration: 2000
 | 
			
		||||
        })
 | 
			
		||||
      } else {
 | 
			
		||||
        Taro.request({
 | 
			
		||||
          url: `${this.baseUrl}/user/login`,
 | 
			
		||||
          data: {
 | 
			
		||||
            username: this.username,
 | 
			
		||||
            password: this.password,
 | 
			
		||||
          },
 | 
			
		||||
          success: function (d) {
 | 
			
		||||
            let data = d.data;
 | 
			
		||||
            if (data.code == 200) {
 | 
			
		||||
              if (data.status == "success") {
 | 
			
		||||
                Taro.setStorageSync("userInfo", data.userInfo);
 | 
			
		||||
                console.log("userInfo", Taro.getStorageSync("userInfo"))
 | 
			
		||||
                Taro.showToast({
 | 
			
		||||
                  title: "登录成功",
 | 
			
		||||
                  icon: 'success',
 | 
			
		||||
                  success: function () {
 | 
			
		||||
                    Taro.redirectTo({
 | 
			
		||||
                      url: '/pages/index/index'
 | 
			
		||||
                    })
 | 
			
		||||
                  }
 | 
			
		||||
                })
 | 
			
		||||
              } else {
 | 
			
		||||
                Taro.showToast({
 | 
			
		||||
                  title: data.msg,
 | 
			
		||||
                  icon: 'error'
 | 
			
		||||
                })
 | 
			
		||||
              }
 | 
			
		||||
            } else {
 | 
			
		||||
              Taro.showToast({
 | 
			
		||||
                title: data.msg,
 | 
			
		||||
                icon: 'error',
 | 
			
		||||
                duration: 2000
 | 
			
		||||
              })
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										4
									
								
								miniprogram-taro/src/pages/residents/code.config.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,4 @@
 | 
			
		||||
export default definePageConfig({
 | 
			
		||||
	navigationBarTitleText: '身份码'
 | 
			
		||||
  })
 | 
			
		||||
  
 | 
			
		||||
							
								
								
									
										8
									
								
								miniprogram-taro/src/pages/residents/code.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,8 @@
 | 
			
		||||
.time-text {
 | 
			
		||||
  font-weight: bold;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#qrcode {
 | 
			
		||||
  width: 70vw;
 | 
			
		||||
  height: 70vw;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										21
									
								
								miniprogram-taro/src/pages/residents/code.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,21 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <view style="background-color: #F6F6F6;height: 100%;">
 | 
			
		||||
    <image src="../../image/home.jpg" style="width: 100%;height: 130px;"></image>
 | 
			
		||||
  </view>
 | 
			
		||||
  <view style="text-align: center; margin-top: 100px;">
 | 
			
		||||
    <view><text>{{ stuId }} {{ name }}</text></view>
 | 
			
		||||
    <image id="qrcode" src="{{imgUrl}}"></image>
 | 
			
		||||
    <view><text class="time-text">{{ time }}</text></view>
 | 
			
		||||
  </view>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import './code.css'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										28
									
								
								miniprogram-taro/src/utils/utils.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,28 @@
 | 
			
		||||
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 formatNumber = n => {
 | 
			
		||||
  n = n.toString()
 | 
			
		||||
  return n[1] ? n : `0${n}`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const formatDate = date => {
 | 
			
		||||
  const year = date.getFullYear()
 | 
			
		||||
  const month = date.getMonth() + 1
 | 
			
		||||
  const day = date.getDate()
 | 
			
		||||
 | 
			
		||||
  return [year, month, day].map(formatNumber).join('-')
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
module.exports = {
 | 
			
		||||
  formatTime,
 | 
			
		||||
  formatDate
 | 
			
		||||
}
 | 
			
		||||