bind wechat only one time

This commit is contained in:
caoqianming 2020-05-22 11:32:38 +08:00
parent a8d3598288
commit 7aea984e34
3 changed files with 12 additions and 0 deletions

View File

@ -133,6 +133,11 @@ export default {
if (valid) {
this.submitLoding = true
this.Form.questioncat = this.Form.questioncat.pop()
for(let key in this.Form.options){
if(!this.Form.options[key]){
delete this.Form.options[key]
}
}
createQuestion(this.Form).then(response => {
this.submitLoding = false
if(response.code >= 200){

View File

@ -137,6 +137,11 @@ export default {
if(this.Form.questioncat instanceof Array){
this.Form.questioncat = this.Form.questioncat.pop()
}
for(let key in this.Form.options){
if(!this.Form.options[key]){
delete this.Form.options[key]
}
}
updateQuestion(this.Form.id, this.Form).then(response => {
this.submitLoding = false
if(response.code >= 200){

View File

@ -286,6 +286,8 @@ class ConsumerRegister(APIView):
consumer_queryset = Consumer.objects.filter(username=phone)
if consumer_queryset.exists(): # 是否存在
consumer = consumer_queryset.first()
if consumer.openid:
return Response({'error':'该号码已使用!'})
openid = request.user.openid
request.user.delete(soft=False) # 彻底删除
consumer.openid = openid