|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the overtrue/wechat. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) overtrue <[email protected]> |
|
7
|
|
|
* |
|
8
|
|
|
* This source file is subject to the MIT license that is bundled |
|
9
|
|
|
* with this source code in the file LICENSE. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace EasyWeChat\OpenPlatform\Authorizer\MiniProgram\Account; |
|
13
|
|
|
|
|
14
|
|
|
use EasyWeChat\OpenPlatform\Authorizer\Aggregate\Account\Client as BaseClient; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Class Client. |
|
18
|
|
|
* |
|
19
|
|
|
* @author ClouderSky <[email protected]> |
|
20
|
|
|
*/ |
|
21
|
|
|
class Client extends BaseClient |
|
22
|
|
|
{ |
|
23
|
|
|
/** |
|
24
|
|
|
* 获取账号基本信息. |
|
25
|
|
|
*/ |
|
26
|
|
|
public function getBasicInfo() |
|
27
|
|
|
{ |
|
28
|
|
|
return $this->httpPostJson('cgi-bin/account/getaccountbasicinfo'); |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* 修改头像. |
|
33
|
|
|
* |
|
34
|
|
|
* @param string $mediaId 头像素材mediaId |
|
35
|
|
|
* @param int $left 剪裁框左上角x坐标(取值范围:[0, 1]) |
|
36
|
|
|
* @param int $top 剪裁框左上角y坐标(取值范围:[0, 1]) |
|
37
|
|
|
* @param int $right 剪裁框右下角x坐标(取值范围:[0, 1]) |
|
38
|
|
|
* @param int $bottom 剪裁框右下角y坐标(取值范围:[0, 1]) |
|
39
|
|
|
*/ |
|
40
|
|
|
public function updateAvatar( |
|
41
|
|
|
string $mediaId, |
|
42
|
|
|
float $left = 0, |
|
43
|
|
|
float $top = 0, |
|
44
|
|
|
float $right = 1, |
|
45
|
|
|
float $bottom = 1 |
|
46
|
|
|
) { |
|
47
|
|
|
$params = [ |
|
48
|
|
|
'head_img_media_id' => $mediaId, |
|
49
|
|
|
'x1' => $left, 'y1' => $top, 'x2' => $right, 'y2' => $bottom, |
|
50
|
|
|
]; |
|
51
|
|
|
|
|
52
|
|
|
return $this->httpPostJson('cgi-bin/account/modifyheadimage', $params); |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* 修改功能介绍. |
|
57
|
|
|
* |
|
58
|
|
|
* @param string $signature 功能介绍(简介) |
|
59
|
|
|
*/ |
|
60
|
|
|
public function updateSignature(string $signature) |
|
61
|
|
|
{ |
|
62
|
|
|
$params = ['signature' => $signature]; |
|
63
|
|
|
|
|
64
|
|
|
return $this->httpPostJson('cgi-bin/account/modifysignature', $params); |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|