@shencom/api
Version:
shencom api group
52 lines (46 loc) • 1.47 kB
text/typescript
import type { OneOf } from '@shencom/typing';
import { getInitializedApiConfig } from '../config';
import { unToken } from '../utils/utils';
interface SmsPhone {
phone: string;
}
interface SmsUsername {
username: string;
}
/**
* 租户端-发送短信
* @param {string} phone 手机号
* @return errcode=615002 - 需要图形验证码
* @return errcode=500010 - 您操作太频繁,请稍后再试
*/
export const ApiSmsTenants = (
body: OneOf<SmsPhone, SmsUsername>,
headers?: Record<string, any>,
) => {
const { http, url } = getInitializedApiConfig();
const api = `${url}/service-uaa/validate/msg`;
return http.get(api, body, unToken(headers));
};
/**
* 平台端-发送短信
* @param {string} phone 手机号
* @return errcode=615002 - 需要图形验证码
* @return errcode=500010 - 您操作太频繁,请稍后再试
*/
export const ApiSmsPlatform = (
body: OneOf<SmsPhone, SmsUsername>,
headers?: Record<string, any>,
) => {
const { http, url } = getInitializedApiConfig();
const api = `${url}/service-platform-uaa/validate/msg`;
return http.get(api, body, unToken(headers));
};
/**
* 移动端-发送短信;没有系统用户限制
* @param {string} phone 手机号
*/
export const ApiSmsUnbound = (body: SmsPhone, headers?: Record<string, any>) => {
const { http, url } = getInitializedApiConfig();
const api = `${url}/service-uaa/validate/unbound/msg`;
return http.get(api, body, unToken(headers));
};