擅长:python、mysql、java
<p>请改用此代码</p>
<pre><code>class IndexDotHTMLAwareStaticFileHandler(tornado.web.StaticFileHandler):
def parse_url_path(self, url_path):
if not url_path or url_path.endswith('/'):
url_path += 'index.html'
return super(IndexDotHTMLAwareStaticFileHandler, self).parse_url_path(url_path)
</code></pre>
<p>现在在应用程序中使用该类而不是普通的StaticFileHandler。。。任务完成了!</p>