Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
bh-mobile-sdk
Advanced tools
金智教育移动校园 JavaScript SDK
npm install bh-mobile-sdk
import {init} from 'bh-mobile-sdk'
init(() => {
console.log(BH_MOBILE_SDK)
})
从 bh-mobile-sdk
中引入 init
方法,执行成功后,在全局变量里就会有 BH_MOBILE_SDK
SDK 提供的 Api 是分模块的,先阶段一共有三大模块,UI, systemAbility, file
如果想调用某个 UI 模块下的的 api,BH_MOBILE_SDK.UI.closeWebView
actionSheet(title: String, actions: Array, callback: Function)
系统actionSheet弹框,在页面底部弹出,一般用于多个功能选择,例如对某张图片:分享,保存图片,点赞成等
title: String
弹框标题actions: Array
弹框操作按钮的标题数组callback(index): Function(Number)
点击按钮后的回调方法 ,会返回点击的index
index: Number
传入的按钮数据的index下标列表,从0开始const COUNTRY = ['中国','日本','韩国']
BH_MOBILE_SDK.UI.actionSheet('请选择', COUNTRY, (index) => {
console.log('选择国家: ' + COUNTRY[index]);
})
alertView(title: String, content: String, btnTitles: Array, callback: Function)
系统alertView弹框,在页面正中间弹出
title: String
弹框标题content: String
弹框标题btnTitles: Array
弹框操作按钮的标题数组callback(index): Function(Number)
点击按钮后的回调方法 ,会返回点击的index
index: Number
传入的按钮数据的index下标列表,从0开始const BTNS = ['确定','取消']
BH_MOBILE_SDK.UI.alertView('提示', '这个一个alertview', BTNS, (index) => {
console.log('点击了按钮' + BTNS[index]);
});
closeWebView
关闭当前webview
BH_MOBILE_SDK.UI.closeWebView()
multiPicker
BH_MOBILE_SDK.UI.singleSelect(['选项1', '选项2'], 0, (index) => {
console.log(index) // 选择了第几项
})
multiPicker
BH_MOBILE_SDK.UI.multiPicker([{'选项组1': ['选项1', '选项2']}, {'选项组2': ['选项1', '选项2']}], (index) => {
console.log(index) // 选择了第几项,以逗号分隔 比如 0,1 选择的是选项组1,选项2
})
`preViewImages(imgs: Array, [index: Number])
原生图片浏览器,可以传递一组图片地址以及描述进行浏览,图片可以来自网络或者本地。组件默认带分享功能
imgs: Array
图片数组,用于展示, 每一项的机构建下面
item: Object
url 控制图片地址,desc 控制图片描述index: Number
默认展示哪一张,index从数组下标0开始BH_MOBILE_SDK.UI.preViewImages([{
url: "http://****/1.png",
desc: "我是图片的描述1"
}, {
url: "http://****/2.png",
desc: "我是图片的描述2"
}])
setNavHeader(flag: Boolean)
设置客户端原生头是否隐藏, 默认是显示的,传入 false 隐藏原生头
flag: Boolean
控制头部是否显示,true: 显示, flase: 隐藏BH_MOBILE_SDK.UI.setNavHeader(false)
setTitleText(title: String)
设置原生头的 title
title: String
头部的 titleBH_MOBILE_SDK.UI.setTitleText('我是 title')
takeCamera(cb: Function)
唤起系统相机拍照
cb(files): Function(Array<Object>)
回调,返回拍照图片的信息
file: Object
url: 图片本地地址,base64: 图片的 base64字符串BH_MOBILE_SDK.systemAbility.takeCamera((ret) => {
console.log(ret)
})
takePhoto(cb: Function, limit: Number)
唤起系统相册
cb(files): Function(Array<Object>)
回调,返回拍照图片的信息
file: Object
url: 图片本地地址,base64: 图片的 base64字符串limit: Number
允许选择的图片个数,不传默认为1BH_MOBILE_SDK.systemAbility.takeCamera((ret) => {
console.log(ret)
})
share(config: Object)
分享内容
config: Object
: 分享的配置文件,title 控制分享的标题,linkUrl 控制分享的连接分享内容
BH_MOBILE_SDK.social.share({
title: '分享的 title',
linkUrl: 'http://www.baidu.com' // 分享的链接
})
FAQs
wisedu mobile web sdk
The npm package bh-mobile-sdk receives a total of 4 weekly downloads. As such, bh-mobile-sdk popularity was classified as not popular.
We found that bh-mobile-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.