vue部署上线后跨域问题,git回退到n年前的项目版本怎么办?

一、vue-cli4.0版本部署上线跨域问题:
vue-cli4.0项目打包后,在本地vue.config.js配置的反向代理不起作用:

module.exports = {
  runtimeCompiler: true,
  publicPath: '[{[ .StaticURL ]}]',
  // publicPath: '/static',
  lintOnSave: false,
  devServer: { 
    proxy: {
      '/netapi': {
      	/*target是你要进行跨域的目标地址*/
        target: 'http://xxx.xxx.xxx.com:86/',
        changeOrigin: true,
        pathRewrite: {
          '^/netapi': ''
        }
      }
    }
  }
}

后来发现,项目打包上线后需要在nginx配置代理,方可请求到目标接口:

server {
        listen       8080;
        server_name  localhost;
        charset utf-8;
        access_log  logs/host.access.log  main;


        location / {
        
		     /*1、发现设置根路径为打包后的路径时,nginx配置的跨域不起作用*/
            # root  C:\mpro\ser\frontend\dist; 
   
            index  index.html index.htm;
            
            /*2、所以干脆就使用proxy_pass代理到本地解决*/
            proxy_pass http://localhost:8080/;
            
        }
        
        location /netapi/ {
        
        	/*3、我是代理的请求地址哦*/
            proxy_pass http://xxx.xxx.xxx.com:86/; 
            
            client_max_body_size 10M;
        } 
        
        /*
            因为我项目本地已创建baseURL.js所以就直接请求/api/xxx,
            请求地址拼接为: 'baseURL/api/xxx',如(http://localhost:8080/api/xxx)
            如果在nginx上配置/api那么就会有冲突,也就是本应该请求本地的/api地址,
            却被nginx代理,所以就出现了错误(又请求不到目标地址),所以我把它注掉!
        */
        /*localhost /api {
            client_max_body_size 10M;
        }*/

二、git后悔药系列:

某天小a不小心玩了一下git reset --hard xxx(某个版本),突然发现自己回退到了上古世纪的版本,心想我写的代码呢?我写了好多了啊?怎么办?
然后他开始冷(bai)静(du)思(yi)考(xia);
发现git reflog可以查询到自己所有的操作历史;
在这里插入图片描述
往下翻,看到了这条调皮的命令(没错,就是这条男默女泪的命令,让小a差点崩溃):在这里插入图片描述
果断:git reset --hard de452e6;

就这样,小a的代码终于回来了!