From 3c1061b55683f3b6ff10dc8259c0b0179e2846e2 Mon Sep 17 00:00:00 2001 From: qx <1084500556@qq.com> Date: 星期二, 22 七月 2025 16:58:44 +0800 Subject: [PATCH] Merge branch 'master' of http://101.42.27.146:5001/r/ltkj_peisweb_region --- src/views/login.vue | 42 ++++++++++++++++++++++++++++++++++-------- 1 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/views/login.vue b/src/views/login.vue index 559e1a0..bf40696 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -1,7 +1,7 @@ <template> <div class="login"> <!-- <div style="padding-top: 130px;"> --> - <div style="font-weight: 700;font-size: 50px;">鏅鸿兘鍋ュ悍浣撴绠$悊绯荤粺</div> + <div style="font-weight: 700;font-size: 50px;">鏅鸿兘鍋ュ悍浣撴绠$悊绯荤粺</div> <!-- </div> --> @@ -58,17 +58,19 @@ <!-- 搴曢儴 --> <div class="el-login-footer"> - <span>Copyright 漏 2023-2024 All Rights Reserved.</span> + <span>Copyright 漏 2024-2025 All Rights Reserved.</span> <!-- <span>Copyright 漏 2022-2023榫欑編缃戠粶 All Rights Reserved.</span> --> </div> </div> </template> <script> + import { getCodeImg, getconfigKey } from "@/api/login"; import Cookies from "js-cookie"; import { encrypt, decrypt } from '@/utils/jsencrypt' - +import ini from 'ini'; +import fs from 'fs'; // Node.js 鏂囦欢绯荤粺妯″潡 export default { name: "Login", data() { @@ -78,7 +80,7 @@ username: "", password: "", mobile: false, - hospId:"", + hospId: "", // username:"13800138008", // password:"888888", rememberMe: false, @@ -151,11 +153,34 @@ }) }, - loadAll(){ - this.loginForm.hospId = this.$route.query.hospId - Cookies.set("hospId", this.loginForm.hospId); - }, + loadAll() { + const env = process.env.VUE_APP_ENV; + const port = window.location.port; + // yuanqu.ini鍔犺浇hospId + fetch('/yuanqu.ini') + .then(response => { + if (!response.ok) { + throw new Error('Failed to fetch config.ini'); + } + return response.text(); + }) + .then(text => { + const config = ini.parse(text); + + if (config[env] && config[env][port]) { + this.loginForm.hospId = config[env][port]; + Cookies.set("hospId", this.loginForm.hospId); + } else { + console.error(`No hospId found for environment ${env} and port ${port}`); + this.$message.error(`閰嶇疆閿欒锛氭湭鎵惧埌鐜 ${env} 鍜岀鍙� ${port} 瀵瑰簲鐨勫尰闄D`); + } + }) + .catch(error => { + console.error('Error fetching or parsing config.ini:', error); + this.$message.error('鏃犳硶鍔犺浇閰嶇疆鏂囦欢锛岃鑱旂郴绠$悊鍛�'); + }); + }, hide() { // this.loginForm.username = "10001"; // this.loginForm.password = "admin123"; @@ -239,6 +264,7 @@ } } this.$router.push({ path: this.redirect || "/" }).catch(() => { }); + location.reload(); } }).catch(() => { -- Gitblit v1.8.0