yaoyi 3 nedēļas atpakaļ
vecāks
revīzija
dc4cc228f3

+ 62 - 0
pom.xml

@@ -229,7 +229,69 @@
         </dependency>
 
 
+        <!-- E签宝 start -->
 
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpmime</artifactId>
+            <version>4.5.14</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.5.14</version>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.module</groupId>
+            <artifactId>jackson-module-jaxb-annotations</artifactId>
+            <version>2.15.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-freemarker</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>esign-cn</groupId>
+            <artifactId>paas-sdk</artifactId>
+            <version>3.0.20</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.itextpdf</groupId>
+            <artifactId>kernel</artifactId>
+            <version>8.0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>com.itextpdf</groupId>
+            <artifactId>io</artifactId>
+            <version>8.0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>com.itextpdf</groupId>
+            <artifactId>layout</artifactId>
+            <version>8.0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>com.itextpdf</groupId>
+            <artifactId>pdfa</artifactId>
+            <version>8.0.4</version>
+        </dependency>
+
+
+        <dependency>
+            <groupId>org.zefer</groupId>
+            <artifactId>pd4ml</artifactId>
+            <version>3.7.0</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.zefer</groupId>
+            <artifactId>css</artifactId>
+            <version>2.0.0</version>
+        </dependency>
+
+        <!-- E签宝  end -->
 
     </dependencies>
 

+ 60 - 0
src/main/java/com/hr/config/EsignConfig.java

@@ -0,0 +1,60 @@
+package com.hr.config;
+
+/**
+ * @author yaoy
+ * @createTime 2025/10/17 13:51
+ **/
+
+
+import com.hr.repository.service.impl.EsignServiceImpl;
+import com.hr.util.ClientHelper;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.stereotype.Component;
+
+import java.util.Map;
+
+@Component
+@ConfigurationProperties("esign.config")
+@Data
+@Slf4j
+public class EsignConfig {
+    private Map<String,String> porps;
+    @Autowired
+    private EsignServiceImpl esignService;
+
+    //应用ID,沙箱环境7开头,正式环境5开头
+    private String projectId ;
+    //
+//    //应用Secret
+//    @Value("${esign.secret}")
+    private String secret ;
+    //
+//    //协议类型(可选HTTP或HTTPS)
+//    private final HttpType HTTP_TYPE = HttpType.HTTP;
+//
+//    //e签宝环境地址 模拟环境:http://smlitsm.tsign.cn:8080    正式环境:http://sdkapi.esign.cn
+//    @Value("${esign.apiHost}")
+    private String apiHost;
+
+    private Boolean istest;
+
+    public Boolean getIstest() {
+        return istest;
+    }
+
+    @Bean
+    public Object initEsign() {
+        //开放平台地址
+        String API_URL = apiHost + "/tgmonitor/rest/app!getAPIInfo2";
+        log.info("{}初始化e签宝配置完成API_HOST:{}", "initEsign",apiHost);
+        ClientHelper.initProps(projectId, secret, API_URL);
+        esignService.initEsign();
+        return new Object();
+    }
+
+}

+ 44 - 0
src/main/java/com/hr/controller/EsignController.java

@@ -0,0 +1,44 @@
+package com.hr.controller;
+
+import com.hr.dto.EsignParmDto;
+import com.hr.dto.EsignReturnDto;
+import com.hr.repository.service.EsignService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author yaoy
+ * @createTime 2025/10/17 11:55
+ **/
+@Slf4j
+@RestController
+@RequestMapping("/esign")
+public class EsignController {
+    @Autowired
+    private EsignService esignService;
+    /***
+     * 通过e签宝进行签名
+     * @param parm
+     * @return
+     */
+    @PostMapping("platform")
+    public EsignReturnDto platformSignByPdfStream(@RequestBody EsignParmDto parm){
+        return esignService.platformSignByPdfStream(parm);
+    }
+
+
+    /***
+     * 本地签名,不通过e签宝
+     * @param parm
+     * @return
+     */
+    @PostMapping("hrSign")
+    public EsignReturnDto hrSignByPdfStream(@RequestBody EsignParmDto parm){
+        return esignService.hrSignByPdfStream(parm);
+    }
+
+}

+ 72 - 0
src/main/java/com/hr/dto/EsignParmDto.java

@@ -0,0 +1,72 @@
+package com.hr.dto;
+
+/**
+   
+   @author yaoy
+   @createTime 2025/10/17 11:52 
+**/
+import com.timevale.esign.paas.tech.enums.SignType;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.Map;
+
+@Data
+public class EsignParmDto {
+
+    private Date createTime;
+
+    private String posPage;// 签署页码(除关键字签章外,页码均不可为空)若为多页签章,支持指定多个页码,例如格式:“1-3,5,8“
+    private Integer posX;// 签署位置X坐标,若为关键字定位,相对于关键字的X坐标偏移量,默认0
+    private Integer posY;// 签署位置Y坐标,若为关键字定位,相对于关键字的Y坐标偏移量,默认0
+    private String keyWord;// 关键字,仅限关键字签章时有效,若为关键字定位时,不可空
+
+
+    private String keyWordUser;
+    private Integer posXUser;
+    private Integer posYUser;
+    private Integer widthUser;
+    /***
+     * 签章宽度*高度
+     */
+    private Integer width;
+    /***
+     * 签章宽度*高度
+     */
+    public Integer getWidth() {
+        return width;
+    }
+    /***
+     * 签章宽度*高度
+     */
+    public void setWidth(Integer width) {
+        this.width = width;
+    }
+
+
+    private Boolean addSignTime;
+    private String sealId;//e签宝上面的印章id
+    private String sealData;//印章图片base64
+
+    private String sealDataUserName;//用户签章图片base64
+    private SignType signType;//签章类型:Single,单页签章; Multi,多页签章; Edges,签骑缝章; Key,关键字签章
+    //    private byte[] srcPdfBytes;//源pdf文件byte数组
+    private String freeMarkerContent;
+    private Map<String,Object> parmData;
+    private String fileName;//文件名字
+    private String ossFileName;//文件名字
+
+    /***
+     * 签章增加高度,以便放日期文字
+     */
+    private Integer addFontHeight=45;
+    /***
+     * 日期文字大小
+     */
+    private Integer addFontSize=43;
+    /***
+     * 日期间隔
+     */
+    private Integer charSpacing=6;
+}
+

+ 14 - 0
src/main/java/com/hr/dto/EsignReturnDto.java

@@ -0,0 +1,14 @@
+package com.hr.dto;
+
+import lombok.Data;
+
+/**
+ * @author yaoy
+ * @createTime 2025/10/17 11:57
+ **/
+@Data
+public class EsignReturnDto {
+    private Integer code;
+    private String msg;
+    private String ossurl ;
+}

+ 26 - 0
src/main/java/com/hr/repository/service/EsignService.java

@@ -0,0 +1,26 @@
+package com.hr.repository.service;
+
+import com.hr.dto.EsignParmDto;
+import com.hr.dto.EsignReturnDto;
+
+/**
+ * @author yaoy
+ * @createTime 2025/10/17 11:58
+ **/
+public interface EsignService {
+
+    /***
+     * 通过e签宝进行签名
+     * @param parm
+     * @return
+     */
+    public EsignReturnDto platformSignByPdfStream(EsignParmDto parm);
+
+
+    /***
+     * 本地签名,不通过e签宝
+     * @param parm
+     * @return
+     */
+    public EsignReturnDto hrSignByPdfStream(EsignParmDto parm);
+}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1456 - 0
src/main/java/com/hr/repository/service/impl/EsignServiceImpl.java


+ 70 - 0
src/main/java/com/hr/repository/service/impl/FontManager.java

@@ -0,0 +1,70 @@
+package com.hr.repository.service.impl;
+
+import jakarta.annotation.PostConstruct;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.stereotype.Component;
+
+import java.awt.*;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * @author yaoy
+ * @createTime 2025/10/17 15:21
+ **/
+
+@Component
+@Slf4j
+public class FontManager {
+
+    private volatile Font cachedFont;
+    private final Object lock = new Object();
+
+    @PostConstruct
+    public void init() {
+        // 应用启动时预加载字体
+        getFont(12f); // 预加载默认大小的字体
+    }
+
+    /**
+     * 获取字体对象,带缓存机制
+     */
+    public Font getFont(float size) {
+        if (cachedFont == null) {
+            synchronized (lock) {
+                if (cachedFont == null) {
+                    cachedFont = loadBaseFont();
+                }
+            }
+        }
+        return cachedFont.deriveFont(size);
+    }
+
+    /**
+     * 加载基础字体(只加载一次)
+     */
+    private Font loadBaseFont() {
+
+        ClassPathResource resource = new ClassPathResource("fonts/simsun.ttf");
+        try {
+            InputStream fontStream = resource.getInputStream();
+            Font f= Font.createFont(Font.TRUETYPE_FONT, fontStream);
+            log.info("字体加载成功");
+            return f;
+        }catch (Exception e) {
+            log.error("加载字体失败:{}",e.getMessage(),e);
+            return new Font("SansSerif", Font.PLAIN, 12);
+        }
+
+    }
+
+    /**
+     * 清除缓存(很少需要调用)
+     */
+    public void clearCache() {
+        synchronized (lock) {
+            cachedFont = null;
+        }
+    }
+}

+ 188 - 0
src/main/java/com/hr/util/ClientHelper.java

@@ -0,0 +1,188 @@
+package com.hr.util;
+
+/**
+ * @author yaoy
+ * @createTime 2025/10/17 12:05
+ **/
+
+import java.text.MessageFormat;
+import com.timevale.esign.paas.tech.bean.result.Result;
+import com.timevale.esign.paas.tech.client.ServiceClient;
+import com.timevale.esign.paas.tech.client.ServiceClientManager;
+import com.yy.basedevelop.common.util.ruoyi.exception.ServiceException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import com.timevale.tech.sdk.bean.HttpConnectionConfig;
+import com.timevale.tech.sdk.bean.ProjectConfig;
+import com.timevale.tech.sdk.bean.SignatureConfig;
+import com.timevale.tech.sdk.constants.AlgorithmType;
+
+
+
+/**
+ * description SDK客户端辅助类
+ */
+public class ClientHelper {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(ClientHelper.class);
+    public static final AlgorithmType ALGORITHM_TYPE = AlgorithmType.HMACSHA256;
+    private static String PROJECT_ID ;
+    //e签宝公钥,可从开放平台获取,若算法类型为RSA,此项必填
+    public static final String ESIGN_PUB_KEY = null;
+
+    //e签宝私钥,可从开放平台下载密钥生成工具生成,若算法为RSA,此项必填
+    public static final String ESIGN_PRI_KEY = null;
+
+    //应用Secret
+    private static String PROJECT_SECRET ;
+
+    private static String API_URL;
+
+    public static String getProjectId() {
+        return PROJECT_ID;
+    }
+
+    public static void setProjectId(String projectId) {
+        PROJECT_ID = projectId;
+    }
+
+    public static void initProps(String prjid, String secret, String url){
+        PROJECT_ID=prjid;
+        PROJECT_SECRET=secret;
+        API_URL=url;
+    }
+
+    //----------------------------------------公有方法 start-------------------------------------------
+
+    /**
+     *
+     * description 注册客户端
+     */
+    public static void registClient() throws ServiceException {
+
+        /**1、进行项目配置,从开放平台获取*/
+        ProjectConfig proCfg = getProjectCfg();
+
+        /**2、Http配置*/
+        HttpConnectionConfig httpConCfg = getHttpConCfg();
+
+        /**3、签名配置*/
+        SignatureConfig signCfg = getSignatureCfg();
+
+        /**4、注册客户端*/
+        Result rst = ServiceClientManager.registClient(proCfg, httpConCfg, signCfg);
+
+        if(rst.getErrCode() != 0){
+            String rstMsg = MessageFormat.format("注册[{0}]的客户端失败:errorCode={1},msg={2}",
+                    PROJECT_ID,rst.getErrCode(),rst.getMsg());
+            throw new ServiceException(rstMsg);
+        }
+
+        LOGGER.info("注册[{}]的客户端成功",PROJECT_ID);
+    }
+
+
+
+    /**
+     *
+     * description 获取客户端
+     */
+    public static ServiceClient getServiceClient(String projectId)throws ServiceException{
+        ServiceClient serviceClient = ServiceClientManager.get(projectId);
+        if(serviceClient == null){
+            throw new ServiceException(MessageFormat.format(
+                    "ServiceClient为空,获取[{0}]的客户端失败,请重新注册客户端", projectId));
+        }
+
+        LOGGER.info("获取[{}]的客户端成功", projectId);
+        return serviceClient;
+    }
+
+
+
+    /**
+     *
+     * description 关闭客户端
+     */
+    public static void shutDownServiceClient(String projectId) throws ServiceException{
+        try {
+            ServiceClientManager.shutdown(projectId);
+        } catch (Exception e) {
+            throw new ServiceException(MessageFormat.format(
+                    "[{0}]的客户端关闭异常,请检查[{0}]的客户端是否注册成功或已关闭", projectId));
+        }
+
+        ServiceClient serviceClient = ServiceClientManager.get(projectId);
+        if(serviceClient != null){
+            throw new ServiceException(MessageFormat.format("关闭[{0}]的客户端失败,请检查原因", projectId));
+        }
+
+        LOGGER.info("[{}]的客户端关闭成功", projectId);
+    }
+
+    //----------------------------------------公有方法 end--------------------------------------------
+
+    //----------------------------------------私有方法 start------------------------------------------
+
+    /**
+     *
+     * description 项目配置
+     */
+    private static ProjectConfig getProjectCfg(){
+        ProjectConfig proCfg = new ProjectConfig();
+        //项目ID(应用ID)
+        proCfg.setProjectId(PROJECT_ID);
+        //项目Secret(应用Secret)
+        proCfg.setProjectSecret(PROJECT_SECRET);
+        //开放平台地址
+        proCfg.setItsmApiUrl(API_URL);
+        return proCfg;
+    }
+
+
+
+    /**
+     *
+     * description http配置
+     */
+    private static HttpConnectionConfig getHttpConCfg(){
+        HttpConnectionConfig httpConCfg = new HttpConnectionConfig();
+        //代理服务IP配置
+        //httpConCfg.setProxyIp(null);
+        //代理服务端口
+        //httpConCfg.setProxyPort(null);
+        //协议类型,默认Https
+        //httpConCfg.setHttpType(null);
+        //请求失败重试次数,默认5次
+        //httpConCfg.setRetry(null);
+        //连接超时时间配置,最大不能超过30秒
+        //httpConCfg.setTimeoutConnect(30);
+        //请求超时时间,最大不能超过30
+        //httpConCfg.setTimeoutRequest(30);
+        //代理服务器登录用户名
+        //httpConCfg.setUsername(null);
+        //代理服务器登录密码
+        //httpConCfg.setPassword(null);
+        return httpConCfg;
+    }
+
+
+
+    /**
+     *
+     * description 签名配置
+     */
+    private static SignatureConfig getSignatureCfg(){
+        SignatureConfig signCfg = new SignatureConfig();
+        signCfg.setAlgorithm(ALGORITHM_TYPE);
+
+        //若算法类型是RSA,需要设置e签宝公钥和平台私钥
+        if(AlgorithmType.RSA == ALGORITHM_TYPE){
+            signCfg.setEsignPublicKey(ESIGN_PUB_KEY);
+            signCfg.setPrivateKey(ESIGN_PRI_KEY);
+        }
+        return signCfg;
+    }
+    //----------------------------------------私有方法 end--------------------------------------------
+
+}

+ 1053 - 0
src/main/java/com/hr/util/HtmlToPDFUtil.java

@@ -0,0 +1,1053 @@
+package com.hr.util;
+
+/**
+ * @author yaoy
+ * @createTime 2025/10/17 13:32
+ **/
+import org.apache.commons.lang3.StringUtils;
+import org.zefer.pd4ml.PD4Constants;
+import org.zefer.pd4ml.PD4ML;
+
+import java.awt.*;
+import java.io.*;
+import java.security.InvalidParameterException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * @author L.Wen
+ */
+public class HtmlToPDFUtil {
+    private int topValue = 10;
+    private int leftValue = 20;
+    private int rightValue = 10;
+    private int bottomValue = 10;
+    private int userSpaceWidth = 1024;
+
+    private static String filePath = "D:\\_____Work\\";// 本地测试用
+
+    public static void main(String[] args) {
+        try {
+            HtmlToPDFUtil jt = new HtmlToPDFUtil();
+            String title = "标题-测试生成PDF";
+            String text = "正文-这里是正文";
+            //此处填写你的html文件
+            //在下面,body中设置了style,设置了默认字体为宋体,这样导出时的html语言就默认带有了字体,汉字才会导出成功
+            String html = "<!doctype html>\n" +
+                    "<html lang=\"en\"> \n" +
+                    " <head> \n" +
+                    "  <meta charset=\"utf-8\"> \n" +
+                    "  <meta content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\" name=\"viewport\"> \n" +
+                    "  <meta name=\"format-detection\" content=\"telephone=no\"> \n" +
+                    "  <meta content=\"yes\" name=\"apple-mobile-web-app-capable\"> \n" +
+                    "  <meta content=\"yes\" name=\"apple-touch-fullscreen\"> \n" +
+                    "  <meta content=\"black\" name=\"apple-mobile-web-app-status-bar-style\"> \n" +
+                    "  <link rel=\"stylesheet\" href=\"css/common.css\"> \n" +
+                    "  <script type=\"text/javascript\" src=\"https://loansm.oss-cn-hangzhou.aliyuncs.com/js/jquery-2.2.3.min.js\"></script> \n" +
+                    "  <script type=\"text/javascript\" src=\"https://common-libs-web.oss-cn-hangzhou.aliyuncs.com/mobile-detect.min.js\"></script> \n" +
+                    "  <script type=\"text/javascript\" src=\"https://loansm.oss-cn-hangzhou.aliyuncs.com/js/vue2.js\"></script> \n" +
+                    "  <script type=\"text/javascript\" src=\"../../src/js/tools.js\"></script> \n" +
+                    "  <script type=\"text/javascript\" src=\"../../src/js/config.js\"></script> \n" +
+                    "  <title>个人信息共享授权书</title> \n" +
+                    "  <style>\n" +
+                    "      .containerV2 {\n" +
+                    "        font-size: 13px;\n" +
+                    "        text-indent: 0;\n" +
+                    "        margin: 0;\n" +
+                    "        padding: 0 20px;\n" +
+                    "        line-height: 26px;\n" +
+                    "      }\n" +
+                    "\n" +
+                    "      .mar-top-10 {\n" +
+                    "        margin-top: 5px;\n" +
+                    "      }\n" +
+                    "\n" +
+                    "      .font-we {\n" +
+                    "        font-weight: bold;\n" +
+                    "        color: #000;\n" +
+                    "      }\n" +
+                    "\n" +
+                    "      .table {\n" +
+                    "        display: flex;\n" +
+                    "        flex-direction: column;\n" +
+                    "        width: 100%;\n" +
+                    "        height: auto;\n" +
+                    "        gap: 0;\n" +
+                    "        border: 1px solid #333;\n" +
+                    "      }\n" +
+                    "\n" +
+                    "      .table .table-label {\n" +
+                    "        width: 100%;\n" +
+                    "        font-weight: 600;\n" +
+                    "        /* height: 3rem; */\n" +
+                    "        display: grid;\n" +
+                    "        grid-template-columns: 30px 40px 40px 1fr 1fr 30px;\n" +
+                    "      }\n" +
+                    "\n" +
+                    "      .table .table-label div {\n" +
+                    "        display: flex;\n" +
+                    "        justify-content: center;\n" +
+                    "        align-items: center;\n" +
+                    "        text-align: center;\n" +
+                    "        box-sizing: border-box;\n" +
+                    "        border: 1px solid #333;\n" +
+                    "        line-height: 1.5;\n" +
+                    "      }\n" +
+                    "\n" +
+                    "      .table .table-row {\n" +
+                    "        width: 100%;\n" +
+                    "        display: grid;\n" +
+                    "        grid-template-columns: 30px 40px 40px 1fr 1fr 30px;\n" +
+                    "      }\n" +
+                    "\n" +
+                    "      .table .table-row div {\n" +
+                    "        display: flex;\n" +
+                    "        justify-content: center;\n" +
+                    "        align-items: center;\n" +
+                    "        box-sizing: border-box;\n" +
+                    "        border: 1px solid #333;\n" +
+                    "        height: auto;\n" +
+                    "        line-height: 1.5;\n" +
+                    "        /* 过长无空格字母串与数字为了阅读完整性,不会换行,使用此属性可断字换行 */\n" +
+                    "        word-break: break-all;\n" +
+                    "      }\n" +
+                    "    </style> \n" +
+                    " </head> \n" +
+                    " <body> \n" +
+                    "  <div class=\"containerV2\" id=\"protocolApp\"> \n" +
+                    "   <div style=\"text-indent: 0; font-weight: 700\">\n" +
+                    "    重要提示:\n" +
+                    "   </div> \n" +
+                    "   <div style=\"text-indent: 2em\"> <span style=\"font-weight: bold\"> 为维护您(以下简称“本人”或“您”)的合法权益,请在线签署《个人信息共享授权书》(以下简称“本授权书”)前,仔细阅读、充分理解本授权书各条款内容,特别是免除或减轻<span>张三</span><span>、121212121212</span>及其关联公司(以下简称“被授权人”)责任,或限制您权利的条款,其中免除或减轻责任条款将以黑体加粗形式提示您。您点击本授权书所在页面按钮并进入下一页面或勾选本授权书即视为您已阅读本授权书,并同意接受本授权书条款的约束,本授权书即完成在线签署并生效。<span style=\"font-weight: normal\">为了保护您的个人信息,本授权书在向您展示时将部分隐藏您的身份信息,您的身份信息详情以您在本平台账户对应的实名信息为准。 </span> </span> \n" +
+                    "   </div> \n" +
+                    "   <div align=\"center\" style=\"padding-top: 10px\" class=\"bg\"> \n" +
+                    "    <h3>个人信息共享授权书</h3> \n" +
+                    "   </div> \n" +
+                    "   <div class=\"mar-top-10\"> <span class=\"font-we\">本人姓名: 李四 </span> \n" +
+                    "    <br> <span style=\"white-space: nowrap; text-indent: 2em\" class=\"font-we\">本人身份证号码: 1212121211111 </span> \n" +
+                    "   </div> \n" +
+                    "   <br> \n" +
+                    "   <div class=\"mar-top-10 font-we\" style=\"text-indent: 0\">\n" +
+                    "    一、定义\n" +
+                    "   </div> \n" +
+                    "   <div>\n" +
+                    "    1、个人信息,指如下信息:\n" +
+                    "   </div> \n" +
+                    "   <div>\n" +
+                    "     (1)<span style=\"font-weight: bold\">个人识别信息,</span>指本人的<span style=\"font-weight: bold\"> 手机号码、微信号、身份证号码 , </span> 以及平台通过向本人申请电话状态权限/IDFA权限、位置权限(如涉及)而收集的本人的 <span style=\"font-weight: bold\"> 唯一设备识别码(IMEI、IMSI)、IP地址、地理位置。 </span> \n" +
+                    "   </div> \n" +
+                    "   <div>\n" +
+                    "     (2)<span style=\"font-weight: bold\">个人资质信息 ,</span> 指本人的 <span style=\"font-weight: bold\"> 姓名、年龄、户籍、现居住地址、婚姻状况、配偶信息(如涉及)、常用邮箱地址、房产情况(房产类型、房产价值等)、车辆情况(车辆品牌、车辆价值、车牌号、购车方式等)、工资发放形式、教育程度、信用情况(芝麻信用分、逾期信息等)、社保情况、公积金情况、信用卡情况、商业保单情况、月工资收入、职业类型、经营企业情况、单位/公司名称、单位/公司电话、单位/公司地址、单位/公司性质、紧急联系人信息、贷款用途(具体以本人在页面实际填写的信息为准)。 </span> 其中<span style=\"font-weight: bold\">紧急联系人信息指本人与紧急联系人的关系、紧急联系人的姓名及电话,</span> 配偶信息指 <span style=\"font-weight: bold\"> 本人配偶的姓名、身份证号、工作电话及联系电话。 </span> \n" +
+                    "   </div> \n" +
+                    "   <div>\n" +
+                    "     (3)<span style=\"font-weight: bold\">个人账户信息,</span> 指本人的 <span style=\"font-weight: bold\">银行卡号、开户行、开户行地址、预留手机号。 </span> \n" +
+                    "   </div> \n" +
+                    "   <div>\n" +
+                    "     2、助贷/助融机构,指为本人提供贷款服务、产品,融资服务或产品,贷款咨询服务的机构,在本授权书下机构指 <span style=\"font-weight: bold\">根据本人个人信息匹配出的机构</span> 及其前述机构的分支机构、关联方,具体详见本协议底部表格所列之机构。 \n" +
+                    "   </div> \n" +
+                    "   <div>\n" +
+                    "     3、广告及分析服务类提供商,指受被授权人委托对本人的产品需求/偏好进行评估,并向本人推荐本人需要的贷款产品及服务的第三方机构,具体详见本协议底部表格所列之机构。 \n" +
+                    "   </div> \n" +
+                    "   <div>\n" +
+                    "     4、信用机构及数据服务商,指基于被授权人委托,向被授权人提供本人的身份识别信息、风险识别信息、资质评估信息、表征信用情况的综合评分或信用评级的第三方机构,具体详见本协议底部表格所列之机构。 \n" +
+                    "   </div> \n" +
+                    "   <div class=\"mar-top-10 font-we\">\n" +
+                    "     二、授权内容 \n" +
+                    "    <br> 1、在平台为本人提供服务过程中,为了便于被授权人向本人推荐适合本人的贷款产品,本人授权被授权人收集并存储本人提交的个人信息。 \n" +
+                    "    <br> 2、为了便于助贷/助融机构根据本人的资信情况对本人进行授信评估,确定本人是否满足监管机构要求及最终是否向本人放款,以实现本人的借款交易目的,本人授权被授权人将本人的个人识别信息、个人资质信息、个人账户信息(如涉及)共享给助贷/助融机构,同时授权助贷/助融机构基于前述目的收集、存储、使用、分析本人的个人信息。 \n" +
+                    "    <br> 3、为了对本人的产品需求/偏好进行评估,并向本人推荐平台产品及服务,本人授权被授权人将本人的个人识别信息共享给广告及分析服务类提供商,同时授权广告及分析服务类提供商分析评估本人的产品需求/偏好,并将分析评估结果反馈给被授权人或者直接根据分析评估结果向本人拨打电话为本人推荐产品。 \n" +
+                    "    <br> 4、为了对本人的信用状况进行评估,本人授权被授权人将本人的姓名、手机号码、身份证号共享给信用机构及数据服务商进行分析处理,并将处理后的信息分析结果反馈给被授权人,同时授权信用机构及数据服务商基于本人的前述个人信息获取本人的身份识别信息、风险识别信息、资质评估信息、表征信用情况的综合评估或信用评级,并将前述结果提供给被授权人。 \n" +
+                    "    <br> 5、本人已经充分认识到本人的财产性信息对本人而言是私密且重要的信息(本授权书项下的财产性信息包括本人的住房性质、公积金情况、社保情况、车辆情况、月工资收入、商业保单情况、企业主情况、信用情况及个人账户信息),本人已经充分理解并知悉提供和使用财产性信息的风险,这些风险包括但不限于:纳入这些信息对本人的信用评级(评分)、信用报告等结果可能产生不利影响,该等信息被被授权人依法提供给第三方后被他人不当利用的风险,因本人的信用状况较好而造成本人被第三方推销产品或服务等打扰的风险等。 \n" +
+                    "    <br> \n" +
+                    "   </div> \n" +
+                    "   <div class=\"mar-top-10 font-we\">\n" +
+                    "    三、授权期限\n" +
+                    "   </div> \n" +
+                    "   <div class=\"mar-top-10\">\n" +
+                    "     本授权书自本人签署时生效。授权期限自本授权书生效之日起至本人与被授权人的业务终止之日止, <span style=\"font-weight: bold\"> 但在授权有效期内被授权人已实施的行为及依其自身性质需在授权终止后实施或需持续实施的行为,不受授权终止的影响。本授权书具有独立法律效力,不因本人签署的任何业务合同或协议成立与否、效力状态变化(包括但不限于部分或全部条款无效或被撤销而无效或失效)的影响。 </span> \n" +
+                    "   </div> \n" +
+                    "   <br> \n" +
+                    "   <div class=\"mar-top-10 font-we\">\n" +
+                    "    四、争议解决\n" +
+                    "   </div> \n" +
+                    "   <div class=\"mar-top-10\">\n" +
+                    "     若本人与被授权人发生任何纠纷或争议,应友好协商解决。 <span style=\"font-weight: bold\"> 协商解决不成的,本人同意将纠纷或争议提交至本授权书签订地(即重庆市两江新区)有管辖权的人民法院。 </span> \n" +
+                    "   </div> \n" +
+                    "   <br> \n" +
+                    "   <div class=\"mar-top-10 font-we\">\n" +
+                    "     五、本人已知悉本授权书所有内容(特别是加粗字体内容)的意义及由此产生的法律效力,自愿作出上述授权,本授权书是本人真实的意思表示,本人同意承担由此带来的一切法律后果。 \n" +
+                    "   </div> \n" +
+                    "   <br> \n" +
+                    "   <div class=\"mar-top-10 font-we\"> \n" +
+                    "    <p style=\"margin: 0; text-align: right\">登录账号:<span>222222222222222</span></p> \n" +
+                    "    <p style=\"margin: 0; text-align: right\">uid:<span>kkkkkkk</span></p> \n" +
+                    "   </div> \n" +
+                    "   <br> \n" +
+                    "   <div class=\"mar-top-10 font-we\">\n" +
+                    "    六、附:机构列表\n" +
+                    "   </div> \n" +
+                    "   <table class=\"table\"> \n" +
+                    "    <tr> \n" +
+                    "     <th>\n" +
+                    "      序号\n" +
+                    "     </th> \n" +
+                    "     <th>\n" +
+                    "      机构类型\n" +
+                    "     </th> \n" +
+                    "     <th>\n" +
+                    "      机构名称\n" +
+                    "     </th> \n" +
+                    "     <th>\n" +
+                    "      共享个人信息范围\n" +
+                    "     </th> \n" +
+                    "     <th>\n" +
+                    "      使用目的\n" +
+                    "     </th> \n" +
+                    "     <th>\n" +
+                    "      官方电话\n" +
+                    "     </th> \n" +
+                    "    </tr>\n" +
+                    "    <tr> \n" +
+                    "     <td>\n" +
+                    "      1\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      助贷/助融机构\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      新疆万鸿信息科技有限公司\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      姓名,手机号,IP,年龄,性别,所在城市,职业身份,教育程度,社保,公积金,房产,车产,个人保险,芝麻分,当前逾期情况,贷款金额,贷款期限,月收入,工资发放形式,月经营流水,月开票收入,营业执照,系统类型,信用卡\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      为您匹配贷款产品、服务机构或贷款咨询顾问\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      \n" +
+                    "     </td> \n" +
+                    "    </tr>\n" +
+                    "<tr> \n" +
+                    "     <td>\n" +
+                    "      2\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      助贷/助融机构\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      上海侯曦信息科技有限公司\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      姓名,手机号,IP,年龄,性别,所在城市,职业身份,教育程度,社保,公积金,房产,车产,个人保险,芝麻分,当前逾期情况,贷款金额,贷款期限,月收入,工资发放形式,月经营流水,月开票收入,营业执照,系统类型,信用卡\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      为您匹配贷款产品、服务机构或贷款咨询顾问\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      \n" +
+                    "     </td> \n" +
+                    "    </tr>\n" +
+                    "<tr> \n" +
+                    "     <td>\n" +
+                    "      3\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      助贷/助融机构\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      智博融资租赁(深圳)有限公司\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      姓名,手机号,IP,年龄,性别,所在城市,职业身份,教育程度,社保,公积金,房产,车产,个人保险,芝麻分,当前逾期情况,贷款金额,贷款期限,月收入,工资发放形式,月经营流水,月开票收入,营业执照,系统类型,信用卡\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      为您匹配贷款产品、服务机构或贷款咨询顾问\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      \n" +
+                    "     </td> \n" +
+                    "    </tr>\n" +
+                    "<tr> \n" +
+                    "     <td>\n" +
+                    "      4\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      助贷/助融机构\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      恒昌众鼎融资租赁有限公司\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      姓名,手机号,IP,年龄,性别,所在城市,职业身份,教育程度,社保,公积金,房产,车产,个人保险,芝麻分,当前逾期情况,贷款金额,贷款期限,月收入,工资发放形式,月经营流水,月开票收入,营业执照,系统类型,信用卡\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      为您匹配贷款产品、服务机构或贷款咨询顾问\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      \n" +
+                    "     </td> \n" +
+                    "    </tr>\n" +
+                    "<tr> \n" +
+                    "     <td>\n" +
+                    "      5\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      信用机构及数据服务商\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      杭州天谷信息科技有限公司\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      姓名、身份证号\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      实名认证\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      400-0878-198\n" +
+                    "     </td> \n" +
+                    "    </tr>\n" +
+                    "<tr> \n" +
+                    "     <td>\n" +
+                    "      6\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      信用机构及数据服务商\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      贵州数据宝网络科技有限公司\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      姓名、手机号\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      手机号归属地检测、二要素认证、空号检测\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      400-0999-656\n" +
+                    "     </td> \n" +
+                    "    </tr>\n" +
+                    "<tr> \n" +
+                    "     <td>\n" +
+                    "      7\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      信用机构及数据服务商\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      郑州埃文科技有限公司\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      IP地址\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      IP归属地检测\n" +
+                    "     </td> \n" +
+                    "     <td>\n" +
+                    "      400-0371-911\n" +
+                    "     </td> \n" +
+                    "    </tr>\n" +
+                    "   </table> \n" +
+                    "   <div style=\"height: 60px\"></div> \n" +
+                    "  </div>  \n" +
+                    "  <script>\n" +
+                    "    let appId = getQueryString(\"appId\");\n" +
+                    "    let userId = getQueryString(\"userId\");\n" +
+                    "    let phone = getQueryString(\"phone\");\n" +
+                    "    let isAlliance = getQueryString(\"isAlliance\");\n" +
+                    "\n" +
+                    "    new Vue({\n" +
+                    "      el: \"#protocolApp\",\n" +
+                    "      data: {\n" +
+                    "        appId: \"\",\n" +
+                    "\n" +
+                    "        // 用户相关\n" +
+                    "        uid: \"\",\n" +
+                    "        phone: \"\",\n" +
+                    "        realName: \"\",\n" +
+                    "        idCardNo: \"\",\n" +
+                    "\n" +
+                    "        // 公司相关\n" +
+                    "        companyName: \"\",\n" +
+                    "        actualOperator: \"\",\n" +
+                    "\n" +
+                    "        isAlliance: 1,\n" +
+                    "        allianceId: \"\",\n" +
+                    "        productId: [],\n" +
+                    "        requestId: \"\",\n" +
+                    "        channelCode: \"\",\n" +
+                    "        productIdList: [],\n" +
+                    "        alliancePlanList: [],\n" +
+                    "        carPlanList: [],\n" +
+                    "\n" +
+                    "        // 机构列表\n" +
+                    "        institutionList: [],\n" +
+                    "        institutionTypeObj: {\n" +
+                    "          0: \"助贷/助融机构\",\n" +
+                    "          1: \"信用机构及数据服务商\",\n" +
+                    "          2: \"助贷/助融机构\",\n" +
+                    "        }, // 机构类型\n" +
+                    "      },\n" +
+                    "      methods: {\n" +
+                    "        ParamsFn() {\n" +
+                    "          var reg = /^(\\d{3})\\d{4}(\\d{4})$/;\n" +
+                    "          const urlParams = new URLSearchParams(window.location.search);\n" +
+                    "          const encodedParams = urlParams.get(\"params\");\n" +
+                    "          console.log(encodedParams);\n" +
+                    "          const params = JSON.parse(encodedParams);\n" +
+                    "          console.log(\"params\", params);\n" +
+                    "\n" +
+                    "          if (appId) this.appId = appId;\n" +
+                    "          if (userId) this.uid = userId;\n" +
+                    "          if (phone) this.phone = (phone + \"\").replace(reg, \"$1****$2\");\n" +
+                    "          if (isAlliance) this.isAlliance = isAlliance;\n" +
+                    "\n" +
+                    "          if (!params) return;\n" +
+                    "\n" +
+                    "          this.appId = params.appId;\n" +
+                    "          this.companyName = params.companyName;\n" +
+                    "          this.companyAddress = params.companyAddress;\n" +
+                    "          this.phone = (params.phone + \"\").replace(reg, \"$1****$2\");\n" +
+                    "          this.uid = params.uid;\n" +
+                    "          this.idCardNo = params.idCardNo;\n" +
+                    "          this.realName = params.realName;\n" +
+                    "          this.productId = params.productId;\n" +
+                    "          this.isAlliance = params.isAlliance;\n" +
+                    "          this.allianceId = params.allianceId;\n" +
+                    "          this.requestId = params.requestId;\n" +
+                    "          this.channelCode = params.channelCode;\n" +
+                    "          this.productIdList = params.productIdList || [];\n" +
+                    "          this.alliancePlanList = params.alliancePlanList || [];\n" +
+                    "          this.carPlanList = params.carPlanList || [];\n" +
+                    "        },\n" +
+                    "        async getAppinfo() {\n" +
+                    "          try {\n" +
+                    "            const res = await $.ajax({\n" +
+                    "              url: `/api/v1/get/appinfo/`,\n" +
+                    "              type: \"post\",\n" +
+                    "            });\n" +
+                    "\n" +
+                    "            if (res.code === 0) {\n" +
+                    "              this.companyName = res.data.companyName;\n" +
+                    "              this.actualOperator = res.data.actualOperator;\n" +
+                    "            }\n" +
+                    "          } catch (error) {\n" +
+                    "            console.error(\"获取应用信息失败:\", error);\n" +
+                    "          }\n" +
+                    "        },\n" +
+                    "      },\n" +
+                    "      async mounted() {\n" +
+                    "        let _this = this;\n" +
+                    "\n" +
+                    "        _this.ParamsFn();\n" +
+                    "\n" +
+                    "        await _this.getAppinfo();\n" +
+                    "\n" +
+                    "        if (_this.isAlliance == 0) {\n" +
+                    "          // 2024-11-13 新增接口\n" +
+                    "          $.ajax({\n" +
+                    "            url: baseRequestUrl + \"/alliance/unionProduct/agreementConfig\", // url\n" +
+                    "            data: JSON.stringify({ planId: _this.allianceId }),\n" +
+                    "            headers: { userId: _this.uid },\n" +
+                    "            contentType: \"application/json\",\n" +
+                    "            type: \"post\", // type 默认POST\n" +
+                    "            async: false,\n" +
+                    "            success: function (res) {\n" +
+                    "              if (res.code == 0) {\n" +
+                    "                _this.institutionList = res.data;\n" +
+                    "              }\n" +
+                    "            },\n" +
+                    "            error: function (e) {\n" +
+                    "              console.log(e);\n" +
+                    "            },\n" +
+                    "          });\n" +
+                    "        } else if (_this.isAlliance == 1) {\n" +
+                    "          // 同业联盟接口\n" +
+                    "          $.ajax({\n" +
+                    "            url: baseRequestUrl + \"/alliance/agreementConfig\", // url\n" +
+                    "            type: \"get\", // type 默认POST\n" +
+                    "            async: false,\n" +
+                    "            success: function (res) {\n" +
+                    "              console.log(res, \"同业联盟\");\n" +
+                    "              if (res.code == 0) {\n" +
+                    "                // 同业联盟数据\n" +
+                    "                console.log(\"同业联盟数据\", res.data);\n" +
+                    "                _this.institutionList = res.data;\n" +
+                    "              }\n" +
+                    "            },\n" +
+                    "            error: function (e) {\n" +
+                    "              console.log(e);\n" +
+                    "            },\n" +
+                    "          });\n" +
+                    "        } else if (_this.isAlliance == 2) {\n" +
+                    "          // requestId\n" +
+                    "          let data = {\n" +
+                    "            allianceId: _this.allianceId,\n" +
+                    "          };\n" +
+                    "          if (_this.requestId) {\n" +
+                    "            data.requestId = _this.requestId;\n" +
+                    "          }\n" +
+                    "          // 新卖量接口\n" +
+                    "          $.ajax({\n" +
+                    "            url: baseRequestUrl + \"/alliance/newModel/agreementConfig/v2\",\n" +
+                    "            data: JSON.stringify(data),\n" +
+                    "            headers: { userId: _this.uid },\n" +
+                    "            contentType: \"application/json\",\n" +
+                    "            type: \"post\", // type 默认POST\n" +
+                    "            async: false,\n" +
+                    "            success: function (res) {\n" +
+                    "              if (res.code === 0) {\n" +
+                    "                console.log(\"新同业联盟卖量请求结果\", res);\n" +
+                    "                _this.institutionList = res.data;\n" +
+                    "              }\n" +
+                    "            },\n" +
+                    "          });\n" +
+                    "        } else if (_this.isAlliance == 3) {\n" +
+                    "          let url = baseRequestUrl + \"/h5/car/loan/agreementConfig\";\n" +
+                    "          if (_this.allianceId) {\n" +
+                    "            url += `?productPlanId=`;\n" +
+                    "          }\n" +
+                    "          $.ajax({\n" +
+                    "            url,\n" +
+                    "            async: false,\n" +
+                    "            type: \"get\",\n" +
+                    "            success: function (res) {\n" +
+                    "              if (res.code === 0) {\n" +
+                    "                console.log(\"车抵贷协议请求结果\", res);\n" +
+                    "                _this.institutionList = res.data;\n" +
+                    "              }\n" +
+                    "            },\n" +
+                    "            error: function (e) {\n" +
+                    "              console.error(\"车抵贷协议请求错误\", e);\n" +
+                    "            },\n" +
+                    "          });\n" +
+                    "        } else if (_this.isAlliance == 4) {\n" +
+                    "          // 极速贷\n" +
+                    "          let url = baseRequestUrl + \"/h5/fast/agreementConfig\";\n" +
+                    "          if (_this.allianceId) {\n" +
+                    "            url += `?productPlanId=`;\n" +
+                    "          }\n" +
+                    "\n" +
+                    "          $.ajax({\n" +
+                    "            url,\n" +
+                    "            async: false,\n" +
+                    "            type: \"get\",\n" +
+                    "            success: function (result) {\n" +
+                    "              if (result.code == 0) {\n" +
+                    "                _this.institutionList = result.data;\n" +
+                    "              }\n" +
+                    "            },\n" +
+                    "            error: function (error) {\n" +
+                    "              console.error(\"极速贷协议请求错误\", error);\n" +
+                    "            },\n" +
+                    "          });\n" +
+                    "        } else if (_this.isAlliance === 5) {\n" +
+                    "          // 房抵贷\n" +
+                    "          let url = baseRequestUrl + \"/h5/house/loan/agreementConfig\";\n" +
+                    "\n" +
+                    "          if (_this.allianceId) {\n" +
+                    "            url += `?productPlanId=`;\n" +
+                    "          }\n" +
+                    "          $.ajax({\n" +
+                    "            url,\n" +
+                    "            async: false,\n" +
+                    "            type: \"get\",\n" +
+                    "            success: function (res) {\n" +
+                    "              if (res.code === 0) {\n" +
+                    "                console.log(\"房抵贷协议请求结果\", res);\n" +
+                    "                _this.institutionList = res.data;\n" +
+                    "              }\n" +
+                    "            },\n" +
+                    "            error: function (e) {\n" +
+                    "              console.error(\"房抵贷协议请求错误\", e);\n" +
+                    "            },\n" +
+                    "          });\n" +
+                    "        } else {\n" +
+                    "          let params = {};\n" +
+                    "\n" +
+                    "          // -2 同业产品授权页 -3 助贷授权页\n" +
+                    "          if (_this.isAlliance == -2 || _this.isAlliance == -3) {\n" +
+                    "            if (_this.productIdList.length) params.productIdList = _this.productIdList;\n" +
+                    "            if (_this.alliancePlanList.length) params.alliancePlanList = _this.alliancePlanList;\n" +
+                    "            if (_this.carPlanList.length) params.carPlanList = _this.carPlanList;\n" +
+                    "\n" +
+                    "            if (_this.channelCode) params.channelCode = _this.channelCode;\n" +
+                    "          } else {\n" +
+                    "            params.productIdList = _this.productId;\n" +
+                    "          }\n" +
+                    "\n" +
+                    "          const data = JSON.stringify(params);\n" +
+                    "          $.ajax({\n" +
+                    "            url: baseRequestUrl + \"/agreement/product/showAgreement\",\n" +
+                    "            type: \"post\",\n" +
+                    "            async: false,\n" +
+                    "            contentType: \"application/json\",\n" +
+                    "            data,\n" +
+                    "            headers: { userId: _this.uid },\n" +
+                    "            success: function (res) {\n" +
+                    "              if (res.code == 0) {\n" +
+                    "                _this.institutionList = res.data;\n" +
+                    "              }\n" +
+                    "            },\n" +
+                    "            error: function (err) {\n" +
+                    "              console.log(\"个人信息授权书产品部分获取失败\", err);\n" +
+                    "            },\n" +
+                    "          });\n" +
+                    "        }\n" +
+                    "      },\n" +
+                    "    });\n" +
+                    "  </script> \n" +
+                    " </body>\n" +
+                    "</html>";
+
+            html="<!doctype html>\n" +
+                    "<html lang=\"en\"> \n" +
+                    " <head> \n" +
+                    "  <meta charset=\"utf-8\"> \n" +
+                    "  <meta content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\" name=\"viewport\"> \n" +
+                    "  <meta name=\"format-detection\" content=\"telephone=no\"> \n" +
+                    "  <meta content=\"yes\" name=\"apple-mobile-web-app-capable\"> \n" +
+                    "  <meta content=\"yes\" name=\"apple-touch-fullscreen\"> \n" +
+                    "  <meta content=\"black\" name=\"apple-mobile-web-app-status-bar-style\"> \n" +
+                    "  <link rel=\"stylesheet\" href=\"css/common.css\"> \n" +
+                    "  <script type=\"text/javascript\" src=\"https://loansm.oss-cn-hangzhou.aliyuncs.com/js/jquery-2.2.3.min.js\"></script> \n" +
+                    "  <script type=\"text/javascript\" src=\"https://common-libs-web.oss-cn-hangzhou.aliyuncs.com/mobile-detect.min.js\"></script> \n" +
+                    "  <script type=\"text/javascript\" src=\"https://loansm.oss-cn-hangzhou.aliyuncs.com/js/vue2.js\"></script> \n" +
+                    "  <script type=\"text/javascript\" src=\"../../src/js/tools.js\"></script> \n" +
+                    "  <script type=\"text/javascript\" src=\"../../src/js/config.js\"></script> \n" +
+                    "  <title>个人信息共享授权书</title> \n" +
+                    "  <style>\n" +
+                    "    </style> \n" +
+                    " </head> \n" +
+                    " <body> \n" +
+                    "  <div class=\"container\" id=\"app\"> \n" +
+                    "   <p class=\"MsoNormal\" align=\"center\" style=\"text-align:center;font-family:DengXian;font-size:12px;\"> <b><span style=\"font-family:华文宋体;line-height:35.2px;font-size:22px;\">个人信息共享授权书</span></b><span style=\"font-family:华文宋体;line-height:35.2px;font-size:22px;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;text-indent:21px;\"> <b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">重要提示:</span></b><b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span></b> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;text-indent:21px;\"> <b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"><span>为维护您(以下简称</span>“本人”或“您”)的合法权益,请在线签署《个人信息共享授权书》(以下简称“本授权书”)前,仔细阅读、充分理解本授权书各条款内容,特别是免除或减轻</span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">张三</span><b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"><span>(以下简称</span>“被授权人”)责任</span></b><b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">,或限制您权利的条款,其中免除或减轻责任条款将以黑体加粗形式提示您。您点击本授权书所在页面按钮并进入下一页面或勾选本授权书即视为您已阅读本授权书,并同意接受本授权书条款的约束,本授权书即完成在线签署并生效。</span></b><b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span></b> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;text-indent:21px;\"> <b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\"><span>本人姓名:</span>李四</span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;text-indent:21px;\"> <b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\"><span>本人身份证号码:</span>1212121211111</span></b><b><i><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span></i></b><b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;text-indent:21px;\"> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">(为了保护您的个人信息,本授权书在向您展示时将部分隐藏您的身份信息,您的身份信息详情以您在本平台账户对应的实名信息为准)</span><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">&nbsp;</span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;text-indent:21px;\"> <b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">一、定义</span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">1、个人信息,指您的如下信息:</span><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"><span>(</span>1)</span><b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">个人识别信息</span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">,指您的</span><b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">手机号码、微信号</span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"><span>,以及平台通过向您申请电话状态权限</span>/IDFA权限、位置权限(如涉及)而收集的您的</span><b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\"><span>唯一设备识别码(</span>IMEI、IMSI)、IP地址、地理位置。</span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"><span>(</span>2)</span><b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">个人资质信息</span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">,指您的</span><b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\"><span>姓名、年龄、户籍、现居住地址、婚姻状况、配偶信息(如涉及)、常用邮箱地址、房产情况(房产类型、房产价值等)、车辆情况(车辆品牌、车辆价值等)、工资发放形式、教育程度、信用情况(芝麻信用分、逾期信息等)、社保情况、公积金情况、信用卡情况、商业保单情况、月工资收入、职业类型、经营企业情况、单位</span>/公司名称、单位/公司电话、单位/公司地址、单位/公司性质、紧急联系人信息、贷款用途(具体以您在页面实际填写的信息为准)</span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">。其中</span><b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">紧急联系人信息指您与紧急联系人的关系、紧急联系人的姓名及电话</span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">,配偶信息指</span><b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">您配偶的姓名、身份证号、工作电话及联系电话</span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">。</span><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"><span>(</span>3)</span><b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">个人账户信息</span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">,指您的</span><b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">银行卡号、开户行、开户行地址、预留手机号。</span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">2、贷款机构,指提供贷款产品的贷款服务机构,包括安庆市银谷小额贷款有限责任公司,及本平台合作机构,具体见本授权书合作机构列表。</span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px; font-weight: 400;\"> 3、广告及分析服务类提供商,指受被授权人委托对您的产品需求/偏好进行评估, 并向您推荐您需要的贷款产品及服务的第三方机构,具体详见本协议附件所列的第三方公司。 </span> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px; font-weight: normal;\">4、信用机构及数据服务商,指基于被授权人委托,向被授权人提供您的身份识别信息、风险识别信息、资质评估信息、表征信用情况的综合评分或信用评级的第三方机构,具体详见本协议附件所列的第三方公司。</span><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">&nbsp;</span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;text-indent:21px;\"> <b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">二、授权内容</span></b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">1、 在平台为您提供服务过程中,为了便于平台贷款机构根据您的资信情况对您进行授信评估,您授权被授权人收集并存储您提交的个人信息。</span></b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">2、为了便于贷款机构确定您是否满足监管机构要求及最终是否向您放款,以实现您的借款交易目的,您授权被授权人将您的个人识别信息、个人资质信息、个人账户信息(如涉及)共享给贷款机构,同时授权贷款机构基于前述目的收集、存储、使用、分析您的个人信息。</span></b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">3、为了对您的产品需求/偏好进行评估,并向您推荐平台产品及服务,您授权被授权人将您的个人识别信息共享给广告及分析服务类提供商,同时授权广告及分析服务类提供商分析评估您的产品需求/偏好,并将分析评估结果反馈给被授权人或者直接根据分析评估结果向您拨打电话为您推荐产品。</span></b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">4、为了对您的信用状况进行评估,以为您提供您选择的金融产品或服务,您授权被授权人将您的姓名、手机号码、身份证号共享给信用机构及数据服务商进行分析处理,并将处理后的信息分析结果反馈给被授权人,同时授权信用机构及数据服务商基于您的前述个人信息获取您的身份识别信息、风险识别信息、资质评估信息、表征信用情况的综合评估或信用评级,并将前述结果提供给被授权人。</span></b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">5、您已经充分认识到您的财产性信息对您而言是私密且重要的信息(本授权书项下的财产性信息包括您的住房性质、公积金情况、社保情况、车辆情况、月工资收入、商业保单情况、企业主情况、信用情况及个人账户信息),您已经充分理解并知悉提供和使用财产性信息的风险,这些风险包括但不限于:纳入这些信息对您的信用评级(评分)、信用报告等结果可能产生不利影响,该等信息被被授权人依法提供给第三方后被他人不当利用的风险,因您的信用状况较好而造成您被第三方推销产品或服务等打扰的风险等。</span></b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">&nbsp;</span> </p> <!-- 新增同业联盟协议 --> \n" +
+                    "   <p> </p>\n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;text-indent:21px;\"> <b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">三、个人信息的共享</span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span> </p> <b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span><b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"> 为了根据您的需求进行更好的风控/贷款额度评估,您授权同意我们将收集的个人信息共享给如下合作机构: </span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span> \n" +
+                    "   <table border cellspacing=\"0\" width=\"100%\"> \n" +
+                    "    <thead> \n" +
+                    "     <tr> \n" +
+                    "      <th> 产品名称 </th> \n" +
+                    "      <th> 共享信息目的 </th> \n" +
+                    "      <th> 共享个人信息范围 </th> \n" +
+                    "      <th> 授权公司全称 </th> \n" +
+                    "      <th> 官方电话 </th> \n" +
+                    "      <th> 共享方式 </th> \n" +
+                    "      <th>相关协议</th> \n" +
+                    "     </tr> \n" +
+                    "    </thead> <!-- 循环数据 allianceList --> \n" +
+                    "    <tbody>\n" +
+                    "     <tr null> \n" +
+                    "      <td> <!-- 机构简称1 --> 银谷E贷 </td> \n" +
+                    "      <td> <!-- 共享信息目的1 --> 实名认证,匹配借款需求、额度评估 </td> \n" +
+                    "      <td> <!-- 共享个人信息范围1 --> 姓名,手机号,IP,年龄,性别,所在城市,职业身份,教育程度,社保,公积金,房产,车产,个人保险,芝麻分,当前逾期情况,贷款金额,贷款期限,月收入,工资发放形式,月经营流水,月开票收入,营业执照,系统类型,信用卡 </td> \n" +
+                    "      <td> <!-- 授权公司全称 1 --> 安庆市银谷小额贷款有限责任公司 </td> \n" +
+                    "      <td> <!-- 官方电话1 --> 400-963-8005 </td> \n" +
+                    "      <td> <!-- 共享方式1 --> 后台接口传输 </td> \n" +
+                    "      <td> \n" +
+                    "        \n" +
+                    "       <template v-else> \n" +
+                    "        <div>\n" +
+                    "         /\n" +
+                    "        </div> \n" +
+                    "       </template> </td> \n" +
+                    "     </tr> <tr null> \n" +
+                    "      <td> <!-- 机构简称1 --> 吉分期 </td> \n" +
+                    "      <td> <!-- 共享信息目的1 --> 实名认证,匹配借款需求、额度评估 </td> \n" +
+                    "      <td> <!-- 共享个人信息范围1 --> 姓名,手机号,IP,年龄,性别,所在城市,职业身份,教育程度,社保,公积金,房产,车产,个人保险,芝麻分,当前逾期情况,贷款金额,贷款期限,月收入,工资发放形式,月经营流水,月开票收入,营业执照,系统类型,信用卡 </td> \n" +
+                    "      <td> <!-- 授权公司全称 1 --> 河池市铠丰小额贷款有限责任公司 </td> \n" +
+                    "      <td> <!-- 官方电话1 --> 18977813333 </td> \n" +
+                    "      <td> <!-- 共享方式1 --> 后台接口传输 </td> \n" +
+                    "      <td> \n" +
+                    "        \n" +
+                    "       <template v-else> \n" +
+                    "        <div>\n" +
+                    "         /\n" +
+                    "        </div> \n" +
+                    "       </template> </td> \n" +
+                    "     </tr> \n" +
+                    "    </tbody>\n" +
+                    "   </table> \n" +
+                    "   <p></p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;text-indent:21px;\"> <b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">四、授权期限</span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;text-indent:21px;\"> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px; font-weight: normal;\">本授权书自您签署时生效。授权期限自本授权书生效之日起至您与我们的业务终止之日止,</span><b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">但在授权有效期内我们已实施的行为及依其自身性质需在授权终止后实施或需持续实施的行为,不受授权终止的影响。本授权书具有独立法律效力,不因您签署的任何业务合同或协议成立与否、效力状态变化(包括但不限于部分或全部条款无效或被撤销而无效或失效)的影响。</span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">&nbsp;</span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;text-indent:21px;\"> <b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">五、争议解决</span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;text-indent:21px;\"> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px; font-weight: normal;\">若本人与被授权人发生任何纠纷或争议,应友好协商解决。</span><b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">协商解决不成的,本人同意将纠纷或争议提交至本授权书签订地(即重庆市两江新区)有管辖权的人民法院</span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">。</span><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">&nbsp;</span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;text-indent:21px;\"> <b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">六、本人已知悉本授权书所有内容(特别是加粗字体内容)的意义及由此产生的法律效力,自愿作出上述授权,本授权书是本人真实的意思表示,本人同意承担由此带来的一切法律后果。</span></b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" align=\"right\" style=\"text-align:right;font-family:DengXian;font-size:12px;\"> <span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\">&nbsp;</span> </p> \n" +
+                    "   <p class=\"MsoNormal\" align=\"right\" style=\"text-align:right;font-family:DengXian;font-size:12px;\"> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px; font-weight: normal;\"><span>您的登录账号:</span></span><b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"> 222222222222222 </span></b><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span> </p> \n" +
+                    "   <p class=\"MsoNormal\" align=\"right\" style=\"text-align:right;font-family:DengXian;font-size:12px;\"> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px; font-weight: normal;\"><span>您的</span>UID:</span><span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">kkkkkkk</span> </p> \n" +
+                    "   <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;\"> <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\">&nbsp;</span> </p> <!-- <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;text-indent:21px;\">\n" +
+                    "            <b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\"><span>七、</span>\n" +
+                    "                    <span>附件:</span></span></b><span style=\"line-height:22.4px;font-size:14px; font-weight: 700;\"></span>\n" +
+                    "        </p>\n" +
+                    "        <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;text-indent:21px;\">\n" +
+                    "            <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px; font-weight: normal;\">广告及分析服务类提供商的名称及联系方式:</span><span\n" +
+                    "                style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span>\n" +
+                    "        </p>\n" +
+                    "        <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;text-indent:21px;\">\n" +
+                    "            <span\n" +
+                    "                style=\"font-family:华文宋体;line-height:22.4px;font-size:14px; font-weight: normal;\"><span>(</span>1)海尔消费金融有限公司(山东省青岛市崂山区海尔路1号甲1号楼);</span><span\n" +
+                    "                style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span>\n" +
+                    "        </p>\n" +
+                    "        <p class=\"MsoNormal\" style=\"font-family:DengXian;font-size:12px;text-indent:21px;\">\n" +
+                    "            <span style=\"font-family:华文宋体;line-height:22.4px;font-size:14px; font-weight: normal;\">联系方式:400-0878-198</span><span\n" +
+                    "                style=\"font-family:华文宋体;line-height:22.4px;font-size:14px;\"></span>\n" +
+                    "        </p> --> \n" +
+                    "   <div style=\"height: 200px;\"> \n" +
+                    "   </div> \n" +
+                    "  </div> \n" +
+                    "  <script>\n" +
+                    "        let userId = getQueryString('userId') || 1256\n" +
+                    "        let appId = getQueryString('appId') || 106\n" +
+                    "        let uid = getQueryString('userId') ? getQueryString('userId') : ''\n" +
+                    "        var reg = /^(\\d{3})\\d{4}(\\d{4})$/;\n" +
+                    "        let phone = getQueryString('phone') ? getQueryString('phone').replace(reg, \"$1****$2\") : ''\n" +
+                    "        new Vue({\n" +
+                    "            el: '#app',\n" +
+                    "            data: {\n" +
+                    "                appName: '惠融钱包',\n" +
+                    "                companyName: '重庆惠融数字科技有限公司',\n" +
+                    "                realName: '',\n" +
+                    "                idCardNo: '',\n" +
+                    "                certifyTime: '',\n" +
+                    "                phone: '',\n" +
+                    "                uid: '',\n" +
+                    "                allianceList: [\n" +
+                    "                    {\n" +
+                    "                        name: '银谷E贷',\n" +
+                    "                        sharePurpose: '实名认证,匹配借款需求、额度评估',\n" +
+                    "                        shareRange: '姓名,手机号,IP,年龄,性别,所在城市,职业身份,教育程度,社保,公积金,房产,车产,个人保险,芝麻分,当前逾期情况,贷款金额,贷款期限,月收入,工资发放形式,月经营流水,月开票收入,营业执照,系统类型,信用卡',\n" +
+                    "                        shareCompanyFullName: '安庆市银谷小额贷款有限责任公司',\n" +
+                    "                        companyMobile: '400-963-8005',\n" +
+                    "                        shareType: '后台接口传输',\n" +
+                    "                        aggreementConfigVOS: null\n" +
+                    "                    },\n" +
+                    "                    {\n" +
+                    "                        name: '吉分期',\n" +
+                    "                        sharePurpose: '实名认证,匹配借款需求、额度评估',\n" +
+                    "                        shareRange: '姓名,手机号,IP,年龄,性别,所在城市,职业身份,教育程度,社保,公积金,房产,车产,个人保险,芝麻分,当前逾期情况,贷款金额,贷款期限,月收入,工资发放形式,月经营流水,月开票收入,营业执照,系统类型,信用卡',\n" +
+                    "                        shareCompanyFullName: '河池市铠丰小额贷款有限责任公司',\n" +
+                    "                        companyMobile: '18977813333',\n" +
+                    "                        shareType: '后台接口传输',\n" +
+                    "                        aggreementConfigVOS: null\n" +
+                    "                    },\n" +
+                    "                    // {\n" +
+                    "                    //     name: '闪钱借款',\n" +
+                    "                    //     sharePurpose: '实名认证,匹配借款需求、额度评估',\n" +
+                    "                    //     shareRange: '姓名,手机号,IP,年龄,性别,所在城市,职业身份,教育程度,社保,公积金,房产,车产,个人保险,芝麻分,当前逾期情况,贷款金额,贷款期限,月收入,工资发放形式,月经营流水,月开票收入,营业执照,系统类型,信用卡',\n" +
+                    "                    //     shareCompanyFullName: '山西安易信互联网小额贷款有限公司',\n" +
+                    "                    //     companyMobile: '0357-2223353',\n" +
+                    "                    //     shareType: '后台接口传输'\n" +
+                    "                    // },\n" +
+                    "                    // {\n" +
+                    "                    //     name: '期贷',\n" +
+                    "                    //     sharePurpose: '实名认证,匹配借款需求、额度评估',\n" +
+                    "                    //     shareRange: '姓名,手机号,IP,年龄,性别,所在城市,职业身份,教育程度,社保,公积金,房产,车产,个人保险,芝麻分,当前逾期情况,贷款金额,贷款期限,月收入,工资发放形式,月经营流水,月开票收入,营业执照,系统类型,信用卡',\n" +
+                    "                    //     shareCompanyFullName: '重庆两江新区通融小额贷款有限公司',\n" +
+                    "                    //     companyMobile: '023-88151333',\n" +
+                    "                    //     shareType: '后台接口传输',\n" +
+                    "                    //     aggreementConfigVOS: [\n" +
+                    "                    //         {\n" +
+                    "                    //             showName: '服务协议',\n" +
+                    "                    //             showUrl: 'https://h5.bicredit.xin/view/agreement/external/qd-server.html'\n" +
+                    "                    //         },\n" +
+                    "                    //         {\n" +
+                    "                    //             showName: '隐私政策',\n" +
+                    "                    //             showUrl: 'https://h5.bicredit.xin/view/agreement/external/qd.html'\n" +
+                    "                    //         }\n" +
+                    "                    //     ]\n" +
+                    "                    // }\n" +
+                    "                ],// 同业联盟数据\n" +
+                    "            },\n" +
+                    "            mounted: function () {\n" +
+                    "                console.log('uidl',uid)\n" +
+                    "                this.phone = phone\n" +
+                    "                this.uid = uid\n" +
+                    "                let _this = this;\n" +
+                    "                $.ajax({\n" +
+                    "                    url: baseRequestUrl + '/api/v1/get/appinfo/' + appId, // url\n" +
+                    "                    type: 'post', // type 默认POST\n" +
+                    "                    async: false,\n" +
+                    "                    success: function (res) {\n" +
+                    "                        if (res.code === 0) {\n" +
+                    "                            _this.appName = res.data.appName ? res.data.appName : '惠融钱包'\n" +
+                    "                            _this.companyName = res.data.companyName ? res.data.companyName : '重庆惠融数字科技有限公司'\n" +
+                    "                        }\n" +
+                    "                    },\n" +
+                    "                    error: function (e) {\n" +
+                    "                        console.log(e)\n" +
+                    "                    }\n" +
+                    "                });\n" +
+                    "\n" +
+                    "                $.ajax({\n" +
+                    "                    url: baseRequestUrl + '/api/v1/get/realinfo/' + userId, // url\n" +
+                    "                    type: 'post', // type 默认POST\n" +
+                    "                    async: false,\n" +
+                    "                    success: function (res) {\n" +
+                    "                        console.log(res, 'res')\n" +
+                    "                        if (res.code === 0 && res.data) {\n" +
+                    "                            _this.realName = res.data.realName ? res.data.realName : ''\n" +
+                    "                            _this.idCardNo = res.data.idCardNo ? res.data.idCardNo : ''\n" +
+                    "                            _this.certifyTime = res.data.certifyTime ? res.data.certifyTime : ''\n" +
+                    "                        }\n" +
+                    "                    },\n" +
+                    "                    error: function (e) {\n" +
+                    "                        console.log(e)\n" +
+                    "                    }\n" +
+                    "                });\n" +
+                    "                // 同业联盟接口\n" +
+                    "                // $.ajax({\n" +
+                    "                //     url: baseRequestUrl + '/alliance/agreementConfig', // url\n" +
+                    "                //     type: 'get', // type 默认POST\n" +
+                    "                //     async: false,\n" +
+                    "                //     success: function (res) {\n" +
+                    "                //         console.log(res, '同业联盟')\n" +
+                    "                //         if (res.code == 0) {\n" +
+                    "                //             // 同业联盟数据\n" +
+                    "                //             console.log('同业联盟数据', res.data)\n" +
+                    "                //             _this.allianceList = res.data\n" +
+                    "                //         }\n" +
+                    "                //     },\n" +
+                    "                //     error: function (e) {\n" +
+                    "                //         console.log(e)\n" +
+                    "\n" +
+                    "                //     }\n" +
+                    "                // });\n" +
+                    "            },\n" +
+                    "            methods: {\n" +
+                    "                idCardFn(idCard) {\n" +
+                    "                    let reg = /^(.{4})(?:\\d+)(.{2})$/\n" +
+                    "                    return idCard.replace(reg, '\\$1**********\\$2') || ''\n" +
+                    "                },\n" +
+                    "                noPassByName(str) {\n" +
+                    "                    if (null != str && str != undefined) {\n" +
+                    "                        if (str.length == 2) {\n" +
+                    "                            return str.substring(0, 1) + '*' //截取name 字符串截取第一个字符,\n" +
+                    "                        } else if (str.length == 3) {\n" +
+                    "                            return str.substring(0, 1) + \"*\" + str.substring(2, 3)//截取第一个和第三个字符\n" +
+                    "                        } else if (str.length > 3) {\n" +
+                    "                            return str.substring(0, 1) + \"*\" + '*' + str.substring(3, str.length)//截取第一个和大于第4个字符\n" +
+                    "                        }\n" +
+                    "                    } else {\n" +
+                    "                        return \"\";\n" +
+                    "                    }\n" +
+                    "                },\n" +
+                    "            }\n" +
+                    "        })\n" +
+                    "\n" +
+                    "\n" +
+                    "    </script>  \n" +
+                    " </body>\n" +
+                    "</html>";
+            Map<String, Object> paramMap = new HashMap<>();
+            paramMap.put("title", title);
+            paramMap.put("text", text);
+            //获取查询结果
+            for (Map.Entry<String, Object> entry : paramMap.entrySet()) {
+                //替换标签值内容
+                if (StringUtils.isNotEmpty(html)) {
+                    html = html.replace("${" + entry.getKey() + "}$", entry.getValue().toString());
+                }
+            }
+            //此处填写你下载的地方
+            String fileName = UUID.randomUUID().toString() + ".pdf";
+            String fileAbsolutePath = filePath + fileName;
+            jt.doConversion(html, fileAbsolutePath);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 将html里面的标签内容替换成指定内容,并转换成pdf,返回pdf文件的路径
+     *
+     * @param paramMap  指定内容
+     * @param html      html字符串
+     * @param localPath 本地目录
+     * @return pdf文件的路径
+     */
+    public static String htmlStr2PDF(Map<String, Object> paramMap, String html, String localPath) {
+        String fileAbsolutePath = "";
+        try {
+            HtmlToPDFUtil jt = new HtmlToPDFUtil();
+            for (Map.Entry<String, Object> entry : paramMap.entrySet()) {
+                //替换标签值内容
+                if (StringUtils.isNotEmpty(html)) {
+                    html = html.replace("${" + entry.getKey() + "}$", entry.getValue().toString());
+                }
+            }
+            // 此处填写pdf文件的路径
+            String fileName = UUID.randomUUID().toString() + ".pdf";
+            fileAbsolutePath = localPath + fileName;
+            jt.doConversion(html, fileAbsolutePath);
+            return fileAbsolutePath;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "";
+        }
+
+    }
+
+    public byte[] doConversion(String htmlDocument) throws InvalidParameterException, IOException {
+        PD4ML pd4ml = new PD4ML();
+        pd4ml.enableDebugInfo();
+        pd4ml.setHtmlWidth(userSpaceWidth);
+        pd4ml.setPageSize(pd4ml.changePageOrientation(PD4Constants.A4));
+        pd4ml.setPageInsetsMM(new Insets(topValue, leftValue, bottomValue, rightValue));
+        pd4ml.addStyle("BODY {margin: 0; font-family:MSJH;}", true);//background:#111;
+        pd4ml.addStyle(".table {display: flex;flex-direction: column;width: 100%;height: auto;gap: 0;border: 1px solid #333;}",true);
+        pd4ml.addStyle(".table .table-label {width: 100%;font-weight: 600;display: grid;grid-template-columns: 30px 40px 40px 1fr 1fr 30px;}",true);
+        pd4ml.addStyle(".table .table-row {width: 100%;display: grid;grid-template-columns: 30px 40px 40px 1fr 1fr 30px;}",true);
+        pd4ml.addStyle(".table .table-row div {display: flex;justify-content: center;align-items: center;box-sizing: border-box;border: 1px solid #333;height: auto;line-height: 1.5;word-break: break-all;}",true);
+        pd4ml.addStyle("/* 表格整体样式 */\n" +
+                "        table {\n" +
+                "            width: 100%; /* 表格宽度占满父容器 */\n" +
+                "            border-collapse: collapse; /* 合并边框 */\n" +
+                "            text-align: center; /* 文字居中对齐 */\n" +
+                "        }\n" +
+                "\n" +
+                "        /* 表头样式 */\n" +
+                "        th {\n" +
+                "             text-align:center; "+
+                "            font-weight: bold; /* 加粗 */\n" +
+                "            border: 1px solid #333; /* 边框 */\n" +
+                "        }\n" +
+                "\n" +
+                "        /* 表格单元格样式 */\n" +
+                "        td {\n" +
+                "       text-align: center; vertical-align: middle;"+
+                "            border: 1px solid #333; /* 边框 */\n" +
+                "        }\n" +
+//                "\n" +
+//                "        /* 表格行样式 */\n" +
+//                "        tr:nth-child(even) {\n" +
+//                "            background-color: #f9f9f9; /* 偶数行背景颜色(浅灰色) */\n" +
+//                "        }\n" +
+//                "\n" +
+                "        /* 表格标题样式 */\n" +
+                "        caption {\n" +
+                "            font-weight: bold; /* 加粗 */\n" +
+                "        }",true);
+        String classPath = HtmlToPDFUtil.class.getResource("/") + "fonts";
+        pd4ml.useTTF(classPath, true);
+        pd4ml.setDefaultTTFs("SimSun", "SimSun", "SimSun");
+        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+        pd4ml.render(new StringReader(htmlDocument), byteArrayOutputStream);
+        byteArrayOutputStream.close();
+        return byteArrayOutputStream.toByteArray();
+    }
+
+    /**
+     * 将字符串形式的html转换成pdf
+     *
+     * @param htmlDocument 字符串形式的html
+     * @param outputPath   转换成pdf的存放位置
+     * @throws InvalidParameterException
+     * @throws IOException
+     */
+    public void doConversion(String htmlDocument, String outputPath) throws InvalidParameterException, IOException {
+        PD4ML pd4ml = new PD4ML();
+        pd4ml.enableDebugInfo();
+        pd4ml.setHtmlWidth(userSpaceWidth);
+        pd4ml.setPageSize(pd4ml.changePageOrientation(PD4Constants.A4));
+        pd4ml.setPageInsetsMM(new Insets(topValue, leftValue, bottomValue, rightValue));
+        pd4ml.addStyle("BODY {margin: 0; font-family:MSJH;}", true);//background:#111;
+        pd4ml.addStyle(".table {display: flex;flex-direction: column;width: 100%;height: auto;gap: 0;border: 1px solid #333;}",true);
+        pd4ml.addStyle(".table .table-label {width: 100%;font-weight: 600;display: grid;grid-template-columns: 30px 40px 40px 1fr 1fr 30px;}",true);
+        pd4ml.addStyle(".table .table-row {width: 100%;display: grid;grid-template-columns: 30px 40px 40px 1fr 1fr 30px;}",true);
+        pd4ml.addStyle(".table .table-row div {display: flex;justify-content: center;align-items: center;box-sizing: border-box;border: 1px solid #333;height: auto;line-height: 1.5;word-break: break-all;}",true);
+        pd4ml.addStyle("/* 表格整体样式 */\n" +
+                "        table {\n" +
+                "            width: 100%; /* 表格宽度占满父容器 */\n" +
+                "            border-collapse: collapse; /* 合并边框 */\n" +
+                "            text-align: center; /* 文字居中对齐 */\n" +
+                "        }\n" +
+                "\n" +
+                "        /* 表头样式 */\n" +
+                "        th {\n" +
+                "             text-align:center; "+
+                "            font-weight: bold; /* 加粗 */\n" +
+                "            border: 1px solid #333; /* 边框 */\n" +
+                "        }\n" +
+                "\n" +
+                "        /* 表格单元格样式 */\n" +
+                "        td {\n" +
+                "       text-align: center; vertical-align: middle;"+
+                "            border: 1px solid #333; /* 边框 */\n" +
+                "        }\n" +
+//                "\n" +
+//                "        /* 表格行样式 */\n" +
+//                "        tr:nth-child(even) {\n" +
+//                "            background-color: #f9f9f9; /* 偶数行背景颜色(浅灰色) */\n" +
+//                "        }\n" +
+//                "\n" +
+                "        /* 表格标题样式 */\n" +
+                "        caption {\n" +
+                "            font-weight: bold; /* 加粗 */\n" +
+                "        }",true);
+        String classPath = HtmlToPDFUtil.class.getResource("/") + "fonts";
+        pd4ml.useTTF(classPath, true);
+        pd4ml.setDefaultTTFs("SimSun", "SimSun", "SimSun");
+        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+        pd4ml.render(new StringReader(htmlDocument), byteArrayOutputStream);
+        byteArrayOutputStream.close();
+        File output = new File(outputPath);
+        FileOutputStream fos = new FileOutputStream(output);
+        fos.write(byteArrayOutputStream.toByteArray());
+        fos.close();
+    }
+
+    /**
+     * 将 html文件读取成字符串
+     *
+     * @param path     html文件位置
+     * @param encoding 编码格式
+     * @return 字符串
+     * @throws IOException
+     */
+    private static String readFile(String path, String encoding) throws IOException {
+        File f = new File(path);
+        FileInputStream is = new FileInputStream(f);
+        BufferedInputStream bis = new BufferedInputStream(is);
+        ByteArrayOutputStream fos = new ByteArrayOutputStream();
+        byte[] buffer = new byte[2048];
+        int read;
+        do {
+            read = is.read(buffer, 0, buffer.length);
+            if (read > 0) {
+                fos.write(buffer, 0, read);
+            }
+        } while (read > -1);
+        fos.close();
+        bis.close();
+        is.close();
+        return fos.toString(encoding);
+    }
+
+}

+ 129 - 0
src/main/java/com/hr/util/SignHelper.java

@@ -0,0 +1,129 @@
+package com.hr.util;
+
+/**
+ * @author yaoy
+ * @createTime 2025/10/17 13:31
+ **/
+import com.timevale.esign.paas.tech.bean.request.OrgSignParam;
+import com.timevale.esign.paas.tech.bean.request.PersonSignParam;
+import com.timevale.esign.paas.tech.bean.request.PlatformSignParam;
+import com.timevale.esign.paas.tech.bean.result.FileDigestSignResult;
+import com.timevale.esign.paas.tech.client.ServiceClient;
+//import cn.tsign.hz.exception.DefineException;
+import com.timevale.esign.paas.tech.service.PlatformSignService;
+import com.timevale.esign.paas.tech.service.UserSignService;
+import esign.utils.exception.SuperException;
+//import net.sf.json.JSONObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.text.MessageFormat;
+
+/**
+ * description SDK签署辅助类
+ */
+public class SignHelper {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(SignHelper.class);
+    private PlatformSignService platformSignService;
+    private UserSignService userSignService;
+    private ServiceClient serviceClient;
+
+    public SignHelper(ServiceClient serviceClient) {
+        this.serviceClient = serviceClient;
+        this.platformSignService = serviceClient.platformSignService();
+        this.userSignService = serviceClient.userSignService();
+    }
+
+    // -----------------------------------公有方法 start-------------------------------------------
+
+
+    /**
+     *
+     * description 平台自身PDF文件签署
+     */
+    public FileDigestSignResult platformSign(PlatformSignParam platformSignParam)
+            throws SuperException {
+        FileDigestSignResult signRst = platformSignService.platformSign(platformSignParam);
+        return signRst;
+//        castSignRst(signRst, "平台自身");
+    }
+
+
+
+
+
+
+    // -----------------------------------公有方法  end---------------------------------------------
+
+    // -----------------------------------私有方法  start-------------------------------------------
+
+    /**
+     *
+     * description 签署结果处理
+     */
+    private void castSignRst(FileDigestSignResult signRst, String typeMsg) throws SuperException {
+
+        if (signRst.getErrCode() != 0) {
+            throw new SuperException(
+                    MessageFormat.format("{0}签署失败: errCode = {1},msg = {2}",
+                            typeMsg, signRst.getErrCode(), signRst.getMsg()));
+        }
+        if (signRst.getStream() != null) {
+            signLog(signRst.getSignServiceId(), signRst.getDstFilePath(), typeMsg, true);
+            //String outSignedPdfPath = "/Users/zhanghe/Downloads/Signed_pdf.pdf";
+            //FileHelper.saveFileByStream(signRst.getStream(), outSignedPdfPath);// 将PDF文件字节流保存为本地PDF文件
+//            System.out.println("签署成功" + JSONObject.fromObject(signRst));
+        }else if(signRst.getStream() == null) {
+            signLog(signRst.getSignServiceId(), signRst.getDstFilePath(), typeMsg, false);
+//            System.out.println("签署成功" + JSONObject.fromObject(signRst));
+        }
+
+    }
+
+
+    /**
+     *
+     * description 记录签署后打印日志
+     */
+    private void signLog(String signServiceId,String dstFilePath, String typeMsg, boolean streamSign) {
+        LOGGER.info("{}签署成功:SignServiceId [{}],"
+                + "请妥善保管签署记录ID(SignServiceId)", typeMsg, signServiceId);
+
+        if (streamSign) {
+            LOGGER.info("{}签署成功, 请妥善保管签署后的文件字节流",typeMsg);
+        } else {
+            LOGGER.info("{}签署成功后的PDF文件存放路径:{},请妥善保管签署后的文件",typeMsg, dstFilePath);
+        }
+    }
+
+
+    // -----------------------------------私有方法  end---------------------------------------------
+
+    // -----------------------------------getter 、setter 方法  start-------------------------------
+    public ServiceClient getServiceClient() {
+        return serviceClient;
+    }
+
+    public void setServiceClient(ServiceClient serviceClient) {
+        this.serviceClient = serviceClient;
+    }
+
+    public PlatformSignService getPlatformSignService() {
+        return platformSignService;
+    }
+
+    public void setPlatformSignService(PlatformSignService platformSignService) {
+        this.platformSignService = platformSignService;
+    }
+
+    public UserSignService getUserSignService() {
+        return userSignService;
+    }
+
+    public void setUserSignService(UserSignService userSignService) {
+        this.userSignService = userSignService;
+    }
+
+    // -----------------------------------getter 、setter 方法  end---------------------------------
+
+}

+ 1 - 0
src/main/resources/fonts/pd4fonts.properties

@@ -0,0 +1 @@
+SimSun = simsun.ttf

BIN
src/main/resources/fonts/simsun.ttf


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels