1
0
forked from dyf/APP

封装发送照片、视频、文字,各设备调用公共模块

This commit is contained in:
liub
2026-04-24 17:28:56 +08:00
parent 5128c29d86
commit 677586e51c
11 changed files with 961 additions and 1417 deletions

52
App.vue
View File

@ -9,32 +9,34 @@
export default {
onLaunch: function() {
//以下代码仅在开发时使用,否则会出现不可预知的问题。
//清除登陆之外的所有信息;
// let store=uni.getStorageInfoSync();
// store.keys.forEach((val,index,array)=>{
// if(val=="tokenTime"){
// let time=uni.getStorageSync(val);
// if(!time){
// time=0;
// }
// let currTime=new Date().getTime();
// if(currTime>=time){
// uni.removeStorageSync(val);
// uni.removeStorageSync("token");
// uni.removeStorageSync("clientID");
// }
// }
// else if(val=="token" || val=="clientID" || val=='phone'){
// console.log("忽略登陆信息");
// }else{
// uni.removeStorageSync(val);
// }
// });
// uni.clearStorageSync();
//以上代码仅在开发时使用,否则会出现不可预知的问题。
// #ifdef APP|APP-PLUS
let appid = plus.runtime.appid;
console.log("appid=", appid);
if (appid === 'HBuilder') {
let store = uni.getStorageInfoSync();
store.keys.forEach((val, index, array) => {
if (val == "tokenTime") {
let time = uni.getStorageSync(val);
if (!time) {
time = 0;
}
let currTime = new Date().getTime();
if (currTime >= time) {
uni.removeStorageSync(val);
uni.removeStorageSync("token");
uni.removeStorageSync("clientID");
}
} else if (val == "token" || val == "clientID" || val == 'phone') {
console.log("忽略登陆信息");
} else {
uni.removeStorageSync(val);
}
});
}
let system = uni.getSystemInfoSync();