def POST(self): data = web.input() self.xh, self.pw = data.xh, data.pw t, time_md5 = data.t, data.time_md5 try: zf, ret = zf_login(data, time_md5) #value = all_client.pop(time_md5) #zf, viewstate = value except KeyError: return json_err("can not find target time_md5") if ret.find('欢迎您') != -1: pass elif ret.find('密码错误') != -1: return json_err("password wrong") elif ret.find('验证码不正确') != -1: return json_err("verify code wrong") else: return json_err("server is sleeping ...") if t == "1": table = zf.get_score() json_object = self.__score_get_json(table) elif t == "2": return json_err("please contact admin") #table = zf.get_kaoshi() elif t == "3": #return json_err("please contact admin") table = zf.get_kebiao() k = KBJSON(table) json_object = k.get_json() else: return json_err("can not find your t") if json_object: return json_object else: return json_err("can not find your contents")
def get_kb_json(kb): k = KBJSON(kb) return k.get_json()