优化一下redirecturl= 的情况,默认值不解决问题,必须判断

This commit is contained in:
HuYang 2020-12-24 16:26:58 +08:00
parent 1e458431ad
commit b50dd0a1ea

View File

@ -30,6 +30,9 @@ def oauth0(request):
randstr = request.GET.get("randstr","")
hashstr = request.GET.get("hashstr","")
redirecturl = request.GET.get("redirecturl","/")
if redirecturl == "" :
# 必须用判断的方式否则url里提交redirecturl= 还是为空
redirecturl = "/"
if ("" in [username,timestamp,randstr,hashstr]) == False :
# 都不为空,才验证哦
# 1 、验证timestamp的时效性