update @优化小问题
This commit is contained in:
parent
2d6112ac3a
commit
41392bfbbe
|
@ -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];
|
||||
|
|
|
@ -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不存在';
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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: {
|
||||
|
|
Loading…
Reference in New Issue