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='发送失败,请稍后再试')

22 发送短信接口

22 发送短信接口

 

上一篇:2021-11-02 - 断网了,还能ping通 127.0.0.1 吗?


下一篇:【无标题】39. 组合总和