在项目中使用vue
的history模式,需要配置文件,使用到宝塔面板的服务器。现在记录存放位置。
/www/server/panel/vhost/nginx
配置history模式
try_files $uri $uri/ /index.html qkbim/index.html;
配置跨域
add_header Access-Control-Allow-Origin '*';add_header Access-Control-Allow-Methods 'POST,PUT,GET,DELETE';add_header Access-Control-Allow-Headers 'version, access-token, user-token, Accept, apiAuth, User-Agent, Keep-Alive, Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With';