diff --git a/package.json b/package.json
index 64d8332..09e004f 100644
--- a/package.json
+++ b/package.json
@@ -60,6 +60,7 @@
"lodash-es": "^4.17.21",
"pinia": "^2.0.35",
"qs": "^6.11.1",
+ "uni-read-pages-vite": "^0.0.5",
"vue": "^3.2.47"
},
"devDependencies": {
@@ -87,6 +88,7 @@
"prettier": "^2.8.8",
"sass": "^1.62.1",
"typescript": "^5.0.4",
+ "uni-mini-router": "^0.0.7",
"unocss": "^0.46.5",
"unocss-preset-weapp": "^0.2.5",
"vite": "^4.3.2",
diff --git a/src/App.vue b/src/App.vue
index 1ae0729..610e6eb 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,15 +1,8 @@
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 6e9a83c..cd7cb61 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -2,7 +2,7 @@
import { ref } from 'vue';
import BasicButton from '@/components/BasicButton/index.vue';
import AppProvider from '@/components/AppProvider/inedx.vue';
-import { useRouter } from '@/hooks/router';
+import { useRouter } from 'uni-mini-router';
import { CURRENT_PLATFORM, PLATFORMS } from '@/enums/platformEnum';
import { judgePlatform } from '@/utils/platform';
import Iconify from '@/components/Iconify/index.vue';
@@ -18,8 +18,7 @@ const isVue3 = judgePlatform(PLATFORMS.VUE3);
const router = useRouter();
const handleGetStarted = () => {
- router.pushTab('/pages/demo/index');
- // router.push('/pages/log/index?id=4345&title=log');
+ router.pushTab({ path: '/pages/demo/index' });
};
diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue
index ee8e084..21ad218 100644
--- a/src/pages/login/index.vue
+++ b/src/pages/login/index.vue
@@ -3,7 +3,7 @@ import { reactive, ref } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { useAuthStore } from '@/state/modules/auth';
import { Toast } from '@/utils/uniapi/prompt';
-import { useRouter } from '@/hooks/router';
+import { useRouter } from 'uni-mini-router';
import { useRequest } from 'alova';
import { login } from '@/services/api/auth';
@@ -25,11 +25,11 @@ const submit = (e: any) => {
Toast('登录成功', { duration: 1500 });
authStore.setToken(res.token);
setTimeout(() => {
- if (redirect.value) {
- router.go(redirect.value!, { replace: true });
- return;
- }
- router.pushTab('/pages/about/index');
+ // if (redirect.value) {
+ // router.push(redirect.value!, { replace: true });
+ // return;
+ // }
+ router.replaceAll({ name: 'Home' });
}, 1500);
});
};
diff --git a/src/pages/notFound/404.vue b/src/pages/notFound/404.vue
index c66df18..aa1909c 100644
--- a/src/pages/notFound/404.vue
+++ b/src/pages/notFound/404.vue
@@ -2,14 +2,14 @@
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';
import BasicButton from '@/components/BasicButton/index.vue';
-import { useRouter } from '@/hooks/router';
+import { useRouter } from 'uni-mini-router';
const go = ref('');
const router = useRouter();
const redirect = ref('');
onLoad((query) => {
- go.value = query.go || '';
- redirect.value = query.redirect || '';
+ go.value = query?.go || '';
+ redirect.value = query?.redirect || '';
});
/**
diff --git a/src/pagesA/list/test1/index.vue b/src/pagesA/list/test1/index.vue
index bcaa727..ad87a28 100644
--- a/src/pagesA/list/test1/index.vue
+++ b/src/pagesA/list/test1/index.vue
@@ -1,6 +1,6 @@