Skip to content

Commit

Permalink
feat(runtime-web): getSystemInfo 接口补充 SDKVersion 版本信息
Browse files Browse the repository at this point in the history
  • Loading branch information
lyfeyaj committed Apr 25, 2023
1 parent aad48e9 commit 037eaef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/runtime-web/src/api/device/systeminfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ function contains(arr, needle) {

function systemInfo() {
const info = {
// NOTE: 这里暂时以最新版本的支付宝小程序基础库为准
SDKVersion: '2.8.9',
model: md.mobile(),
pixelRatio: window.devicePixelRatio, //设备像素比。
windowWidth: document.body.clientWidth,
Expand Down Expand Up @@ -42,7 +44,7 @@ function systemInfo() {
model = md.mobile() + ' ' + (md.version('iPhone') || md.version('iPad'))
version = md.versionStr('iPhone') || md.versionStr('iPad')
const sss = md.userAgent() && md.userAgent().split(';')
//判断UA里边有没有Build信息,通过这个拿到安卓的具体机型
//判断 UA 里边有没有 Build 信息,通过这个拿到安卓的具体机型
const i = contains(sss, 'Build/')
if (i > -1) {
model = sss[i].substring(0, sss[i].indexOf('Build/'))
Expand Down

0 comments on commit 037eaef

Please sign in to comment.