@app.route(’/book/search//’)
def search(q,page):
isbn_or_key = is_isbn_or_key(q)
if isbn_or_key == ‘isbn’:
result = YUSHUBOOK.search_by_isbn(q)
else:
result = YUSHUBOOK.searck_by_keyword(q)
return json.dumps(result),200,{'content-type':'application/json'}
最后还是返回的
{“author”: ["\u8521\u667a\u6052"], “binding”: “\u5e73\u88c5”, “category”: “\u5c0f\u8bf4”, “id”: 1780, “image”: “https://img3.doubanio.com/lpic/s1327750.jpg”, “images”: {“large”: “https://img3.doubanio.com/lpic/s1327750.jpg”}, “isbn”: “9787501524044”, “pages”: “224”, “price”: “12.80”, “pubdate”: “1999-11-1”, “publisher”: “\u77e5\u8bc6\u51fa\u7248\u793e”, “subtitle”: “”, “summary”: “\u4f60\u8fd8\u6ca1\u6709\u8bd5\u8fc7\uff0c\u5230\u5927\u5b66\u8def\u7684\u9ea6\u5f53\u52b3\uff0c\u70b9\u4e00\u676f\u5927\u53ef\u4e50\uff0c\u4e0e\u4e24\u4efd\u85af\u6761\u7684\u7ea6\u4f1a\u65b9\u6cd5\u5417\uff1f\u90a3\u4f60\u4e00\u5b9a\u8981\u8bfb\u76ee\u524d\u6700\u62a2\u624b\u7684\u8fd9\u90e8\u7f51\u7edc\u5c0f\u8bf4\u2014\u2014\u300a\u7b2c\u4e00\u6b21\u7684\u4eb2\u5bc6\u63a5\u89e6\u300b\u3002\n\u7531\u4e8e\u8fd9\u90e8\u5c0f\u8bf4\u5728\u7f51\u7edc\u4e0a\u4e00\u518d\u88ab\u8f6c\u8f7d\uff0c\u4f7f\u5f97\u75de\u5b50\u8521\u7684\u77e5\u540d\u5ea6\u50cf\u4e00\u80a1\u70ed\u6d6a\u5728\u7f51\u7edc\u4e0a\u5ef6\u70e7\u5f00\u6765\uff0c\u8fbe\u5230\u65e0\u56fd\u754c\u4e4b\u5883\u3002\u4f5c\u8005\u7684\u7535\u5b50\u4fe1\u7bb1\uff0c\u6bcf\u5929\u90fd\u6536\u5230\u70ed\u60c5\u7684\u7f51\u53cb\u5982\u96ea\u7247\u98de\u6765\u7684\u4fe1\u4ef6\uff0c\u75de\u5b50\u8521\u4e0e\u8f7b\u821e\u98de\u626c\u5df2\u6210\u4e3a\u7f51\u7edc\u53f2\u4e0a\u6700\u53d1\u70e7\u7684\u7f51\u7edc\u60c5\u4eba\u3002”, “title”: “\u7b2c\u4e00\u6b21\u7684\u4eb2\u5bc6\u63a5\u89e6”, “translator”: []}
不知道哪里出问题???????????????????????
7月老师深入浅出剖析Flask核心机制,和你一起探讨Python高级编程
了解课程