Skip to content

Commit a5ad2d6

Browse files
committed
md
1 parent 028ec92 commit a5ad2d6

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## 声网token生成和接口管理
2+
3+
### 配置文件
4+
5+
```php
6+
7+
new \Wu\Agora\Config($_ENV['APP_ID'], $_ENV['APP_CERTIFICATE'], $_ENV['CUSTOMER_KEY'], $_ENV['CUSTOMER_SECRET']);
8+
9+
```
10+
11+
### 生成token
12+
13+
```php
14+
$channelName = "hdkhfdkasjhfakhf";
15+
$uidOrAccount = "1234567";
16+
$role = AccessToken::RoleAttendee;
17+
$time = \Wu\Agora\Tool::time()->timestamp + 100;
18+
$tokenModel = new \Wu\Agora\Token\TokenBuilder($this->getConfig());
19+
$res = $tokenModel->buildToken($channelName, $uidOrAccount, $role, $time);
20+
```
21+
22+
### 接口管理
23+
24+
```php
25+
$model = new Project($this->getConfig());
26+
```

0 commit comments

Comments
 (0)