Commit 05a344a5 authored by chenqikuai's avatar chenqikuai

fix: 版本管理,清除数据库

parent 73bc2377
......@@ -202,7 +202,6 @@ export default defineComponent({
watch(
() => route.path,
(n) => {
console.log(n);
const result = checkRoute(n);
// console.log(result, " result");
new Bridge().bridge_quitApp(result);
......
......@@ -14,17 +14,20 @@ export const getVersionGroup = (version: string) => {
return version.split(".").map((i) => Number(i));
};
export const checkVersionAndDoSomething = () => {
export const checkVersionAndDoSomething = async () => {
const oldVersion = get_version();
const currentVersion = APPVERSION;
set_version();
console.log("version:", currentVersion);
if (
oldVersion ||
(oldVersion && compareVersion(oldVersion, "0.4.2") === -1)
) {
Dexie.delete("MyAppDatabase");
if (!oldVersion || compareVersion(oldVersion, "0.4.2") === -1) {
return Dexie.delete("MyAppDatabase")
.then((r) => {
console.log(r, "success");
})
.catch((f) => {
console.log(f, "faill");
});
}
};
......
......@@ -33,6 +33,9 @@ import "@quasar/extras/eva-icons/eva-icons.css";
import longPress from "@/plugins/longPress";
import { format } from "@/utils/time";
import { checkVersionAndDoSomething } from "./config/app";
checkVersionAndDoSomething();
(function () {
if (process.env.VUE_APP_MODE === "DEV") {
// eslint-disable-next-line no-var
......@@ -45,8 +48,6 @@ import { checkVersionAndDoSomething } from "./config/app";
}
})();
checkVersionAndDoSomething();
const app = createApp(App);
app.config.globalProperties.$format = format;
......
......@@ -19,7 +19,6 @@ export function getTargetIdFromDisplayMsg(msg: DisplayMessage) {
}
export async function checkPendingMsgAndSendIt() {
console.log("检查pending的消息,然后发送");
const addr = getUserMsg()?.userInfo.addr;
if (addr) {
const pendingMessageList =
......
......@@ -85,7 +85,6 @@ const renderList = async () => {
getFromId() as string
);
console.log(list, "show list");
cardList.value = list;
const reqlist = list.map((i) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment