认证服务相关的实用函数,封装了与认证 API 的交互。
- Source:
Methods
(inner) getCode(data) → {Promise.<void>}
调用后端 API 发送短信验证码。
在测试阶段,短信验证码会在后端服务的终端中模拟显示。
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
data |
object | 发送短信验证码所需的数据。
Properties
|
- Source:
Throws:
-
如果发送短信验证码的 API 请求失败,会打印错误信息到控制台。
- Type
- Error
Returns:
一个 Promise,表示短信发送操作的完成。
- Type
- Promise.<void>