Skip to content

Commit

Permalink
变更生成 UserSig
Browse files Browse the repository at this point in the history
  • Loading branch information
hedeqiang committed Apr 2, 2021
1 parent f80c24b commit 00dd138
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/IM.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,15 @@ protected function buildEndpoint(string $servername, string $command): string
/**
* Generate Sign.
*
* @param string $identifier
* @param int $expires
* @return string
* @throws \Exception
*/
protected function generateSign(string $identifier, int $expires = 15552000): string

This comment has been minimized.

Copy link
@supgeek-rod

supgeek-rod Apr 8, 2021

Contributor

这个方法可以 public 吧?提供全套一站式 API,不然还得单独调 TLSSigAPIv2 来生成 UserSig

This comment has been minimized.

Copy link
@hedeqiang

hedeqiang via email Apr 8, 2021

Author Owner

This comment has been minimized.

Copy link
@supgeek-rod

supgeek-rod Apr 8, 2021

Contributor

如果是 SPA 或者小程序 APP 等,需要后端生成 UserSig 并传递给前端,这个场景还是挺常见的。
如果此项目不提供这个方法,那么就得调 TLSSigAPIv2 包的方法了

This comment has been minimized.

Copy link
@hedeqiang

hedeqiang via email Apr 8, 2021

Author Owner
{
$api = new TLSSigAPIv2($this->config->get('sdk_app_id'), $this->config->get('secret_key'));

return $api->genSig($identifier, $expires);
return $api->genUserSig($identifier, $expires);
}
}

0 comments on commit 00dd138

Please sign in to comment.