示例#1
0
文件: views.py 项目: sbyinin/Alinone
def register_verify(request):
    if request.method == 'POST':
        context = {}
        context.update(csrf(request))
        phone = request.POST.get('phone')
        merchant_have = Merchant.objects.filter(alin_account=phone)
        if merchant_have.count() > 0:
            return HttpResponse(json.dumps("false"), content_type="application/json")
        req = createverifycode(phone)
        print req
        return HttpResponse(json.dumps("true"), content_type="application/json")
    raise Http404
示例#2
0
文件: views.py 项目: sbyinin/Alinone
def forget_password_verify(request):
    if request.method == 'POST':
        context = {}
        context.update(csrf(request))
        phone = request.POST.get('phone')
        merchant_have = Merchant.objects.filter(alin_account=phone)
        if merchant_have.count() > 0 :
            merchant = merchant_have[0]
            if merchant.verify is False:
                return HttpResponse(json.dumps("auth"), content_type='application/json')
            req = createverifycode(phone)
            print req
            newlog = AccountLog()
            newlog.atype = '商家'
            newlog.content = '商家忘记密码'
            newlog.ltype = 13
            newlog.note = '忘密'
            newlog.account = str(phone)
            newlog.save()
            return HttpResponse(json.dumps("OK"), content_type="application/json")
        else:
            return HttpResponse(json.dumps("False"), content_type="application/json")
    return HttpResponse(json.dumps("False"), content_type="application/json")