mirror of
https://github.com/ZeroCatDev/Classworks.git
synced 2025-12-07 21:13: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"
|
node-version: "20.x"
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
|
env:
|
||||||
|
VITE_APP_ID: d158067f53627d2b98babe8bffd2fd7d
|
||||||
|
VITE_DEFAULT_KV_SERVER: https://kv.wuyuan.dev
|
||||||
|
VITE_DEFAULT_AUTH_SERVER: https://kv.houlang.cloud
|
||||||
run: |
|
run: |
|
||||||
npm install
|
npm install
|
||||||
npm run build
|
npm run build
|
||||||
|
|||||||
@ -74,7 +74,7 @@
|
|||||||
<br/><br/>Classworks KV 的全域管理员是 <a href="https://wuyuan.dev" target="_blank">孙悟元</a></v-card-text
|
<br/><br/>Classworks KV 的全域管理员是 <a href="https://wuyuan.dev" target="_blank">孙悟元</a></v-card-text
|
||||||
><v-card-actions
|
><v-card-actions
|
||||||
><v-btn
|
><v-btn
|
||||||
href="https://kv.houlang.cloud"
|
:href="defaultAuthServer"
|
||||||
class="text-none"
|
class="text-none"
|
||||||
append-icon="mdi-open-in-new"
|
append-icon="mdi-open-in-new"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@ -130,7 +130,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { kvServerProvider } from "@/utils/providers/kvServerProvider";
|
import { kvServerProvider } from "@/utils/providers/kvServerProvider";
|
||||||
import { setSetting } from "@/utils/settings";
|
import { setSetting, getSetting } from "@/utils/settings";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "CloudNamespaceInfoCard",
|
name: "CloudNamespaceInfoCard",
|
||||||
@ -146,6 +146,7 @@ export default {
|
|||||||
loading: false,
|
loading: false,
|
||||||
hasNamespaceInfo: false,
|
hasNamespaceInfo: false,
|
||||||
showReinitDialog: false, // 确认对话框显示状态
|
showReinitDialog: false, // 确认对话框显示状态
|
||||||
|
defaultAuthServer: getSetting('server.authDomain'),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
icon="mdi-menu"
|
icon="mdi-menu"
|
||||||
variant="text"
|
variant="text"
|
||||||
@click="drawer = !drawer"
|
@click="drawer = !drawer"
|
||||||
class="d-md-none"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<v-app-bar-title class="text-h6">设置</v-app-bar-title>
|
<v-app-bar-title class="text-h6">设置</v-app-bar-title>
|
||||||
|
|||||||
@ -183,7 +183,7 @@ export default {
|
|||||||
if (autoConfigureCloud) {
|
if (autoConfigureCloud) {
|
||||||
// 使用classworksCloudDefaults配置
|
// 使用classworksCloudDefaults配置
|
||||||
const classworksCloudDefaults = {
|
const classworksCloudDefaults = {
|
||||||
"server.domain": "https://kv.wuyuan.dev",
|
"server.domain": import.meta.env.VITE_DEFAULT_KV_SERVER || "https://kv.wuyuan.dev",
|
||||||
"server.siteKey": "",
|
"server.siteKey": "",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -68,7 +68,7 @@ const SETTINGS_STORAGE_KEY = "Classworks_settings";
|
|||||||
|
|
||||||
// 新增: Classworks云端存储的默认设置
|
// 新增: Classworks云端存储的默认设置
|
||||||
const classworksCloudDefaults = {
|
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.domain": "http://localhost:3030",
|
||||||
"server.siteKey": "",
|
"server.siteKey": "",
|
||||||
};
|
};
|
||||||
@ -206,7 +206,7 @@ const settingsDefinitions = {
|
|||||||
},
|
},
|
||||||
"server.authDomain": {
|
"server.authDomain": {
|
||||||
type: "string",
|
type: "string",
|
||||||
default: "https://kv.houlang.cloud",
|
default: import.meta.env.VITE_DEFAULT_AUTH_SERVER || "https://kv.houlang.cloud",
|
||||||
description: "授权服务器域名",
|
description: "授权服务器域名",
|
||||||
icon: "mdi-shield-account",
|
icon: "mdi-shield-account",
|
||||||
validate: (value) => {
|
validate: (value) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user