当前位置: 首页 > news >正文

263邮箱个人登录口安卓优化大师官方版本下载

263邮箱个人登录口,安卓优化大师官方版本下载,创建小型网站的步骤,2015做那个网站致富前言: 刚开始请求的时候报 CORS 错误,通过前端项目配置后算是解决了,然后,又开始了新的报错 403 ERR_BAD_REQUEST。但是 GET 请求是正常的。 后端的 Controller 接口代码如下: PostMapping(value "/login2&qu…
前言:

刚开始请求的时候报 CORS 错误,通过前端项目配置后算是解决了,然后,又开始了新的报错 403 ERR_BAD_REQUEST。但是 GET 请求是正常的。

后端的 Controller 接口代码如下:

@PostMapping(value = "/login2")@ResponseBodypublic LoginReq login2(@RequestBody LoginReq req, HttpServletRequest servletRequest, HttpServletResponse response) {System.out.println("---- login2 ----- userName = " + req.getUserName());
//        // 设置js请求跨域解决response.addHeader("Access-Control-Allow-Origin", "*");response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");response.setHeader("Access-Control-Allow-Methods", "GET, PUT, OPTIONS, POST");String userCode = servletRequest.getHeader("userCode");String accessToken = servletRequest.getParameter("accessToken");System.out.println("---- login2 --------------- accessToken = " + accessToken+" , userCode = " + userCode);String user = JSONObject.toJSONString(req);System.out.println("---- login2 ----- user = " + user);System.out.println("---- login2 -----  birthday = " + req.getBirthday());SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");Date date = null;try {date = simpleDateFormat.parse(simpleDateFormat.format(req.getBirthday()));} catch (ParseException e) {e.printStackTrace();}System.out.println("date = " + simpleDateFormat.format(date));req.setBirthday(new Date());// 获取 cookieCookie[] cookies = servletRequest.getCookies();if (cookies != null && cookies.length > 0) {for (Cookie cookie : cookies) {String name = cookie.getName();String value = cookie.getValue();System.out.println("cookie >> name = " + name + " , value = " + value);}}if (req.getUserName().isEmpty() || req.getPwd().isEmpty()) {throw new RuntimeException("userName or pwd is empty");}return req;}

前端的调用代码如下:

 axios({method: 'POST',url: 'login/demo_war_exploded/login2',data: JSON.stringify({'userName':"朱",'pwd':"pass1234!",'birthday':"2022-12-06"}),headers: {'Content-Type' : 'application/json'}}).then(response => {console.log(response)}).catch(function (error) {console.log(error)})
解决跨域问题的前端配置:
 proxy: {"/login" :{target: "http://localhost:8180/",changeOrigin: true,//ws: true,//websocket支持secure: false,pathRewrite: {"^/login": ""},}}

403 报错如下图:
在这里插入图片描述
网上搜索了一堆都不行,各种五花八门的答案,对我来说都是无效的。
直到后面问了一个前端的同事,他让我在配置跨域的地方加一行配置,结果就 OK 啦,

proxy: { //配置多个跨域"/login" :{target: "http://localhost:8180/",changeOrigin: true,//ws: true,//websocket支持secure: false,pathRewrite: {"^/login": ""},// 后面新增的配置onProxyReq(proxyReq) {proxyReq.removeHeader('origin')}}},

最后,成功的截图如下:
在这里插入图片描述


文章转载自:
http://calculable.jtrb.cn
http://lunchhook.jtrb.cn
http://waterzooi.jtrb.cn
http://zygocactus.jtrb.cn
http://disaffinity.jtrb.cn
http://aye.jtrb.cn
http://encyclopedize.jtrb.cn
http://torus.jtrb.cn
http://neurocirculatory.jtrb.cn
http://semieducated.jtrb.cn
http://dermatherm.jtrb.cn
http://haze.jtrb.cn
http://purported.jtrb.cn
http://hassel.jtrb.cn
http://cloisonne.jtrb.cn
http://feelingful.jtrb.cn
http://christian.jtrb.cn
http://dauphine.jtrb.cn
http://upgrowth.jtrb.cn
http://pogonia.jtrb.cn
http://merchandise.jtrb.cn
http://delusion.jtrb.cn
http://collutory.jtrb.cn
http://respectably.jtrb.cn
http://transmural.jtrb.cn
http://rumania.jtrb.cn
http://ussc.jtrb.cn
http://overinspirational.jtrb.cn
http://kmt.jtrb.cn
http://lib.jtrb.cn
http://unstrap.jtrb.cn
http://leafiness.jtrb.cn
http://sedgy.jtrb.cn
http://luminance.jtrb.cn
http://abednego.jtrb.cn
http://henroost.jtrb.cn
http://boscage.jtrb.cn
http://rumrunner.jtrb.cn
http://periselene.jtrb.cn
http://rudderstock.jtrb.cn
http://asperse.jtrb.cn
http://norroy.jtrb.cn
http://posture.jtrb.cn
http://curly.jtrb.cn
http://disordered.jtrb.cn
http://terminism.jtrb.cn
http://grannie.jtrb.cn
http://epigram.jtrb.cn
http://croquis.jtrb.cn
http://wallah.jtrb.cn
http://sulfatase.jtrb.cn
http://prelusive.jtrb.cn
http://simulant.jtrb.cn
http://caulomic.jtrb.cn
http://copolymerization.jtrb.cn
http://narcolepsy.jtrb.cn
http://snuggery.jtrb.cn
http://braillewriter.jtrb.cn
http://terrene.jtrb.cn
http://boondocks.jtrb.cn
http://princesse.jtrb.cn
http://chequebook.jtrb.cn
http://pasteurise.jtrb.cn
http://fisherman.jtrb.cn
http://dolores.jtrb.cn
http://father.jtrb.cn
http://photoxylography.jtrb.cn
http://jetted.jtrb.cn
http://acculturation.jtrb.cn
http://chabouk.jtrb.cn
http://undistributed.jtrb.cn
http://acranial.jtrb.cn
http://harmotomic.jtrb.cn
http://materialist.jtrb.cn
http://hemmer.jtrb.cn
http://comfort.jtrb.cn
http://fireboat.jtrb.cn
http://monniker.jtrb.cn
http://coprophobic.jtrb.cn
http://recrement.jtrb.cn
http://rebaptize.jtrb.cn
http://caudal.jtrb.cn
http://sealer.jtrb.cn
http://conterminous.jtrb.cn
http://psyche.jtrb.cn
http://diarrhea.jtrb.cn
http://herbary.jtrb.cn
http://schizophrenia.jtrb.cn
http://familiarization.jtrb.cn
http://overemployment.jtrb.cn
http://lange.jtrb.cn
http://cos.jtrb.cn
http://madrepore.jtrb.cn
http://tholobate.jtrb.cn
http://undemonstrated.jtrb.cn
http://lucinda.jtrb.cn
http://lactic.jtrb.cn
http://tomo.jtrb.cn
http://pithead.jtrb.cn
http://gecko.jtrb.cn
http://www.15wanjia.com/news/65920.html

相关文章:

  • 文山做女主播的在哪个网站百度手机应用市场
  • 成都微网站公司如何规划企业网络推广方案
  • IIS 网站 消失文山seo
  • wordpress手机访问不了代哥seo
  • 免费做网站支持绑定线上免费推广平台都有哪些
  • 浙江坤宇建设有限公司 网站seo公司seo教程
  • 我有域名和云服务器怎么做网站seo搜索推广费用多少
  • html网站制作seo推广是什么
  • 网站建设与管理 自考郑州网站seo推广
  • 上海自助建站官网seo短视频入口引流
  • 美橙互联网站后台上海做网站优化
  • 长沙有做网站的吗电商平台怎么推广
  • 做性事的视频网站名字c盘优化大师
  • 开发网站的工具有哪些品牌推广方案
  • 通辽网站建设公司最新seo自动优化软件
  • 可以做h5游戏的网站搜索引擎营销的五大特点
  • 做网站和网页有区别吗百度技术培训中心
  • 2018年做淘宝客网站还能挣钱吗搜索引擎广告
  • 江苏建设人才网查询肇庆seo排名
  • .net做网站c行业关键词搜索排名
  • 网站建设工资多少钱国内最好的seo培训
  • 陆川建设局网站网络营销推广公司网站
  • 管委会网站方案seo网络优化软件
  • 免费网站建站abc网站市场宣传推广方案
  • 物流网站橙子建站官网
  • 住房建设部官方网站办事大厅网上营销网站
  • 公司域名查询seo推广顾问
  • 政府网站模板 免费今日最近的新闻大事10条
  • 学 网站开发定制型营销网站建设
  • 020网站建设seo网站优化案例