sanlin.shi 1 vuosi sitten
vanhempi
commit
80f87f9c16

BIN
src/main/webapp/static/deviceListExcel.xlsx


BIN
src/main/webapp/static/k8小容器授权列表.xlsx


BIN
src/main/webapp/static/三方API授权设备模板.xls


+ 99 - 0
src/main/webapp/static/支付宝三要素授权对接文档.docx

@@ -0,0 +1,99 @@
+                 支付宝三要素授权对接文档20230615
+                                       
+                                       
+ 接入方跳转至服务商小程序
+   跳转至服务商三要素授权小程序
+
+  调用支付宝my.navigateToMiniProgram的api  (具体参考支付宝官方api说明)
+   服务商小程序appId: 2021003181682188
+   页面路径path: pages/authorize_three/authorize_three
+   参数query: 
+     name:标识商户的小程序名称;
+     notify:授权成功后三要素数据回调地址;
+     token:认证分配的唯一token;
+     taskId:任务id ;
+ 
+ 
+ 
+   跳转示例代码:
+   my.navigateToMiniProgram({
+      appId: "2021003181682188", 
+      path: "pages/authorize_three/authorize_three",
+       query: {
+         name: "商户小程序名称",
+         notify: "http://www.test.com/xxx",
+         token: "xxxxxxxxxxxxxxxxxxxxxxxxxx",
+         taskId: "xxxxxxxxxxxxxxxxxxxxxxxxxx"
+       }
+   })
+   备注:taskId不可重复,并请自行缓存,授权成功后回调地址会携带该参数。
+ 
+ 
+二.接入方开发notify接收接口
+   (4)三要素接收接口
+   
+   授权成功后的回调地址notify说明:
+   服务商推送采用HTTPS协议的POST方法,数据格式为JSON, 编码为UTF8
+   入参说明:
+   certName --- "用户姓名"
+   certNo ---- "身份证号"
+   certType --- "IDENTITY_CAR"
+   Phone --- "手机号"
+   taskId --- "xxxxxxxxx"
+   Token --- "xxxxxxxxxx"
+   userId --- "支付宝用户的userId"
+   
+   入参示例:
+   {
+     certName: "张三"
+     certNo: "330821xxxxxxxx0212"
+     certType: "IDENTITY_CAR"
+     phone: "130xxxxxxxx"
+     taskId: "xxxxxxxxx"
+     token: "xxxxxxxxxx"
+     userId: "1234567890"
+   }
+   
+   
+   
+   
+   
+   响应说明:
+   只有收到code为200时,代表接入方已成功接收该条数据,服务商小程序才会自动返回接入方小程序.
+   
+   响应示例:
+   {
+       "code": 200,
+       "msg": "成功",
+       "data": null
+   }
+ 
+三.支付宝小程序开发建议
+
+ 授权成功后,返回商户小程序的后续操作说明:
+   有2种方式接收从授权小程序返回来的参数:
+   在app.js中的onShow方法中从通过 options.referrerInfo.extraData 获取;
+   在跳转页面中监听App.onShow,并及时取消监听。
+ 其中options.referrerInfo.extraData包含authStatus为true/false的值,该字段标识是否获取三要素成功,开发者可根据该字段判断是否需要查询该次授权的三要素信息。
+ 
+ 示例代码:
+ my.onAppShow(this.onAppShowHandler)
+ my.offAppShow(this.onAppShowHandler)
+ 
+ onAppShowHandler(options) {
+  if(options && options.referrerInfo) {
+ // 从三要素认证返回
+  if(options.referrerInfo.appId === `2021003181682188' && options.referrerInfo.extraData) {
+         const authStatus = options.referrerInfo.extraData.authStatus
+         if(authStatus) {
+           const authTaskId = my.getStorageSync({ key: 'auth-taskId' })
+           my.removeStorage({ key: 'auth-taskId' })
+           if(authTaskId && authTaskId.data) {
+             // 自行操作代码
+   // 说明:该监听的方法返回的this为undefined
+           }
+         }
+       }
+     }
+   }
+

+ 362 - 0
src/main/webapp/static/用户风险查询接口.pdf

@@ -0,0 +1,362 @@
+⾃然⼈⻛险评分查询接⼝
+
+接⼝地址: https://tx.hz-hanghui.com:8088/hanghui-server-platform/api/v1/fx/query
+请求⽅式: POST
+请求数据类型: application/json
+响应数据类型: */*
+接⼝描述: 请求和响应报⽂参数均需要使⽤国密4进⾏加解密,涉及的appId、appKey、appSecret、privateKey管理员提
+供
+请求示例:
+
+1 //国密m4加密后密⽂ 也就是三⽅接⼝接收到的数据
+
+2{
+
+3      "appId": "",
+
+4      "bizContent":
+
+    "NI4ry+D01kDXrNf5OcmAzMGaB0td9kXfa321xmIS3qw5homFdZT4xaJu8Vqid37NDivdqj1ADzd0+v+QDKNovFSBkm
+
+    OyOQt2ObJ4HW43i0dKKHAKlI3FtZA0F9URhlqXbckbpGMD1hev3XS/b9uxRw+QLOnTzhuzgoxpiOXNA9rmQs3V7prpF
+
+    9Wpaetts2pv",
+
+5      "reqTimestamp": 1692693665800,
+
+6      "sign": "签名⽅式⻅⽂末加密算法"
+
+7}
+
+8
+9 //国密m4加密前 也就是三⽅服务解密后的数据
+
+10 {
+
+11     "appId": "",
+
+12     "bizContent": {
+
+13         "sn": "",
+
+14         "name": "",
+
+15         "idNumber": "",
+
+16         "phone": ""
+
+17     },
+
+18     "reqTimestamp": 1692693665800,
+
+19     "sign": "签名⽅式⻅⽂末加密算法"
+
+20 }
+
+请求参数:
+   参数名称          参数说明                                     请求类型      是否必须     数据类型    schema
+   bizContent    加密内容                                     body      true
+     sn          设备号                                                true     string
+     name        姓名                                       body      true     string
+     idNumber    身份证号                                     body      true     string
+     phone       ⼿机号                                      body      true     string
+   appId         商户唯⼀标识                                             true     string
+   reqTimestamp  时间戳 毫秒                                             true     long
+   sign          签名md5(appKey+appSecret+timestamp) ⼩写32位            true     string
+
+响应状态:
+
+状态码                                                       说明        schema
+200                                                       OK
+除200以外都是异常码
+
+响应参数:                      参数说明                                     类型               schema
+                                                                    integer(int32)   integer(int32)
+   参数名称                    状态码
+   code                                                             string
+   data                    对象                                       boolean
+     bizContent
+       result              加密后的数据                                   integer(int32)   integer(int32)
+       resultInfo
+         personFxpfjxCode  true/false 是否命中⻛险                        string
+
+         personFxpfjx      结果信息                                     long
+                                                                    string
+     reqTimestamp          ⻛险状态 200 除200以外都是异常                      string
+     sign
+   msg                     ⻛险值:"001010"
+                           命中结果由 6 位0|1 字符串组成
+响应示例:                      分别为
+                           第 1 位-其他、
+                           第 2 位-前科、
+                           第 3 位-涉毒、
+                           第 4 位-吸毒、
+                           第 5 位-在逃、
+                           第 6 位-涉案(包括在逃撤销)。
+                           值为 1 表示命中,0 表示未 命中
+
+                           时间戳毫秒 1666881956513
+
+                           签名md5(appKey+appSecret+timestamp) ⼩写32位
+
+                           返回消息
+
+1 //国密m4加密后密⽂
+
+2{
+
+3   "code": 200,
+
+4   "data": {
+5         "bizContent":
+
+    "NI4ry+D01kDXrNf5OcmAzMGaB0td9kXfa321xmIS3qw5homFdZT4xaJu8Vqid37NDivdqj1ADzd0+v+QDKNovFSBkm
+
+    OyOQt2ObJ4HW43i0dKKHAKlI3FtZA0F9URhlqXbckbpGMD1hev3XS/b9uxRw+QLOnTzhuzgoxpiOXNA9rmQs3V7prpF
+
+    9Wpaetts2pv",
+
+6         "reqTimestamp": 1692693665800,
+
+7         "sign": "签名⽅式⻅⽂末加密算法"
+
+8     },
+
+9     "msg": ""
+
+10 }
+
+11
+
+12 //国密m4加密前
+
+13 {
+
+14    "code": 200,
+
+15    "data": {
+
+16        "bizContent": {
+
+17            "result": false,
+
+18            "resultInfo": {
+
+19                 "personFxpfjxCode": 200,
+
+20                 "personFxpfjx": "001010" //命中结果由 6 位 0|1 的字符串组成,分别为 第 1 位-其
+
+    他、第 2 位-前科、第 3 位-涉毒、 第 4 位-吸毒、第 5 位-在逃、第 6 位-涉案(包括在逃撤销)。 值为 1
+
+    表示命中,0 表示未 命中。
+
+21            }
+
+22        },
+
+23        "reqTimestamp": 1692693665800,
+
+24        "sign": "签名⽅式⻅⽂末加密算法"
+
+25    },
+
+26    "msg": ""
+
+27 }
+
+国密4加解密算法及签名认证
+
+1 // pom.xml中引⼊
+
+2 <dependency>
+
+3     <groupId>cn.hutool</groupId>
+
+4     <artifactId>hutool-all</artifactId>
+
+5     <version>5.7.0</version>
+
+6 </dependency>
+
+7 <dependency>
+
+8     <groupId>org.bouncycastle</groupId>
+
+9     <artifactId>bcprov-jdk15to18</artifactId>
+
+10    <version>1.70</version>
+
+11 </dependency>
+
+1 import cn.hutool.core.util.StrUtil;
+2 import cn.hutool.crypto.SecureUtil;
+3 import cn.hutool.crypto.SmUtil;
+4 import cn.hutool.crypto.symmetric.SymmetricCrypto;
+
+5
+
+6 @Slf4j
+
+7 public class Sm4Util {
+
+8
+
+9   /**
+
+10  * 加密
+
+11  *
+
+12  * @param privateKey 管理员提供
+
+13  * @param str
+
+14  * @return
+
+15  */
+
+16  public static String encrypt(final String privateKey, final String str) {
+
+17     if (StrUtil.isBlank((CharSequence) str)) {
+
+18        return "";
+
+19     }
+
+20
+
+21        try {
+
+22           SymmetricCrypto sm4 = new SymmetricCrypto("SM4/ECB/PKCS5Padding",
+
+    privateKey.getBytes());
+
+23           return sm4.encryptHex(str, Charset.forName("UTF-8"));
+
+24        } catch (Exception e) {
+
+25           log.error("加密失败", e);
+
+26           return null;
+
+27        }
+
+28  }
+
+29
+
+30  /**
+
+31  * 解密
+
+32  *
+
+33  * @param privateKey 管理员提供
+
+34  * @param str
+
+35  * @return
+
+36  */
+
+37  public static String decrypt(final String privateKey, final String str) {
+
+38        if (StrUtil.isBlank((CharSequence) str)) {
+
+39           return null;
+
+40        }
+
+41        try {
+
+42           SymmetricCrypto sm4 = new SymmetricCrypto("SM4/ECB/PKCS5Padding",
+
+    privateKey.getBytes());
+
+43           return sm4.decryptStr(str, Charset.forName("UTF-8"));
+
+44        } catch (Exception e) {
+
+45           log.error("解密失败", e);
+
+46           return null;
+
+47        }
+
+48  }
+
+49
+
+50  /**
+51    * 验证签名
+
+52    *
+
+53    * @param appKey
+
+54    * @param appSecret
+
+55    * @param sign
+
+56    * @param timestamp
+
+57    * @return
+
+58    */
+
+59    public static Boolean checkSign(String appKey, String appSecret, String sign, String
+
+    timestamp) {
+
+60         String dbSign = SecureUtil.md5(new StringBuilder().append(appKey)
+
+61                .append(appSecret)
+
+62                .append(timestamp).toString()).toLowerCase();
+
+63         if (!dbSign.equals(sign)) {
+
+64            return Boolean.FALSE;
+
+65         }
+
+66         return Boolean.TRUE;
+
+67    }
+
+68
+
+69    /**
+
+70    * 获取签名
+
+71    *
+
+72    * @param appKey
+
+73    * @param appSecret
+
+74    * @param timestamp
+
+75    * @return
+
+76    */
+
+77    public static String getSign(String appKey, String appSecret, String timestamp) {
+
+78         String sign = SecureUtil.md5(new StringBuilder().append(appKey)
+
+79                .append(appSecret)
+
+80                .append(timestamp).toString()).toLowerCase();
+
+81         return sign;
+
+82    }
+
+83
+
+84 }
+
+85
+

BIN
src/main/webapp/static/设备配置列表.xlsx