update @优化小问题

This commit is contained in:
huangzhen 2024-09-11 20:43:07 +08:00
parent 2d6112ac3a
commit 41392bfbbe
4 changed files with 6 additions and 18 deletions

View File

@ -6,19 +6,6 @@ import {
// 公共路由
const routePublic = [
// {
// path: "/",
// redirect: { name: 'home', params: { key: 'default_key' } }
// },
// {
// path: "/:key",
// redirect: { name: 'home' }
// },
// {
// path: "/home/:key",
// name: "home",
// component: () => import("../views/home.vue"),
// },
{
path: "/",
redirect: "/home",
@ -78,9 +65,9 @@ const router = createRouter({
router.beforeEach(async (to, from, next) => {
const rouList = routes.filter(
(item) => item.path != "/" && item.path === to.fullPath
(item) => item.path !== "/" && item.path === to.path
);
if (from.fullPath === "/" && rouList.length === 0) {
if (from.path === "/" && rouList.length === 0) {
const url = window.location.href;
const str = url.split("/");
const strP = str[str.length - 1];

View File

@ -12,7 +12,7 @@ export default {
name: 'home',
data() {
return {
key: this.$route.params.key || this.$route.query.key || localStorage.getItem('key'),
key: localStorage.getItem('key'),
loginBack: this.$route.query.loginBack,
// jumpPath: this.$route.query.jumpPath,
openid: this.$route.query.openid || localStorage.getItem("openid"), // id
@ -23,7 +23,7 @@ export default {
}
},
created() {
if (!this.key || this.key === 'default_key') {
if (!this.key) {
this.loginBack = '';
this.dialogType = 'error';
return this.dialogText = 'key不存在';

View File

@ -253,6 +253,7 @@ export default {
async getData(type?: string) {
this.overlayLoad = false;
this.loadingStatus = true;
if (!this.groupId) return showToast('组合商品ID不能为空');
this.pageData = new Map([['31', []], ['32', []], ['33', []], ['2', []], ['1', []]]);
const res = await QUERY({
key: this.key,

View File

@ -112,7 +112,7 @@ export default {
// modules: [ Pagination, Autoplay ],
initialSlide: 1,
key: this.$route.query.key || localStorage.getItem('key'),
jumpPath: sessionStorage.getItem('jumpPath'),
// jumpPath: sessionStorage.getItem('jumpPath'),
loadingStatus: false,
pageData: null,
cssData: {