Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit39a0e78

Browse files
author
lishipeng
committed
fix钉钉json的问题
1 parentc678daa commit39a0e78

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

‎helpers/Prpcrypt.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public function decrypt($encrypted, $corpid, &$text = "")
4646
//去除补位字符
4747
$pkc_encoder =newPKCS7Encoder;
4848
$result =$pkc_encoder->decode($decrypted);
49-
Yii::error($result,"result");
5049
//去除16位随机字符串,网络字节序和AppId
5150
if (strlen($result) <16){
5251
return"pkds解码错误";
@@ -56,7 +55,6 @@ public function decrypt($encrypted, $corpid, &$text = "")
5655
$xml_len =$len_list[1];
5756
$xml_content =substr($content,4,$xml_len);
5857
$from_corpid =substr($content,$xml_len +4);
59-
Yii::error($from_corpid."\t".$corpid."\t".$xml_content."\n".$content,"corp");
6058
}catch (\Exception$e) {
6159
return$e->getMessage();
6260
}

‎helpers/StringHelper.php‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
namespacelspbupt\dingtalk\helpers;
3+
class StringHelper
4+
{
5+
publicstaticfunctionparseJsonData($str)
6+
{
7+
$str =trim($str);
8+
$str =trim($str,"{");
9+
$str =trim($str,"}");
10+
$arr =explode(",",$str);
11+
$dataArr = [];
12+
foreach($arras$val) {
13+
$tempArr =explode(":",$val);
14+
if(count($tempArr) ==2) {
15+
$dataArr[$tempArr[0]] =$tempArr[1];
16+
}
17+
}
18+
return$dataArr;
19+
}
20+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp