update
This commit is contained in:
35
admin/application/api/logic/TokenLogic.php
Normal file
35
admin/application/api/logic/TokenLogic.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* description:
|
||||
* author:wh
|
||||
* email:
|
||||
* createTime:{2025/3/22} {14:04}
|
||||
*/
|
||||
namespace app\api\logic;
|
||||
|
||||
class TokenLogic extends BaseLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* desc:
|
||||
*
|
||||
* array(3) {
|
||||
["code"] => int(200)
|
||||
["msg"] => string(7) "cURL ok"
|
||||
["data"] => string(84) "{"gewe-token":"8bd053cb84f24770ae4df11441500427","appId":"wx_N3vKyMW8nl41epbcu891k"}"
|
||||
}
|
||||
* author:wh
|
||||
* @return string
|
||||
* @throws \Exception
|
||||
*/
|
||||
static function getToken()
|
||||
{
|
||||
$url = 'https://wechat-api-test.excn.vip/vip_groups/auth_info';
|
||||
$res = \wanghua\general_utility_tools_php\http\Curl::curl_post($url, []);
|
||||
$res_data = json_decode($res['data'], true);
|
||||
return [
|
||||
'token' => $res_data['gewe-token'],
|
||||
'appId' => $res_data['appId'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user