找到react-script模块文件夹config下面 paths.js
node_modules\react-scripts\config\ paths.js
function getServedPath(appPackageJson) {
const publicUrl = getPublicUrl(appPackageJson);
const servedUrl =
envPublicUrl || (publicUrl ? url.parse(publicUrl).pathname : './');
return ensureSlash(servedUrl, true);
}
修改 pathname 成当前就好了