Example #1
0
 def post(self):
     usertoken = request.form["usertoken_str"]
     uo = Userorml()
     temp = uo.tokendelete(usertoken)
     if temp:
         return jsonify(Info(True,"usertoken删除成功",None).tojson())
     else:
         return jsonify(Info(False,"数据库错误",None).tojson())
Example #2
0
 def get(self):
     usertokenstr = request.args.get("usertoken_str")
     fo = Forumorml()
     temp = fo.Forumshowme(usertokenstr)
     if temp == "False":
         return jsonify(Info(False, '数据库错误', None).tojson())
     else:
         return jsonify(Info(True, temp, None).tojson())
Example #3
0
 def post(self):
     usertoken = request.form["usertoken_str"]
     forumid = request.form["forum_id"]
     fo = Forumorml()
     temp = fo.delectforum(usertoken, forumid)
     if temp:
         return jsonify(Info(True, "帖子删除成功", None).tojson())
     else:
         return jsonify(Info(False, "数据库错误", None).tojson())
Example #4
0
 def get(self):
     usertokenstr = request.args.get("usertoken_str")
     userid = request.args.get("userid")
     co = Centerorml()
     temp = co.showotherinfo(usertokenstr, userid)
     if temp == "False":
         return jsonify(Info(False, '数据库错误', None).tojson())
     else:
         return jsonify(Info(True, temp, None).tojson())
Example #5
0
 def get(self):
     usertokenstr = request.args.get("usertoken_str")
     print("@@@@@@@@@@@@@@@@@2", usertokenstr)
     co = Centerorml()
     temp = co.ownfans(usertokenstr)
     if temp == "False":
         return jsonify(Info(False, '数据库错误', None).tojson())
     else:
         return jsonify(Info(True, temp, None).tojson())
Example #6
0
 def post(self):
     usertoken = request.form["usertoken_str"]
     userid = request.form["user_id"]
     co = Centerorml()
     temp = co.cancleattention(usertoken, userid)
     if temp:
         return jsonify(Info(True, "取消关注成功", None).tojson())
     else:
         return jsonify(Info(False, "数据库错误", None).tojson())
Example #7
0
 def post(self):
     username = request.form["user_id"]
     userpassword = request.form["user_password"]
     uo = Userorml()
     temp = uo.changepassword(username,userpassword)
     if temp:
         return jsonify(Info(True,"密码修改成功",None).tojson())
     else:
         return jsonify(Info(False,'数据库错误',None).tojson())
Example #8
0
 def post(self):
     usertokenstr = request.form["usertoken_str"]
     usernewpassword = request.form["user_newpassword"]
     uo = Userorml()
     temp = uo.modifypassword(usertokenstr,usernewpassword)
     if temp:
         return jsonify(Info(True,"密码修改成功",None).tojson())
     else: 
         return jsonify(Info(False,'数据库错误',None).tojson())
Example #9
0
 def get(self):
     usertoken = request.args.get("usertoken_str")
     forumid = request.args.get("forum_id")
     fo = Forumorml()
     temp = fo.forumallshow(usertoken, forumid)
     if temp == False:
         return jsonify(Info(False, "数据库错误", None).tojson())
     else:
         return jsonify(Info(True, "返回成功", temp, None).tojson())
Example #10
0
    def get(self):
        usertokenstr = request.args.get("usertoken_str")

        co = Centerorml()
        temp = co.personalcencer(usertokenstr)
        if temp == "False":
            return jsonify(Info(False, '数据库错误', None).tojson())
        else:
            return jsonify(Info(True, temp, None).tojson())
Example #11
0
 def post(self):
     usertoken = request.form["usertoken_str"]
     forumtitle = request.form["forum_title"]
     forumdesp = request.form["forum_desp"]
     fo = Forumorml()
     temp = fo.publishforum(usertoken, forumtitle, forumdesp)
     if temp:
         return jsonify(Info(True, "发布成功", None).tojson())
     else:
         return jsonify(Info(False, "数据库错误", None).tojson())
Example #12
0
 def post(self):
     usertokenstr = request.form["usertoken_str"]
     usernewquestion = request.form["user_question"]
     usernewanswer = request.form["user_answer"]
     uo = Userorml()
     temp = uo.modifyquestion(usertokenstr, usernewquestion, usernewanswer)
     if temp:
         return jsonify(Info(True, "设置成功", None).tojson())
     else:
         return jsonify(Info(False, '数据库错误', None).tojson())
Example #13
0
 def post(self):
     usertoken = request.form["usertoken_str"]
     forumid = request.form["forum_id"]
     commentcontext = request.form["comment_context"]
     fo = Forumorml()
     temp = fo.forumcommentpublish(usertoken, forumid, commentcontext)
     if temp:
         return jsonify(Info(True, "发布成功", None).tojson())
     else:
         return jsonify(Info(False, "数据库错误", None).tojson())
Example #14
0
 def post(self):
     username = request.form["user_name"]
     userpassword = request.form["user_password"]
     userquestion = request.form["user_question"]
     useranswer = request.form["user_answer"]
     print(username)
     uo = Userorml()
     temp = uo.adduser(username,userpassword,userquestion,useranswer)
     if temp:
         return jsonify(Info(True,"注册成功",None).tojson())
     else:
         return jsonify(Info(False,"数据库错误",None).tojson())
Example #15
0
 def get(self):
     username = request.args.get("user_name")
     print("*"*50)
     print(username)
     uo = Userorml()
     name = uo.checkuserexist(username)
     if name == "False":
         return jsonify(Info(False,'数据库错误',None).tojson())
     elif not name:
         return jsonify(Info(True,'可用的用户名',None).tojson())
     else:
         return jsonify(Info(False,'用户名已存在',None).tojson())
Example #16
0
 def post(self):
     usertoken = request.form["usertoken_str"]
     forumid = request.form["forum_id"]
     praisestatus = request.form["praise_status"]
     fo = Forumorml()
     temp = fo.forumpraise(usertoken, forumid, praisestatus)
     if temp == "False":
         return jsonify(Info(False, '数据库错误').tojson())
     elif temp == "0":
         return jsonify(Info(True, "取消点赞", None).tojson())
     else:
         return jsonify(Info(True, "点赞成功", None).tojson())
Example #17
0
 def post(self):
     username = request.form["user_name"]
     userpassword = request.form["user_password"]
     print("*"*50)
     print(username)
     print(userpassword)
     uo = Userorml()
     temp = uo.userlogin(username,userpassword)
     usertoken = uo.usertokenadd(username)
     if temp:
         return jsonify(Info(True,"登陆成功",usertoken).tojson())
     elif temp == "False":
         return jsonify(Info(False,"数据库错误",None).tojson())
     else:
         return jsonify(Info(False,"用户名或密码错误",None).tojson())
Example #18
0
 def get(self):
     username = request.args.get("user_name")
     userques = request.args.get("user_question")
     useranswer = request.args.get("user_answer")
     print("$$$$$$$$$$$$$$$$$$$$$$4",username)
     uo = Userorml()
     temp = uo.judgeanswer(username,userques,useranswer)
     print("########################",temp)
     if temp==3:
         temp1 = uo.getuserid(username)
         if temp1:
             return jsonify(Info(True,"密保问题及答案正确",temp1).tojson())
         else:
             return jsonify(Info(False,'用户名错误',None).tojson())
     elif temp == "False":
         return jsonify(Info(False,'数据库错误',None).tojson())
     elif temp == 1:
         return jsonify(Info(False,'密保答案输入错误',None).tojson())
     else:
         return jsonify(Info(False,'密保问题输入错误',None).tojson())
Example #19
0
def packinfo(infostatus, infomsg=None, inforesult=None):
    return jsonify(
        Info(infostatus=infostatus, infomsg=infomsg,
             inforesult=inforesult).tojson())