diff --git a/change/@zhishuyun-hub-8ef393bb-8bf8-4e7c-b165-250df21c65ac.json b/change/@zhishuyun-hub-8ef393bb-8bf8-4e7c-b165-250df21c65ac.json
new file mode 100644
index 0000000..84c70db
--- /dev/null
+++ b/change/@zhishuyun-hub-8ef393bb-8bf8-4e7c-b165-250df21c65ac.json
@@ -0,0 +1,7 @@
+{
+ "type": "minor",
+ "comment": "add auth modal",
+ "packageName": "@zhishuyun/hub",
+ "email": "cqc@cuiqingcai.com",
+ "dependentChangeType": "patch"
+}
diff --git a/src/App.vue b/src/App.vue
index c3040eb..3b139f4 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,6 +1,7 @@
+
@@ -9,10 +10,12 @@ import { defineComponent } from 'vue';
import { ElConfigProvider } from 'element-plus';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs';
import { getDomain, getPath, setCookie } from './utils';
+import AuthPanel from './components/common/AuthPanel.vue';
export default defineComponent({
components: {
- ElConfigProvider
+ ElConfigProvider,
+ AuthPanel
},
data() {
return {
diff --git a/src/components/chat/InputBox.vue b/src/components/chat/InputBox.vue
index c9da824..2c7be77 100644
--- a/src/components/chat/InputBox.vue
+++ b/src/components/chat/InputBox.vue
@@ -184,7 +184,7 @@ export default defineComponent({
}
.btn {
display: block;
- z-index: 10000;
+ z-index: 100;
cursor: pointer;
position: absolute;
top: 7px;
diff --git a/src/components/common/AuthPanel.vue b/src/components/common/AuthPanel.vue
new file mode 100644
index 0000000..f0b6192
--- /dev/null
+++ b/src/components/common/AuthPanel.vue
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/components/common/Navigator.vue b/src/components/common/Navigator.vue
index d254964..6cb4361 100644
--- a/src/components/common/Navigator.vue
+++ b/src/components/common/Navigator.vue
@@ -27,7 +27,7 @@
-
+
@@ -43,7 +43,6 @@ import { defineComponent } from 'vue';
import { ElButton, ElTooltip } from 'element-plus';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import {
- ROUTE_AUTH_LOGIN,
ROUTE_CHAT_CONVERSATION,
ROUTE_CHAT_CONVERSATION_NEW,
ROUTE_CONSOLE_ROOT,
@@ -84,10 +83,14 @@ export default defineComponent({
]
};
},
+ computed: {
+ authenticated() {
+ return !!this.$store.state.token.access;
+ }
+ },
methods: {
onLogout() {
this.$store.dispatch('resetToken');
- this.$router.push({ name: ROUTE_AUTH_LOGIN });
},
onConsole() {
this.$router.push({ name: ROUTE_CONSOLE_ROOT });
diff --git a/src/components/common/SuccessInfo.vue b/src/components/common/SuccessInfo.vue
index b552a9c..6e511fd 100644
--- a/src/components/common/SuccessInfo.vue
+++ b/src/components/common/SuccessInfo.vue
@@ -1,5 +1,5 @@
-
+
@@ -36,12 +36,12 @@ export default defineComponent({
diff --git a/src/i18n/zh/distribution/message.ts b/src/i18n/zh/distribution/message.ts
index 74601b4..1db315f 100644
--- a/src/i18n/zh/distribution/message.ts
+++ b/src/i18n/zh/distribution/message.ts
@@ -1,6 +1,6 @@
export default {
deltaPriceForNextLevel: '距离下一级别还差',
- howToWithdrawal: '请添加客服处理提现,提现需扣除 5% 的所得税,提供发票可进行抵扣',
+ howToWithdrawal: '请添加客服处理提现,提现需扣除 6% 的所得税,提供发票可进行抵扣',
technicalDetail: '技术细节',
distributionQrDescription: '分销二维码(内容同链接)',
distributionDescription:
diff --git a/src/layouts/Console.vue b/src/layouts/Console.vue
index 0bbbed1..95e41aa 100644
--- a/src/layouts/Console.vue
+++ b/src/layouts/Console.vue
@@ -58,6 +58,9 @@ export default defineComponent({
display: flex;
flex-direction: row;
}
+ .menu {
+ display: none;
+ }
}
@media screen and (max-width: 767px) {
@@ -76,7 +79,7 @@ export default defineComponent({
position: fixed;
right: 20px;
top: 20px;
- z-index: 1000;
+ z-index: 100;
}
}
diff --git a/src/operators/instance.ts b/src/operators/instance.ts
index 237b975..9a31522 100644
--- a/src/operators/instance.ts
+++ b/src/operators/instance.ts
@@ -33,12 +33,12 @@ httpClient.interceptors.response.use(
(error) => {
if (error?.response?.status === 401) {
store.dispatch('resetToken');
- router.push({
- name: ROUTE_AUTH_LOGIN,
- query: {
- redirect: router?.currentRoute?.value?.path
- }
- });
+ // router.push({
+ // name: ROUTE_AUTH_LOGIN,
+ // query: {
+ // redirect: router?.currentRoute?.value?.path
+ // }
+ // });
}
return Promise.reject(error);
}
diff --git a/src/pages/auth/Callback.vue b/src/pages/auth/Callback.vue
index f0b9ddd..f5b58e7 100644
--- a/src/pages/auth/Callback.vue
+++ b/src/pages/auth/Callback.vue
@@ -30,7 +30,7 @@ export default defineComponent({
this.accessToken = data.access;
this.refreshToken = data.refresh;
} else {
- this.$router.push({ name: ROUTE_AUTH_LOGIN });
+ this.$store.dispatch('resetToken');
return;
}
// if token acquired, get user info
@@ -41,7 +41,7 @@ export default defineComponent({
await this.$router.push(this.redirect);
}
} else {
- await this.$router.push({ name: ROUTE_AUTH_LOGIN });
+ this.$store.dispatch('resetToken');
}
}
});
diff --git a/src/pages/console/distribution/Index.vue b/src/pages/console/distribution/Index.vue
index 5f9b391..1f4c3b2 100644
--- a/src/pages/console/distribution/Index.vue
+++ b/src/pages/console/distribution/Index.vue
@@ -250,8 +250,7 @@ export default defineComponent({
},
distributionLink() {
const origin = window.location.origin;
- const newOrigin = origin.replace('hub.', 'auth.');
- return `${newOrigin}/auth/login?inviter_id=${this.$store.getters.user.id}&redirect=${origin}`;
+ return `${origin}?inviter_id=${this.$store.getters.user.id}`;
}
},
watch: {