egg
egg copied to clipboard
egg在post接口中重定向出现options,导致重定向失败
- 在post请求的controller中准备重定向到这个url
- 直接用postman发post请求可以正常重定向,在前端ajax不行
- get请求都可以
const setLoginState = await this.service.portal.portal.getLoginState()
this.ctx.redirect(setLoginState);
-
前端的console 重定向为什么会产生options请求方式
-
各位在egg.js中post请求中怎么重定向的啊,
如果是 cnode 那个问题的话,朴老师已经回答了,ajax 里面怎么 redirect
@atian25 请问能给个链接吗, 没搜到, 谢谢
https://cnodejs.org/topic/5ab21e76ce4a27f867527305
这不就是你么?
你的请求是 ajax ?