Swagger2异常之Unable to infer base url.

今天公司叫我和另一个后端把代码整合的时候发现swagger2版本不一致,由于我善解人衣…
咳咳,万恶的输入法!我怎么是那种人,反正就出现如下情况
打开http://localhost:8080/swagger-ui.html#/api/user出现
在这里插入图片描述

Unable to infer base url. This is common when using dynamic servlet registration or when the API is behind an API Gateway. The base url is the root of where all the swagger resources are served. For e.g. if the api is available at http://example.org/api/v2/api-docs then the base url is http://example.org/api/. Please enter the location manually:

开始的时候我去查找资料的发现,大部分都是说
在启动类上加上注解@EnableSwagger2
然并卵
然而聪明帅气的我是不可能放弃的
会 a little 前端的我打开了F12
在这里插入图片描述
发现404了
在这里插入图片描述
然后结合我多年的经验和大胆的推测,得出一个惊人的结论!
swagger2的数据没更新
由于现在的浏览器都带有本地缓存数据的习惯(什么臭毛病)
在这里插入图片描述
所以得先把原先的数据清除,然后等待页面加载完毕既可!
在这里插入图片描述

我是 丿烂人丶 一个为生活而努力奋斗的萌新.希望以后的路上,我们一起并肩前行!