测试环境域名:
https://identitytest.fangxinqian.cn
key:GoexwR3Toe
secret:72e9ff5d6a49491690a4cd22eb9402b1
config配置
// 放心签配置
'FXQ_APPID' => 'GoexwR3Toe',
'FXQ_SECRET' => '72e9ff5d6a49491690a4cd22eb9402b1',
'FXQ_IDENTITYURL' => 'https://identitytest.fangxinqian.cn',
'FXQ_RESTAPI' => 'https://restapitest.fangxinqian.cn',
'FXQ_CONTRACT' => 'https://*****.pdf',
Fangxinqian.php
<?php
namespace app\common\service;
use think\Db;
use think\Config;
use think\Cache;
class Fangxinqian
{
private static $instance = null ;
public static function ins()
{
if( self::$instance == null ){
self::$instance = new self();
}
return self::$instance;
}
//签章生成
public function seal_personal($realname)
{
$token = $this->getToken();
$data = [
"name" => $realname, //真实姓名
"rtype" => 1, //返回类型(0:Base64,1:oss地址链接,默认为0)
'color' => 0, //颜色(0:红色,1:蓝色,2:黑色,默认为0)
'font' => 1, //字体(0:仿宋,1:楷体,2:黑体,默认为0)
'type' => 0, //形状(0:长方形,1:正方形,默认为0)
];
$signString = "";
$data = $this->sortParam($data);
$this->readParams($data,$signString);
$nonce = date('YmdHis').rand(111,99999);
$sign = md5(sha1(base64_encode($signString."||token=".$token."||nonce=".$nonce)));
$result = $this->serverSubmit(config('FXQ_RESTAPI').'/