# 自带方法和变量

| 名称         | 类型     | 允许为空 | 说明                                 |
|:-----------|:-------|:-----|:-----------------------------------|
| appId      | String | Y    | APPID                              |
| appSecret  | String | Y    | APP SECRET                         |
| region     | String | Y    | 服务器区域，如：cn、us、eu、as、ir             |
| endpoint   | String | Y    | API域名，如：https://eu-apia.coolkit.cc |
| at         | String | Y    | Access Token                       |
| rt         | String | Y    | Refresh Token                      |
| account    | String | Y    | 默认账号                               |
| userApiKey | String | Y    | 用户 API Key                         |
| logObj     | Object | Y    | 日志库的实例                             |
| request    | Object | Y    | 请求库的实例                             |
| storage    | Object | Y    | 存储库的实例，初始目录：cache                  |

## storage

功能：存储

内置方法：

| 名称                                   | 类型       | 允许为空 | 说明   |
|:-------------------------------------|:---------|:-----|:-----|
| storage.set(key: string, value: any) | Function | Y    | 存储   |
| storage.get(key: string)             | Function | Y    | 获取数据 |
| storage.remove(key: string)          | Function | Y    | 删除数据 |

## setUrl(region)

功能：设置接口域名

传参：

| 名称     | 类型     | 允许为空 | 说明 |
|:-------|:-------|:-----|:---|
| region | String | N    | 区域 |

## setAuthConfigs(appId,appSecret)

功能：设置 APPID 和 APP SECRET

传参：

| 名称        | 类型     | 允许为空 | 说明         |
|:----------|:-------|:-----|:-----------|
| appId     | String | N    | APPID      |
| appSecret | String | N    | APP SECRET |
