1. 程式人生 > >Nodejs:npm run build之後,dist\index.html頁面在火狐中可以正常顯示登入頁面並登入成功,在Chrome中可以正常顯示登入頁面,登入失敗

Nodejs:npm run build之後,dist\index.html頁面在火狐中可以正常顯示登入頁面並登入成功,在Chrome中可以正常顯示登入頁面,登入失敗

問題描述:Nodejs:npm run build之後,dist\index.html頁面在火狐中可以正常顯示登入頁面並登入成功,在Chrome中可以正常顯示登入頁面,登入失敗

 

解決方法:將打包後的dist\index.html放到http伺服器上執行就可以登入了。

 

總結:由於Chrome不支援本地靜態cookie,所以導致在Chrome中set cookie的時候失敗,導致沒有走到正常的登入流程。

 

參考:    http://lhdst-163-com.iteye.com/blog/1245110
    http://polokang.iteye.com/blog/646722
    https://blog.csdn.net/wilesen/article/details/72823269
    https://blog.csdn.net/u014477038/article/details/52330047