优化页面

This commit is contained in:
pengxiaolong
2025-06-10 23:06:51 +08:00
parent 8c70c2c850
commit 3c2d7e5959
974 changed files with 353 additions and 87597 deletions

26
App.vue
View File

@@ -1,9 +1,9 @@
<script lang="ts">
// #ifdef APP-PLUS || H5
import { TUIChatKit } from './TUIKit';
import { useCounterStore } from '@/stores/counter'
const counter = useCounterStore()
import { TUIChatKit } from "./TUIKit";
import { useCounterStore } from "@/stores/counter";
import { onMounted } from "vue";
const counter = useCounterStore();
TUIChatKit.init();
// #endif
// Required information
@@ -19,27 +19,27 @@ export default {
chatInfo: {},
};
},
onLoad(option) {
AutomaticCleaning()
this.AutomaticCleaning();
uni.getStorage({
key: "userinfo",
success: (res) => {
this.info = res.data;
counter.$patch({ myitem:this.info})
counter.$patch({ myitem: this.info });
},
fail: () => {
},
})
fail: () => {},
});
},
methods: {
//自动清理缓存
AutomaticCleaning(){
const lastCleanTime = uni.getStorageSync('last_clean_time') || 0;
AutomaticCleaning() {
const lastCleanTime = uni.getStorageSync("last_clean_time") || 0;
const now = Date.now();
if (now - lastCleanTime < 7 * 24 * 3600 * 1000) return; // 7 days
uni.clearStorage();
uni.setStorageSync('last_clean_time', now);
}
uni.setStorageSync("last_clean_time", now);
},
},
provide() {
return {