这里我使用的是iview-admin-pro,在一次打包中修改了setting.env.js,想着绝对路径改为相对路径来着,这次查看 发现以上报错

URIError: Failed to decode param '/%3C%=%20BASE_URL%20%%3Efavicon.ico'
    at decodeURIComponent (<anonymous>)
    at decode_param (C:\Users\ld\Desktop\刘\真实文件(\互动课堂录入查询\iview-admin-hudong_Input\node_modules\express\lib\router\layer.js:172:12)
    at Layer.match (C:\Users\ld\Desktop\刘\真实文件(\互动课堂录入查询\iview-admin-hudong_Input\node_modules\express\lib\router\layer.js:123:27)
    at matchLayer (C:\Users\ld\Desktop\刘\真实文件(\互动课堂录入查询\iview-admin-hudong_Input\node_modules\express\lib\router\index.js:574:18)
    at next (C:\Users\ld\Desktop\刘\真实文件(\互动课堂录入查询\iview-admin-hudong_Input\node_modules\express\lib\router\index.js:220:15)
    at expressInit (C:\Users\ld\Desktop\刘\真实文件(\互动课堂录入查询\iview-admin-hudong_Input\node_modules\express\lib\middleware\init.js:40:5)
    at Layer.handle [as handle_request] (C:\Users\ld\Desktop\刘\真实文件(\互动课堂录入查询\iview-admin-hudong_Input\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (C:\Users\ld\Desktop\刘\真实文件(\互动课堂录入查询\iview-admin-hudong_Input\node_modules\express\lib\router\index.js:317:13)
    at C:\Users\ld\Desktop\刘\真实文件(\互动课堂录入查询\iview-admin-hudong_Input\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (C:\Users\ld\Desktop\刘\真实文件(\互动课堂录入查询\iview-admin-hudong_Input\node_modules\express\lib\router\index.js:335:12)
    at next (C:\Users\ld\Desktop\刘\真实文件(\互动课堂录入查询\iview-admin-hudong_Input\node_modules\express\lib\router\index.js:275:10)
    at query (C:\Users\ld\Desktop\刘\真实文件(\互动课堂录入查询\iview-admin-hudong_Input\node_modules\express\lib\middleware\query.js:45:5)
    at Layer.handle [as handle_request] (C:\Users\ld\Desktop\刘\真实文件(\互动课堂录入查询\iview-admin-hudong_Input\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (C:\Users\ld\Desktop\刘\真实文件(\互动课堂录入查询\iview-admin-hudong_Input\node_modules\express\lib\router\index.js:317:13)
    at C:\Users\ld\Desktop\刘\真实文件(\互动课堂录入查询\iview-admin-hudong_Input\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (C:\Users\ld\Desktop\刘\真实文件(\互动课堂录入查询\iview-admin-hudong_Input\node_modules\express\lib\router\index.js:335:12)

开发环境会报错但是我传到线上还得改回来…:

 publicPath: env === 'development' ? './' : './',

修改

publicPath: env === 'development' ? '/' : '/',
Logo

鸿蒙生态一站式服务平台。

更多推荐