Vue axios config is configured to explain why it is still cross-domain.

proxyTable: {
      "/api": { //"/api""http://f.apiplus.c" 
        target: "http://127.0.0.1:3000", // 
        changeOrigin: true, // 
        pathRewrite: {
          "^/api": "" // 
        }
      }
    },
    


export const getHomeCasual = ()=>ajax("api/homecasual");
Mar.23,2022

1. First of all, the cross-domain of the web end is caused by the security policy of the browser. To solve the cross-domain problem, the server needs to support
2. The server needs to set the following response header in the response header
clipboard.png

.

wherein:
origin allows cross-domain sources. Take origin
credentials in the request header to allow cross-domain credentials (such as cookie, other certificates, etc.)
methods allows cross-domain methods, generally get,post (axios initiates pre-request option for miscellaneous requests)
header allows cross-domain request headers


is / api/homecasual instead of api/homecasual , you are missing a / .

proxyTable: {
      '/api': { //"/api""http://f.apiplus.c" 
        target: 'http://127.0.0.1:3000', // 
        changeOrigin: true, // 
        pathRewrite: {
          '^/api': '' // 
        }
      }
    },
    
export const getHomeCasual = ()=>ajax('/api/homecasual');
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-1e97d8d-4744a.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-1e97d8d-4744a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?