You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
808 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
namespace kdniao;
class Base
{
protected $config;
// protected $url = 'http://sandboxapi.kdniao.com:8080/kdniaosandbox/gateway/exterfaceInvoke.json'; //测试地址
// 正式地址
protected $url = 'https://api.kdniao.com/';
/**
* 构造函数
* @date 2021-01-25
*/
public function __construct(array $data = [])
{
$this->config = $data;
}
/**
* 电商Sign签名生成
* @param json $data 内容
* @param string $appkey Appkey
* @date 2021-01-25
*/
public function encrypt($data, $appkey)
{
// 把(请求内容(未编码)+AppKey)进行MD5加密然后Base64编码最后 进行URL(utf-8)编码。详细过程请查看Demo
return urlencode(base64_encode(md5($data . $appkey)));
}
}