We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
感谢作者的贡献,我在使用此项目时,需要使用到SSE功能,同时需要鉴权,我在测试发现用service调用接口好像不能做SSE,我查阅到官方文档,使用的axios,但是是这样就没法鉴权了,以下是官方代码。 我的问题是如何保留鉴权功能情况下使用SSE功能,感谢你的解答。 https://node.cool-admin.com/src/guide/other/sse.html
const axios = require("axios");
const url = "http://127.0.0.1:8001/open/demo/sse/call";
const eventSource = axios.get(url, { responseType: "stream", });
eventSource.then((response) => { // 收到消息 response.data.on("data", (event) => { console.log("Message received:", event.toString()); }); // 发送结束 response.data.on("end", () => { console.log("Connection closed"); }); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
感谢作者的贡献,我在使用此项目时,需要使用到SSE功能,同时需要鉴权,我在测试发现用service调用接口好像不能做SSE,我查阅到官方文档,使用的axios,但是是这样就没法鉴权了,以下是官方代码。
我的问题是如何保留鉴权功能情况下使用SSE功能,感谢你的解答。
https://node.cool-admin.com/src/guide/other/sse.html
const axios = require("axios");
const url = "http://127.0.0.1:8001/open/demo/sse/call";
const eventSource = axios.get(url, {
responseType: "stream",
});
eventSource.then((response) => {
// 收到消息
response.data.on("data", (event) => {
console.log("Message received:", event.toString());
});
// 发送结束
response.data.on("end", () => {
console.log("Connection closed");
});
});
The text was updated successfully, but these errors were encountered: