This commit is contained in:
pengxiaolong
2025-07-14 13:30:18 +08:00
parent f324bf3bc7
commit 6dec463705
24 changed files with 193 additions and 147 deletions

20
App.vue
View File

@@ -1,9 +1,6 @@
<script lang="ts">
// #ifdef APP-PLUS || H5
import { TUIChatKit } from "./TUIKit";
import { useCounterStore } from "@/stores/counter";
import { onMounted } from "vue";
const counter = useCounterStore();
TUIChatKit.init();
// #endif
// Required information
@@ -20,25 +17,8 @@ export default {
};
},
onLoad(option) {
this.AutomaticCleaning();
uni.getStorage({
key: "userinfo",
success: (res) => {
this.info = res.data;
counter.$patch({ myitem: this.info });
},
fail: () => {},
});
},
methods: {
//自动清理缓存
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);
},
},
provide() {
return {