Webpack Cross-domain problem options request returned 204 No Content?

  1. the technology stack is: there is no problem for webpack+vue+express, programs to run directly in the development environment. Then plan to separate the front and back end code, and configure the project to the production environment, so webpack is packaged directly into the dist directory, and then the index.html and static directories are placed in the static directory of nginx. Visit: http://localhost, you can see the login interface, but the execution of the login issued an options request and returned 204 No Content.
  2. the question is: why is there no post request for login, but only options request? How to deal with the cross-domain problem of front-end separation.
  3. existing processing: axios network library used in the front end, and axios.defaults.withCredentials = true; has been added; the back end uses the cors library, code: app.use (cors ({credentials: true}));
  4. The screenshot of
  5. question is as follows:
Mar.11,2021

204 is normal. Both 200and 204are returned by OPTIONS. As to why POST didn't send it, it's not clear. Let's see if it's wrong.

< H2 > add < / H2 >

how to deal with cross-domain issues in front and back end separate development:
use devServer.proxy in webpack configuration as a proxy, for example:

cors</a>

cors:

app.use(cors({
    origin: 'http://127.0.0.1', //webpackindex.htmlstaticnginxhtmlwebpackOriginhttp://127.0.0.1 
    allowedHeaders: 'Origin, x-requested-with, Content-Type, X-Token', //X-Token
    credentials: true //true cookie
}));
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e45c5c-66500.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e45c5c-66500.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?