1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2025-12-07 04:43:11 +00:00

feat: 添加环境变量配置,更新云端存储和授权服务器的默认设置

This commit is contained in:
SunWuyuan 2025-11-01 21:08:41 +08:00
parent 6bfd5fdf0e
commit a7ff0e5714
No known key found for this signature in database
GPG Key ID: A6A54CF66F56BB64
6 changed files with 16 additions and 6 deletions

5
.env.example Normal file
View File

@ -0,0 +1,5 @@
# Classworks KV 默认服务器域名
VITE_DEFAULT_KV_SERVER=https://kv.wuyuan.dev
# Classworks KV 授权服务器域名
VITE_DEFAULT_AUTH_SERVER=https://kv.houlang.cloud

View File

@ -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

View File

@ -74,7 +74,7 @@
<br/><br/>Classworks KV 的全域管理员是 <a href="https://wuyuan.dev" target="_blank">孙悟元</a></v-card-text
><v-card-actions
><v-btn
href="https://kv.houlang.cloud"
:href="defaultAuthServer"
class="text-none"
append-icon="mdi-open-in-new"
target="_blank"
@ -130,7 +130,7 @@
<script>
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: {

View File

@ -11,7 +11,7 @@
icon="mdi-menu"
variant="text"
@click="drawer = !drawer"
class="d-md-none"
/>
</template>
<v-app-bar-title class="text-h6">设置</v-app-bar-title>

View File

@ -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": "",
};

View File

@ -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) => {