|
|
@@ -94,7 +94,8 @@ import Cookies from "js-cookie";
|
|
|
import { encrypt, decrypt } from '@/utils/jsencrypt'
|
|
|
import WechatLoginDialog from "@/views/WechatLoginDialog.vue";
|
|
|
import { setToken } from "@/utils/auth";
|
|
|
-
|
|
|
+import {getConfigByKey} from "@/api/system/config";
|
|
|
+import Vue from 'vue'
|
|
|
export default {
|
|
|
name: "Login",
|
|
|
components: { WechatLoginDialog },
|
|
|
@@ -154,7 +155,42 @@ export default {
|
|
|
this.getCookie();
|
|
|
},
|
|
|
methods: {
|
|
|
+// 重新加载运行时配置
|
|
|
+ async reloadRuntimeConfig() {
|
|
|
+
|
|
|
+ try {
|
|
|
+ const res = await getConfigByKey('his.adminUi.config')
|
|
|
+
|
|
|
+ const configValue = res?.data?.configValue
|
|
|
+ if (!configValue) return
|
|
|
+
|
|
|
+ // 后端配置 JSON
|
|
|
+ const form = JSON.parse(configValue)
|
|
|
+
|
|
|
+ // 直接更新全局配置
|
|
|
+ const config = {
|
|
|
+ VUE_APP_OBS_ACCESS_KEY_ID: form.obsAccessKeyId || '',
|
|
|
+ VUE_APP_OBS_SECRET_ACCESS_KEY: form.obsSecretAccessKey || '',
|
|
|
+ VUE_APP_OBS_SERVER: form.obsServer || '',
|
|
|
+ VUE_APP_OBS_BUCKET: form.obsBucket || '',
|
|
|
+ VUE_APP_VIDEO_LINE_1: form.videoLinePrimary || '',
|
|
|
+ VUE_APP_VIDEO_LINE_2: form.videoLineSecondary || '',
|
|
|
+ VUE_APP_VIDEO_URL: form.volcanoVideoDomain || '',
|
|
|
+ VUE_APP_HSY_SPACE: form.volcanoVodSpace || '',
|
|
|
+ VUE_APP_LIVE_PATH: form.livePath || '/live',
|
|
|
+ VUE_APP_COS_BUCKET: form.cosBucket || '',
|
|
|
+ VUE_APP_LIVE_WS_URL: form.liveWebSocketUrl || '',
|
|
|
+ VUE_APP_COURSE_DEFAULT: form.courseDefaultType || '1',
|
|
|
+ VUE_APP_COS_REGION: form.cosRegion || ''
|
|
|
+ }
|
|
|
+
|
|
|
+ // 更新到全局
|
|
|
+ Vue.prototype.$runtimeConfig = config
|
|
|
|
|
|
+ } catch (error) {
|
|
|
+ console.error('重新加载运行时配置异常:', error)
|
|
|
+ }
|
|
|
+ },
|
|
|
getCode() {
|
|
|
getCodeImg().then(res => {
|
|
|
this.codeUrl = "data:image/gif;base64," + res.img;
|
|
|
@@ -201,6 +237,8 @@ export default {
|
|
|
} else {
|
|
|
this.$router.push({ path: this.redirect || "/" });
|
|
|
}
|
|
|
+ this.reloadRuntimeConfig()
|
|
|
+
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.loading = false;
|