用ant-design-pro簡(jiǎn)單寫(xiě)了個(gè)項(xiàng)目,用的還是自帶的mock API,自己在根目錄下寫(xiě)了個(gè)server.js運(yùn)行npm run build打包后的文件,dist目錄如下:server.js大致內(nèi)容:app.use(express.static(path.join(__dirname, 'dist')));app.use("/", function(req, res){ res.redirect('/index.html');});const port = process.env.PORT || 9008;const server = http.createServer(app);server.listen(port, function () { console.log('ENS is listening on port : ' + port);});啟動(dòng)server.js打開(kāi)瀏覽器顯示有302錯(cuò)誤,控制臺(tái)報(bào)Cannot read property 'notifyCount' of undefined如下:user部分沒(méi)有改動(dòng),服務(wù)端傳來(lái)的數(shù)據(jù)在控制臺(tái)能正常輸出,我搞不懂是哪里出了問(wèn)題,npm start在瀏覽器可以正常顯示,npm run build之后在瀏覽器127.0.0.1:9008打開(kāi)報(bào)錯(cuò),請(qǐng)問(wèn)各位大神這該怎么解決?
ant-design-pro項(xiàng)目npm run build之后瀏覽器打開(kāi)報(bào)錯(cuò)
溫溫醬
2019-03-07 18:17:22