old_contents: import json
  
  from flask import request
  
  from . import api
  from .. import mongo
  
  @api.route('/labels', methods=['GET'])
  def query_labels():
      return '[{"text": "Baidu", "size": 5}, {"text": "Alibaba", "size": 9}, {"text": "Tencent", "size": 8}]'
new_contents: import json
  
  from flask import request
  
  from . import api
  from .. import mongo
  
  @api.route('/labels', methods=['GET'])
  def query_labels():
      query_result = [{'text': doc['text'], 'size': doc['size']} for doc in mongo.db.test.find()]
      return json.dumps(query_result, ensure_ascii=False, encoding='utf-8')
subject: 更新标签云接口：数据由写死改为查询 MongoDB 数据库