36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
|
namespace app\kernel\Lebolebo;
|
|
|
|
use GuzzleHttp\Client;
|
|
|
|
class Account
|
|
{
|
|
protected $client;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->client = new Client([
|
|
'timeout' => 10,
|
|
]);
|
|
}
|
|
|
|
public function login(string $username,string $password)
|
|
{
|
|
$url = 'https://api-manage2.shengtongedu.cn/st-permission-server/saas/account/login';
|
|
$options = [
|
|
'body'=>json_encode([
|
|
'campusIdList'=>['1863'],
|
|
'loginCode'=>$username,
|
|
'loginPassword'=>md5($password),
|
|
'platform'=>'OMO_WEB',
|
|
]),
|
|
'headers'=>[
|
|
'user-agent'=>'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36 Core/1.94.196.400 QQBrowser/11.7.5286.400',
|
|
'platform'=>'OMO_WEB',
|
|
'content-type'=>'application/json; charset=utf-8',
|
|
]
|
|
];
|
|
$result = $this->client->post($url,$options);
|
|
return json_decode($result->getBody()->getContents(),true);
|
|
}
|
|
} |