1
0
forked from dyf/APP

670发送紧急通知调整,与PC端一致的处理方案

This commit is contained in:
liub
2025-09-18 11:32:22 +08:00
parent da9a9f4874
commit dcecf07ecc
3 changed files with 23 additions and 31 deletions

40
App.vue
View File

@ -6,26 +6,26 @@
onLaunch: function() { onLaunch: function() {
//以下代码仅在开发时使用,否则会出现不可预知的问题。 //以下代码仅在开发时使用,否则会出现不可预知的问题。
//清除登陆之外的所有信息; //清除登陆之外的所有信息;
let store=uni.getStorageInfoSync(); // let store=uni.getStorageInfoSync();
store.keys.forEach((val,index,array)=>{ // store.keys.forEach((val,index,array)=>{
if(val=="tokenTime"){ // if(val=="tokenTime"){
let time=uni.getStorageSync(val); // let time=uni.getStorageSync(val);
if(!time){ // if(!time){
time=0; // time=0;
} // }
let currTime=new Date().getTime(); // let currTime=new Date().getTime();
if(currTime>=time){ // if(currTime>=time){
uni.removeStorageSync(val); // uni.removeStorageSync(val);
uni.removeStorageSync("token"); // uni.removeStorageSync("token");
uni.removeStorageSync("clientID"); // uni.removeStorageSync("clientID");
} // }
} // }
else if(val=="token" || val=="clientID"){ // else if(val=="token" || val=="clientID"){
console.log("忽略登陆信息"); // console.log("忽略登陆信息");
}else{ // }else{
uni.removeStorageSync(val); // uni.removeStorageSync(val);
} // }
}); // });
//以上代码仅在开发时使用,否则会出现不可预知的问题。 //以上代码仅在开发时使用,否则会出现不可预知的问题。
uni.getSystemInfo({success:function(res){ uni.getSystemInfo({success:function(res){

View File

@ -1996,18 +1996,10 @@
text: "请稍候..." text: "请稍候..."
}); });
this.setBleFormData(); this.setBleFormData();
let arr = [];
if (this.formData.msgTxt.length > 8) {
arr.push(this.formData.msgTxt.substring(0, 8));
arr.push(this.formData.msgTxt.substring(8));
} else {
let index = Math.floor(this.formData.msgTxt.length / 2)
arr.push(this.formData.msgTxt.substring(0, index));
arr.push(this.formData.msgTxt.substring(index));
}
let data = { let data = {
"sendMsg": arr.join('|'), "sendMsg": this.formData.msgTxt,
"deviceIds": [ "deviceIds": [
this.device.id this.device.id
], ],

File diff suppressed because one or more lines are too long