mirror of
https://github.com/ZeroCatDev/Classworks.git
synced 2025-12-07 04:43:11 +00:00
feat: 添加环境变量配置,更新云端存储和授权服务器的默认设置
This commit is contained in:
parent
6bfd5fdf0e
commit
a7ff0e5714
5
.env.example
Normal file
5
.env.example
Normal 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
|
||||
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
@ -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
|
||||
|
||||
@ -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: {
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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": "",
|
||||
};
|
||||
|
||||
|
||||
@ -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) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user