diff --git a/README.md b/README.md index 60d30ad..a55ca49 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,15 @@ this.$store.commit('setToken') this.$store.commit('setLoginOut') // 获取登录的用户信息 this.$store.state.userInfo -// 是否需要登录拦截 -this.$isLoginValidate(); + +// 登录拦截 +// 示例:点击购买课程前需要判断当前用户是否登录 +function onPurchaseCourse() { + if (!this.$isLoginValidate()) { + return; + } + // 此处省略其他业务代码... +} + ``` diff --git a/components/BsLogin.vue b/components/BsLogin.vue index 18896fc..04f2469 100644 --- a/components/BsLogin.vue +++ b/components/BsLogin.vue @@ -147,7 +147,11 @@ export default { Message.error("请勾选同意《用户协议》和《隐私协议》"); return; } - const { result } = await ApiPostLogin({ ...this.form }); + const { result } = await ApiPostLogin({ + ...this.form, + clientId: 1, + systemId: 1, + }); if (result) { this.dialogTableVisible = false; this.$store.commit("setToken", result.token); diff --git a/layouts/module/header/HeaderInfoBar.vue b/layouts/module/header/HeaderInfoBar.vue index a62300b..aef98a2 100644 --- a/layouts/module/header/HeaderInfoBar.vue +++ b/layouts/module/header/HeaderInfoBar.vue @@ -6,33 +6,42 @@
- + + {{ item.label }} +
diff --git a/layouts/module/header/index.vue b/layouts/module/header/index.vue index f4a15e8..fe91d01 100644 --- a/layouts/module/header/index.vue +++ b/layouts/module/header/index.vue @@ -81,7 +81,7 @@
@@ -178,7 +178,7 @@ export default { if (resultGoods && resultGoods.length > 0) { return { ...item, - list: resultGoods.data, + list: resultGoods, }; } }) @@ -291,6 +291,7 @@ export default { background: linear-gradient(270deg, #ffa25a 0%, #ff7f39 100%); border-radius: 0px 8px 8px 0px; z-index: 2; + cursor: pointer; img { width: 26px; height: 26px; @@ -373,13 +374,11 @@ export default { box-shadow: 7px 0px 10px 1px rgba(0, 0, 0, 0.10000000149011612); border: 1px solid #eeeeee; background: #ffffff; - .menu-right__item:last-child { - margin-bottom: 0; - } .menu-right__item:hover { color: #ff875b; } .menu-right__item { + display: inline-block; font-size: 12px; color: #999999; margin-right: 20px; diff --git a/pages/index/index.vue b/pages/index/index.vue index 2ddace0..6a4e2d6 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -17,8 +17,5 @@ import Banner from "./module/Banner.vue"; import Seckil from "./module/Seckill.vue"; export default { components: { Banner, Seckil }, - mounted() { - this.$isLoginValidate(); - }, };