其他分享
首页 > 其他分享> > 22 发送短信接口

22 发送短信接口

作者:互联网

user/views.py

class UserView(ViewSet):
    @action(methods=['GET'], detail=False, )
    def send_sms(self, request):
        phone = request.query_params.get('phone')
        sms_code = gen_code()
        # res = send_sms_v2(phone, sms_code)
        res = send_sms_v3(phone, sms_code)
        print(sms_code)
        if res:
            return APIResponse()
        else:
            return APIResponse(code=101, msg='发送失败,请稍后再试')

 

标签:code,短信,22,res,APIResponse,sms,接口,phone,send
来源: https://www.cnblogs.com/Haier123/p/15933218.html