<p>烧瓶中的<a href="http://flask.pocoo.org/docs/1.0/quickstart/#about-responses" rel="noreferrer">About Responses</a>:</p>
<blockquote>
<h1>About Responses</h1>
<p>The return value from a view function is automatically converted into a response object for you. If the return value is a string it's converted into a response object with the string as response body, a <code>200 OK</code> status code and a <code>text/html</code> mimetype. The logic that Flask applies to converting return values into response objects is as follows:</p>
<ol>
<li>If a response object of the correct type is returned it's directly returned from the view.</li>
<li>If it's a string, a response object is created with that data and the default parameters.</li>
<li>If a tuple is returned the items in the tuple can provide extra information. Such tuples have to be in the form <code>(response, status, headers)</code> or <code>(response, headers)</code> where at least one item has to be in the tuple. The <code>status</code> value will override the status code and <code>headers</code> can be a list or dictionary of additional header values.</li>
<li>If none of that works, Flask will assume the return value is a valid WSGI application and convert that into a response object.</li>
</ol>
</blockquote>
<p>因此,如果返回文本字符串(正如您所做的那样),那么AJAX调用必须接收的状态代码是<code>200 OK</code>,并且成功回调必须正在执行。但是,我建议您返回一个JSON格式的响应,如:</p>
<pre><code>return json.dumps({'success':True}), 200, {'ContentType':'application/json'}
</code></pre>