asong 最近的时间轴更新
asong's repos on GitHub
11 人关注
blogs
limingxin's blog
JavaScript · 4 人关注
react-boilerplate
A react boilerplate with mobx, webpack and typescript
Vue · 2 人关注
debug-vuejs-project-with-vscode
A demo of debugging Vue projects using vscode
1 人关注
vant-weapp
轻量、可靠的小程序 UI 组件库
0 人关注
ali-react-table
Performent, flexible and modern React table component.
0 人关注
ant-design
An enterprise-class UI design language and React UI library
TypeScript · 0 人关注
ant-design-icons
⭐ Ant Design SVG Icons
0 人关注
ant-design-pro-site
0 人关注
clipboard2markdown
Convert rich-text on your clipbaord to markdown
0 人关注
learn-git
用于学习 Git 的仓库
0 人关注
mrlmx
TypeScript · 0 人关注
nextjs-dashboard
0 人关注
nextjs-learn-cn
Learn Next.js 中文教程
JavaScript · 0 人关注
safari-redirect-demo
A demo of Authorization header lost after Safari redirect.
0 人关注
translated-content
All translated MDN content in raw form
0 人关注
umi
🌋 Pluggable enterprise-level react application framework.
0 人关注
uni-ui
基于uni-app的ui框架
0 人关注
unsplash-js
🤖 A server-side JavaScript wrapper for the Unsplash API
0 人关注
vant
Lightweight Mobile UI Components built on Vue
0 人关注
weapp-qrcode
微信小程序快速生成二维码,支持回调函数返回二维码临时文件
Vue · 0 人关注
xin-ui-vue
a vue ui component project.
asong

asong

V2EX 第 160607 号会员,加入于 2016-02-25 23:50:29 +08:00
asong 最近回复了
115 天前
回复了 Outshine 创建的主题 分享创造 为了练手做的一个导航站~
+1, +1

一个导航,域名看完就忘不掉😏

https://yigedaohang.com/

目前收集了一些自己常用的在线网站。

部署在 vercel ,免费白嫖中😄
115 天前
回复了 dc2002007 创建的主题 React react ui 组件库选择
在这个帖子里,发现了很多有意思的库😄
不得不说,很强👍
164 天前
回复了 zhuzhiqiang 创建的主题 推广 号卡分销平台,招募代理一单返佣 80-200
@ldlywt 同问 🤔
173 天前
回复了 railsboy 创建的主题 分享创造 分享个抖音视频去水印的
@railsboy @DreamingCTW 请问一下这种小程序会被封吗?另外会被 抖音/快手/小红书 告吗 😂
这里也有一个

https://yigedaohang.com/
180 天前
回复了 xapp 创建的主题 分享创造 推荐一个观影刷剧的小工具
@cxsz 请问 tvbox 是哪个软件,方便给个下载地址吗?刚在 GitHub 上没有搜到。🤣
2023-01-26 17:13:36 +08:00
回复了 lxiian 创建的主题 微信 请问微信小程序的 request 怎么拦截 302 重定向啊
小程序怎么拦截不太清楚,但是之前是在浏览器环境中遇到过类型的问题,是通过 fetch 和 xhr 配合到一起处理的。

不知道能不能对你有所帮助,代码逻辑如下:

```js
/**
* 获取重定向的 URL
*/
const getRedirectURL = (url, options) => {
return new Promise((resolve) => {
const xhr = new XMLHttpRequest();
xhr.open("GET", url);
const { headers = {} } = options;
// 设置请求头
Reflect.ownKeys(headers).forEach((key) => {
xhr.setRequestHeader(key, headers[key]);
});
xhr.send();
xhr.onreadystatechange = function () {
if (this.readyState === this.DONE) {
// 在这里判断 responseURL 是否 和 原始 URL 一致( this.responseURL 也有可能为空)
if (this.responseURL && this.responseURL !== url) {
// 如果不一致,则终止请求
resolve(this.responseURL);
// 终止请求之后,this.responseURL 的值会被置空,所以需要在最后调用。
this.abort();
return;
}
console.log("未发生重定向,responseUR 的值为:", this.responseUR);
resolve();
}
};
xhr.onerror = function (e) {
console.log("请求失败", e);
resolve();
};
});
};

/**
* 封装处理 重定向 的 Fetch
*/
const request = (url, options) => {
return fetch(url, options).then(async (response) => {
// 手动处理 HTTP 重定向时,type 的值为 "opaqueredirect"
if (response.type === "opaqueredirect") {
const redirectURL = await getRedirectURL(url, options);
if (!redirectURL) {
throw new Error("未获取到重定向 URL");
}
// 自动对重定向的 URL 发起请求
return request(redirectURL, options);
}
return response.json();
});
};


(async () => {
// 发请求
const result = await request("/api/user/list", {
headers: { Authorization: `Bearer xxxxxxxxx`, foo: "bar" },
redirect: "manual",
});
console.log(result);
})();
```

具体思路,可以参考这里:

https://github.com/mrlmx/blogs/issues/2
2020-07-21 18:17:57 +08:00
回复了 endosome 创建的主题 iPhone 如何下载 twitter 上的视频,并保存于 iPhone ?
有个微信小程序叫做「 Twitter 视频下载」,可以试试。
2018-06-08 13:56:51 +08:00
回复了 a554340466 创建的主题 程序员 求推荐阅读计算机类电子书籍的设备
@maemolee 什么把手 😂
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1255 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 17:46 · PVG 01:46 · LAX 10:46 · JFK 13:46
Developed with CodeLauncher
♥ Do have faith in what you're doing.