ant-design / ant-design-pro

👨🏻‍💻👩🏻‍💻 Use Ant Design like a Pro!
https://pro.ant.design
MIT License
36.31k stars 8.14k forks source link

🧐[问题 | question] 我部署到服务器,刷新后提示找不到页面 #11205

Closed nyeee closed 4 months ago

nyeee commented 5 months ago

🧐 问题描述 | Problem description

我部署到服务器,刷新后提示找不到页面。如果从index.html进入,然后打开目录,这个页面是正常的。 config有配置hash=true。

image

💻 示例代码 | Sample code

package: "name": "ant-design-pro", "version": "6.0.0", "private": true, .... dependencies": { "@ant-design/icons": "^4.8.1", "@ant-design/pro-components": "^2.7.0", "@umijs/route-utils": "^2.2.2", "antd": "^5.13.2", "antd-style": "^3.6.1", "classnames": "^2.5.1", "lodash": "^4.17.21", "moment": "^2.30.1", "omit.js": "^2.0.2", "querystring": "^0.2.1", "rc-menu": "^9.12.4", "rc-util": "^5.38.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-helmet-async": "^1.3.0" },

export default defineConfig({ base:'/', /**

🚑 其他信息 | Other information

OS:

Node:18

浏览器 | browser:谷歌

ahkjxy commented 4 months ago

搜索一下单页面应该的nginx配置吧

nyeee commented 4 months ago

https://umijs.org/docs/guides/mpa 这个吗?

nyeee commented 4 months ago

最后是这个:之前配置写错参数,所以不实现 https://pro.ant.design/config/config#history