diff --git a/change/@zhishuyun-hub-3b8e7fee-8ae8-4ea3-aedb-19b2411ab13c.json b/change/@zhishuyun-hub-3b8e7fee-8ae8-4ea3-aedb-19b2411ab13c.json new file mode 100644 index 0000000..4588b1f --- /dev/null +++ b/change/@zhishuyun-hub-3b8e7fee-8ae8-4ea3-aedb-19b2411ab13c.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "add config support global", + "packageName": "@zhishuyun/hub", + "email": "cqc@cuiqingcai.com", + "dependentChangeType": "patch" +} diff --git a/hub.config.js b/hub.config.js new file mode 100644 index 0000000..dcb30b2 --- /dev/null +++ b/hub.config.js @@ -0,0 +1,20 @@ +module.exports = { + site: { + logo: { + url: 'https://hub.zhishuyun.com/assets/logo.da8de841.svg', + width: 'auto', + height: 'auto' + } + }, + apps: { + chat: { + enabled: true + }, + midjourney: { + enabled: true + } + }, + distribution: { + inviterId: '123' + } +}; diff --git a/src/components/common/AuthPanel.vue b/src/components/common/AuthPanel.vue index 06db452..3fa5e0d 100644 --- a/src/components/common/AuthPanel.vue +++ b/src/components/common/AuthPanel.vue @@ -27,7 +27,15 @@ export default defineComponent({ return `${getBaseUrlAuth()}/auth/login?inviter_id=${this.inviterId}`; }, inviterId() { - const result = this.$route.query.inviter_id?.toString() || getCookie('INVITER_ID'); + // if forceInviterId is set, then use forceInviterId + if (this.$config?.distribution?.forceInviterId) { + return this.$config?.distribution?.defaultInviterId; + } + // Otherwise, use the inviter_id in the url, then use the inviter_id in the cookie, and finally use the default inviter_id + const result = + this.$route.query.inviter_id?.toString() || + getCookie('INVITER_ID') || + this.$config?.distribution?.defaultInviterId; return result; }, authenticated() { diff --git a/src/components/common/Chevron.vue b/src/components/common/Chevron.vue new file mode 100644 index 0000000..374131f --- /dev/null +++ b/src/components/common/Chevron.vue @@ -0,0 +1,38 @@ + + + + + diff --git a/src/components/common/Navigator.vue b/src/components/common/Navigator.vue index 58819c7..01e3e27 100644 --- a/src/components/common/Navigator.vue +++ b/src/components/common/Navigator.vue @@ -1,13 +1,26 @@