From f2c5ec5fed6641bc21c75aa97235aea4942b5613 Mon Sep 17 00:00:00 2001 From: XieHaoLiang <806854015@qq.com> Date: Thu, 26 Dec 2024 15:04:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0local=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=9C=8D=E5=8A=A1=E5=99=A8url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common.js | 11 ++++++++++- star-cloud.js | 5 ++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/common.js b/common.js index 44145de..17ccfbe 100644 --- a/common.js +++ b/common.js @@ -979,7 +979,16 @@ export async function parsingCharacteristicValue(binaryData) { // 获取配置 export function getConfig() { - let config = configs[this.env] + let config = {} + if (this.env === "LOCAL"){ + config = { + name: 'LOCAL', + baseUrl: this.url + } + }else{ + config = configs[this.env] + } + return { ...config, version, diff --git a/star-cloud.js b/star-cloud.js index 844ed77..b0d88da 100644 --- a/star-cloud.js +++ b/star-cloud.js @@ -80,6 +80,8 @@ class StarCloud { constructor() { // 环境 this.env = null + //sdk服务器地址 + this.url = '' // 客户端Id this.clientId = null // 客户端密码 @@ -137,7 +139,7 @@ class StarCloud { init(params) { Object.assign(StarCloud.prototype, device, lock, other, password, record, user, common) - const { clientId, clientSecret, env, platform, accounts } = params + const { clientId, clientSecret, env, platform, accounts,url } = params this.envVersion = 'release' if (platform !== 2) { const appInfo = uni.getAccountInfoSync() @@ -147,6 +149,7 @@ class StarCloud { onBLECharacteristicValueChange(this.listenCharacteristicValue.bind(this)) } + this.url = url this.isReportLog = params.isReportLog this.env = env || 'XHJ'