From 8b47a6acff1683df5764c5df1b2460110255f544 Mon Sep 17 00:00:00 2001 From: jt <jt@activesoft.com.cn> Date: 星期一, 29 四月 2024 17:16:33 +0800 Subject: [PATCH] 登录时将获取的mac地址例如:78b8d67511ca 作为client_info传进api/user/ace/VerifyPassword接口里 --- pages/login/index.vue | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/pages/login/index.vue b/pages/login/index.vue index c4f8ba6..df5707a 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -600,6 +600,29 @@ } }, onLoad() { + //鑾峰彇mac鍦板潃 + var net = plus.android.importClass("java.net.NetworkInterface"); + var wl0 = net.getByName('wlan0'); + var macByte = wl0.getHardwareAddress(); + var deviceId = '' + //涓嬮潰杩欐浠g爜鏉ヨ嚜缃戠粶 + for (var i = 0; i < macByte.length; i++) { + var tmp = ""; + var num = macByte[i]; + if (num < 0) { + tmp =(255+num+1).toString(16); + } else { + tmp = num.toString(16); + } + if (tmp.length == 1) { + tmp = "0" + tmp; + } + deviceId += tmp; + } + //78b8d67511ca + this.$store.commit("setDeviceId", deviceId); + console.log('Android璁惧鐨刣eviceId:', deviceId); + plus.runtime.getProperty(plus.runtime.appid, (info) => { // console.log(info); this.$data.version = info.version; -- Gitblit v1.9.1