当前位置:网站首页>Uniapp converts graphic verification codes in the form of file streams into images
Uniapp converts graphic verification codes in the form of file streams into images
2022-06-25 15:56:00 【It doesn't stand up to scrutiny】
uni.request({
url: 'http://10.1.11.165:8000/code/', // Just for the sample , Not the real interface address .
responseType: 'arraybuffer',
success: (res) => {
this.urls = 'data:image/png;base64,' + btoa(
new Uint8Array(res.data)
.reduce((data, byte) => data + String.fromCharCode(byte), '')
);
console.log(this.urls)
}
});
Be careful :
responseType: ‘arraybuffer’, Must specify
uniapp Address :https://uniapp.dcloud.io/api/request/request
边栏推荐
猜你喜欢
Why is it said that restarting can solve 90% of the problems

Asynchronous processing of error prone points
Consumer and producer cases of inter thread synchronization (condition variable)

面试官:你简历上说精通mysql,那你说下聚簇/联合/覆盖索引、回表、索引下推

合宙Air32F103CBT6开发板上手报告

TFIDF and BM25
Gold three silver four, an article to solve the resume and interview

剑指 Offer 09. 用两个栈实现队列
Prototype mode

Sword finger offer II 091 Paint the house
随机推荐
JS中的==和===的区别(详解)
Traversal and branch judgment of JS (case on June 24, 2022)
Go development team technical leader Russ Cox sends a document to share go's version control history
Ten routing strategies for distributed task scheduling platform XXL job
将一个文件写入到另一个文件的标记位置
NFT元宇宙发展能做什么?
Sword finger offer 06 Print linked list from end to end
Open the box to experience rust, come on!!!
MySQL transaction characteristics and implementation principle
Continuous integration of aspnetcore & cloud flow
元宇宙系统的概念解析
说下你对方法区演变过程和内部结构的理解
剑指 Offer 09. 用两个栈实现队列
SQL最常用的语句
Built in methods for data types
Converting cifar10 datasets
Several ways of SQL optimization
golang正则regexp包使用-05-扩展Expand()、根据正则切割Split()
After the project is pushed to the remote warehouse, Baota webhook automatically publishes it
sql优化的几种方式