什么替代atos on ios? [英] What alternative for atob on ios?

查看:95
本文介绍了什么替代atos on ios?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Ionic应用程序中,我使用atob()命令。

In my Ionic application I use the atob() command.

它适用于chrome& android,但由于某些原因它在iOS上不起作用,还有其他选择吗?

It works fine on chrome & android, but for some reason it does not work on iOS, is there an alternative?

推荐答案

在IOS中, atob 不接受空格字符。
所以使用 atob 就像这样:

In IOS, atob does not accept space characters. So use atob like that:

var input = response.data.content;
input = input.replace(/\s/g, '');
var content = window.atob(input);

查看关于 atob

这篇关于什么替代atos on ios?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆