diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..a5a7217 --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +# Classworks KV 默认服务器域名 +VITE_DEFAULT_KV_SERVER=https://kv.wuyuan.dev + +# Classworks KV 授权服务器域名 +VITE_DEFAULT_AUTH_SERVER=https://kv.houlang.cloud diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4c54ffe..de72770 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -32,6 +32,10 @@ jobs: node-version: "20.x" - name: Build + env: + VITE_APP_ID: d158067f53627d2b98babe8bffd2fd7d + VITE_DEFAULT_KV_SERVER: https://kv.wuyuan.dev + VITE_DEFAULT_AUTH_SERVER: https://kv.houlang.cloud run: | npm install npm run build diff --git a/src/components/settings/cards/CloudNamespaceInfoCard.vue b/src/components/settings/cards/CloudNamespaceInfoCard.vue index 2089ac5..a9ff2f2 100644 --- a/src/components/settings/cards/CloudNamespaceInfoCard.vue +++ b/src/components/settings/cards/CloudNamespaceInfoCard.vue @@ -74,7 +74,7 @@

Classworks KV 的全域管理员是 孙悟元 import { kvServerProvider } from "@/utils/providers/kvServerProvider"; -import { setSetting } from "@/utils/settings"; +import { setSetting, getSetting } from "@/utils/settings"; export default { name: "CloudNamespaceInfoCard", @@ -146,6 +146,7 @@ export default { loading: false, hasNamespaceInfo: false, showReinitDialog: false, // 确认对话框显示状态 + defaultAuthServer: getSetting('server.authDomain'), }; }, watch: { diff --git a/src/pages/settings.vue b/src/pages/settings.vue index cc6654a..a6aa3bf 100644 --- a/src/pages/settings.vue +++ b/src/pages/settings.vue @@ -11,7 +11,7 @@ icon="mdi-menu" variant="text" @click="drawer = !drawer" - class="d-md-none" + /> 设置 diff --git a/src/utils/dataProvider.js b/src/utils/dataProvider.js index 31813e2..508f397 100644 --- a/src/utils/dataProvider.js +++ b/src/utils/dataProvider.js @@ -183,7 +183,7 @@ export default { if (autoConfigureCloud) { // 使用classworksCloudDefaults配置 const classworksCloudDefaults = { - "server.domain": "https://kv.wuyuan.dev", + "server.domain": import.meta.env.VITE_DEFAULT_KV_SERVER || "https://kv.wuyuan.dev", "server.siteKey": "", }; diff --git a/src/utils/settings.js b/src/utils/settings.js index 6e496f0..14195cf 100644 --- a/src/utils/settings.js +++ b/src/utils/settings.js @@ -68,7 +68,7 @@ const SETTINGS_STORAGE_KEY = "Classworks_settings"; // 新增: Classworks云端存储的默认设置 const classworksCloudDefaults = { - "server.domain": "https://kv.wuyuan.dev", + "server.domain": import.meta.env.VITE_DEFAULT_KV_SERVER || "https://kv.wuyuan.dev", //"server.domain": "http://localhost:3030", "server.siteKey": "", }; @@ -206,7 +206,7 @@ const settingsDefinitions = { }, "server.authDomain": { type: "string", - default: "https://kv.houlang.cloud", + default: import.meta.env.VITE_DEFAULT_AUTH_SERVER || "https://kv.houlang.cloud", description: "授权服务器域名", icon: "mdi-shield-account", validate: (value) => {