|
|
@@ -22,13 +22,24 @@ class WithdrawService
|
|
|
static $aeskey = '37d65ced5ed5892e';
|
|
|
|
|
|
|
|
|
+ public function __construct($token)
|
|
|
+ {
|
|
|
+ self::$token = $token;
|
|
|
+ }
|
|
|
+
|
|
|
public static function init()
|
|
|
{
|
|
|
- self::$token = CacheService::get('withdraw_token', '');
|
|
|
+ $token = CacheService::get('withdraw_token', '');
|
|
|
if (!self::$token) {
|
|
|
- self::$token = self::login();
|
|
|
- CacheService::set('withdraw_token', self::$token, 500);
|
|
|
+ $token = self::login();
|
|
|
+ CacheService::set('withdraw_token', $token, 500);
|
|
|
}
|
|
|
+ return new self($token);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static function getToken()
|
|
|
+ {
|
|
|
+ return self::$token;
|
|
|
}
|
|
|
|
|
|
|