t
This commit is contained in:
+194
-67
@@ -76,11 +76,11 @@ class Welcome extends CI_Controller {
|
||||
$this->load->model('hdcloud/neta_model');
|
||||
|
||||
|
||||
$dealerCode = array('100619');
|
||||
$dealerCode = array('100222');
|
||||
|
||||
foreach ($dealerCode as $d)
|
||||
{
|
||||
$mobiles = $this->neta_model->select(array('status' => 0), '', 1, 6);
|
||||
$mobiles = $this->neta_model->select(array('status' => 0), '', 1, 29);
|
||||
|
||||
foreach ($mobiles as $k => $v) {
|
||||
$city_id = '350200';
|
||||
@@ -88,7 +88,7 @@ class Welcome extends CI_Controller {
|
||||
|
||||
$data[] = array(
|
||||
'voId' => $voId,
|
||||
'cusSource3' => '023409',//'023409'区域云店,//023410:云店营销节点 //020103太平洋
|
||||
'cusSource3' => '020211',//'023409'区域云店,//023410:云店营销节点 //020103太平洋
|
||||
'customerName' => '客户',
|
||||
'dealerCode' => $d,
|
||||
'fromSystem' => "好店云",
|
||||
@@ -129,89 +129,216 @@ class Welcome extends CI_Controller {
|
||||
}
|
||||
|
||||
|
||||
public static function encrypt($data, $key) {
|
||||
$key = base64_decode($key);
|
||||
if (strlen($key) < 16) {
|
||||
$key = str_pad($key, 16, "\0");
|
||||
} elseif (strlen($key) > 16) {
|
||||
$key = substr($key, 0, 16);
|
||||
}
|
||||
$iv = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; // ECB模式不需要IV,但PHP的openssl_encrypt函数需要
|
||||
return openssl_encrypt($data, 'AES-128-ECB', $key, OPENSSL_RAW_DATA, $iv);
|
||||
public function upload(){
|
||||
// 应用信息
|
||||
$appid = '17dcc133'; // 应用 ID
|
||||
$secretKey = '9d8b02ec2b9ea8dfdc51a1aed2e10986'; // 应用密钥
|
||||
$uploadUrl = 'https://raasr.xfyun.cn/v2/api/upload'; // 文件上传接口地址
|
||||
|
||||
// 音频文件的 URL
|
||||
$audioUrl = 'https://media.liche.cn/liche/yx/aef4c825a1ccb330/0a10dcea56ba1a2a.wav'; // 音频文件 URL
|
||||
|
||||
// 当前时间戳
|
||||
$ts = time();
|
||||
|
||||
// 生成签名
|
||||
$baseString = $appid . $ts;
|
||||
$signa = base64_encode(hash_hmac('sha1', md5($baseString), $secretKey, true));
|
||||
|
||||
// 初始化 cURL
|
||||
$ch = curl_init();
|
||||
|
||||
// 音频文件的元信息
|
||||
$audioInfo = [
|
||||
'appId' => $appid,
|
||||
'signa' => $signa,
|
||||
'ts' => $ts,
|
||||
'fileName' => basename($audioUrl), // 文件名
|
||||
'fileSize' => 1, // URL 模式下,文件大小可以传 0
|
||||
'duration' => 1, // URL 模式下,音频时长可以传 0
|
||||
'audioMode' => 'urlLink', // 使用 URL 外链模式
|
||||
'audioUrl' => urlencode($audioUrl), // 音频文件的 URL
|
||||
];
|
||||
|
||||
$queryString = http_build_query($audioInfo); // 将数组转换为查询字符串
|
||||
$uploadUrl .= '?' . $queryString;
|
||||
|
||||
// 设置请求头
|
||||
$headers = [
|
||||
'Content-Type: application/json;charset=UTF-8', // URL 模式下,请求体为 JSON 格式
|
||||
'Chunked: false'
|
||||
];
|
||||
|
||||
curl_setopt($ch, CURLOPT_URL, $uploadUrl);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_HEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, '{}');
|
||||
|
||||
// 执行请求
|
||||
$response = curl_exec($ch);
|
||||
|
||||
// 关闭 cURL
|
||||
curl_close($ch);
|
||||
|
||||
// 输出响应结果
|
||||
echo $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将加密后的二进制数据转换成十六进制字符串
|
||||
* @param string $binaryData 加密后的二进制数据
|
||||
* @return string 十六进制字符串
|
||||
*/
|
||||
public static function parseBinary2HexStr($binaryData) {
|
||||
return bin2hex($binaryData);
|
||||
}
|
||||
public function getResult(){
|
||||
// 应用信息
|
||||
$appid = '17dcc133'; // 应用 ID
|
||||
$secretKey = '9d8b02ec2b9ea8dfdc51a1aed2e10986'; // 应用密钥
|
||||
$getUrl = 'https://raasr.xfyun.cn/v2/api/getResult'; // 接口地址
|
||||
|
||||
/**
|
||||
* 加密数据并返回十六进制字符串
|
||||
* @param mixed $obj 待加密的数据
|
||||
* @param string $key 密钥
|
||||
* @return string 加密后的十六进制字符串
|
||||
*/
|
||||
public static function encryptData($obj, $key) {
|
||||
$content = is_string($obj) ? $obj : serialize($obj);
|
||||
$encrypted = self::encrypt($content, $key);
|
||||
return self::parseBinary2HexStr($encrypted);
|
||||
}
|
||||
// 当前时间戳
|
||||
$ts = time();
|
||||
|
||||
public function t1()
|
||||
{
|
||||
$key = "B066+uPhhihfn0CLrU5Cpw==";
|
||||
$data = "0534_1729650980126_1729650980126";
|
||||
$encryptedData = $this->encryptData($data, $key);
|
||||
echo "加密内容:" . strtoupper($encryptedData) . "\n";
|
||||
}
|
||||
// 生成签名
|
||||
$baseString = $appid . $ts;
|
||||
$signa = base64_encode(hash_hmac('sha1', md5($baseString), $secretKey, true));
|
||||
|
||||
public function t2()
|
||||
{
|
||||
$key = "MMrPzdpMKIVcQBOiQN/uoQ==";
|
||||
$mobile = "13012341234";
|
||||
$encryptedData = $this->encryptData($mobile, $key);
|
||||
echo "手机号加密内容:" . strtoupper($encryptedData) . "\n";
|
||||
// 初始化 cURL
|
||||
$ch = curl_init();
|
||||
|
||||
// 音频文件的元信息
|
||||
|
||||
$audioInfo = [
|
||||
'appId' => $appid,
|
||||
'signa' => $signa,
|
||||
'ts' => $ts,
|
||||
'orderId' => 'DKHJQ20250220174031610SI0cnrYneSIz8bZm'
|
||||
];
|
||||
|
||||
$queryString = http_build_query($audioInfo); // 将数组转换为查询字符串
|
||||
$getUrl .= '?' . $queryString;
|
||||
|
||||
// 设置请求头
|
||||
$headers = [
|
||||
'Content-Type: multipart/form-data;', // URL 模式下,请求体为 JSON 格式
|
||||
];
|
||||
|
||||
// 设置 cURL 选项
|
||||
|
||||
curl_setopt($ch, CURLOPT_URL, $getUrl);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_HEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, '{}');
|
||||
|
||||
// 执行请求
|
||||
$response = curl_exec($ch);
|
||||
|
||||
// 关闭 cURL
|
||||
curl_close($ch);
|
||||
|
||||
// 输出响应结果
|
||||
echo $response;
|
||||
}
|
||||
|
||||
|
||||
public function t3()
|
||||
{
|
||||
$appKey = 'autolocal';
|
||||
$signStr = $appKey;
|
||||
public function hs(){
|
||||
$appId = "3231454391"; // 替换为你的 App ID
|
||||
$token = "h2MUNInVzaduLZeSy7AGclRNOft1k25o"; // 替换为你的 Token
|
||||
$uuid = sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
|
||||
mt_rand(0, 0xffff), mt_rand(0, 0xffff),
|
||||
mt_rand(0, 0xffff),
|
||||
mt_rand(0, 0x0fff) | 0x4000,
|
||||
mt_rand(0, 0x3fff) | 0x8000,
|
||||
mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff));
|
||||
|
||||
$paramList = array(
|
||||
'skey' => 'dG9waWNfaWQ9Ng',
|
||||
'shopid' => '2',
|
||||
'token' => '3882',
|
||||
'cfrom' => 'car',
|
||||
'ufrom' => '98651',
|
||||
'backup' => '',
|
||||
'timestamp' => '1731326192',
|
||||
'nonce' => 'hdad9j12sdad9',
|
||||
'cityid' => '350200',
|
||||
);
|
||||
|
||||
ksort($paramList);
|
||||
// 遍历参数列表并拼接参数
|
||||
foreach ($paramList as $key => $value) {
|
||||
$signStr .= $key . $value;
|
||||
// 初始化 cURL
|
||||
$ch = curl_init();
|
||||
|
||||
// 提交识别请求的 URL 和查询结果的 URL
|
||||
$submitUrl = "https://openspeech.bytedance.com/api/v3/auc/bigmodel/submit";
|
||||
$audioUrl = "https://media.liche.cn/liche/yx/aef4c825a1ccb330/0a10dcea56ba1a2a.wav"; // 替换为你的音频文件 URL
|
||||
|
||||
// 构造请求体
|
||||
$jsonBody = json_encode([
|
||||
"audio" => [
|
||||
"url" => $audioUrl,
|
||||
"format" => "wav",
|
||||
],
|
||||
"request" => ["model_name" => "bigmodel"]
|
||||
]);
|
||||
|
||||
// 提交识别请求
|
||||
$headers = [
|
||||
"X-Api-App-Key: $appId",
|
||||
"X-Api-Access-Key: $token",
|
||||
"X-Api-Resource-Id: volc.bigasr.auc",
|
||||
"X-Api-Request-Id: $uuid",
|
||||
"X-Api-Sequence: -1"
|
||||
];
|
||||
|
||||
curl_setopt($ch, CURLOPT_URL, $submitUrl);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonBody);
|
||||
curl_setopt($ch, CURLOPT_HEADER, true);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
$submitResponse = curl_exec($ch);
|
||||
|
||||
// 分割响应头和正文
|
||||
$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
|
||||
$header = substr($submitResponse, 0, $headerSize);
|
||||
$body = substr($submitResponse, $headerSize);
|
||||
|
||||
echo $uuid."\n";
|
||||
var_dump($submitResponse);exit;
|
||||
$submitHttpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
|
||||
if ($submitHttpCode != 200) {
|
||||
print_r(["error" => "Submit request failed with HTTP code $submitHttpCode", "response" => $submitResponse]) ;
|
||||
}
|
||||
|
||||
// 再次追加appKey
|
||||
$signStr .= $appKey;
|
||||
$submitResult = json_decode($submitResponse, true);
|
||||
if ($submitResult["status_code"] != 20000000) {
|
||||
print_r(["error" => "Submit request failed: " . $submitResult["message"], "response" => $submitResponse]) ;
|
||||
}
|
||||
|
||||
// 返回MD5签名
|
||||
echo strtoupper(md5($signStr));
|
||||
$logId = $submitResult["log_id"];
|
||||
echo "Log ID: $logId\n";
|
||||
}
|
||||
|
||||
public function getHs(){
|
||||
$appId = "3231454391"; // 替换为你的 App ID
|
||||
$token = "h2MUNInVzaduLZeSy7AGclRNOft1k25o"; // 替换为你的 Token
|
||||
$rid = 'f14510ff-973a-4771-9491-718a0133dcc1';
|
||||
|
||||
// 初始化 cURL
|
||||
$ch = curl_init();
|
||||
|
||||
// 提交识别请求的 URL 和查询结果的 URL
|
||||
$queryUrl = "https://openspeech.bytedance.com/api/v3/auc/bigmodel/query";
|
||||
|
||||
// 提交识别请求
|
||||
$headers = [
|
||||
"X-Api-App-Key: $appId",
|
||||
"X-Api-Access-Key: $token",
|
||||
"X-Api-Resource-Id: volc.bigasr.auc",
|
||||
"X-Api-Request-Id: $rid",
|
||||
];
|
||||
|
||||
curl_setopt($ch, CURLOPT_URL, $queryUrl);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, '{}');
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_HEADER, true);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
$submitResponse = curl_exec($ch);
|
||||
|
||||
// 分割响应头和正文
|
||||
$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
|
||||
$header = substr($submitResponse, 0, $headerSize);
|
||||
$body = substr($submitResponse, $headerSize);
|
||||
|
||||
var_dump($submitResponse);exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<div class="swiper-button-prev"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
|
||||
<div class="bts-1-eee inner30">
|
||||
<div class="text-center">分享文案</div>
|
||||
<div class="mt30 relative bds-1-eee inner30 pr200 ulib-r20 font-28" v-for="(item,index) in shareTx">
|
||||
@@ -31,7 +31,7 @@
|
||||
<a class="absolute right-0 box-middle mr30 inline-block pl30 pr30 line-height-17 bg-eee ulib-r750 J_copy" :data-clipboard-text="item">复制</a>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div @click="showPoster">
|
||||
<div style="height:70px;"></div>
|
||||
<div class="fixed left-0 bottom-0 right-0 bg-000-op80 pt20 pb20 pl30 pr30 text-center z-index-4">
|
||||
|
||||
Reference in New Issue
Block a user