hzj18279462576@163.com 3 месяцев назад
Родитель
Сommit
88f0392d48

+ 2 - 2
.env.development

@@ -1,2 +1,2 @@
-# 开发环境配置
-VITE_API_BASE_URL = 'http://localhost:8080'
+# .env.development(开发环境,新建这个文件)
+VITE_BASE_API=/api  # 本地代理别名,仅用于开发

+ 2 - 0
.env.production

@@ -0,0 +1,2 @@
+# .env.production(生产环境)
+VITE_BASE_API=https://chtech.ncjti.edu.cn/alumnus/alumni_testapi/alumni  # 生产直连地址

+ 54 - 4
package-lock.json

@@ -16,6 +16,7 @@
         "jsencrypt": "^3.3.2",
         "nprogress": "^0.2.0",
         "pinia": "^3.0.2",
+        "terser": "^5.46.1",
         "v-viewer": "^3.0.11",
         "vue": "^3.5.13",
         "vue-img-cutter": "^3.0.7",
@@ -565,7 +566,6 @@
       "version": "0.3.13",
       "resolved": "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
       "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
-      "dev": true,
       "dependencies": {
         "@jridgewell/sourcemap-codec": "^1.5.0",
         "@jridgewell/trace-mapping": "^0.3.24"
@@ -585,11 +585,19 @@
       "version": "3.1.2",
       "resolved": "https://registry.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
       "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
-      "dev": true,
       "engines": {
         "node": ">=6.0.0"
       }
     },
+    "node_modules/@jridgewell/source-map": {
+      "version": "0.3.11",
+      "resolved": "https://registry.npmmirror.com/@jridgewell/source-map/-/source-map-0.3.11.tgz",
+      "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==",
+      "dependencies": {
+        "@jridgewell/gen-mapping": "^0.3.5",
+        "@jridgewell/trace-mapping": "^0.3.25"
+      }
+    },
     "node_modules/@jridgewell/sourcemap-codec": {
       "version": "1.5.5",
       "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
@@ -599,7 +607,6 @@
       "version": "0.3.31",
       "resolved": "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
       "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
-      "dev": true,
       "dependencies": {
         "@jridgewell/resolve-uri": "^3.1.0",
         "@jridgewell/sourcemap-codec": "^1.4.14"
@@ -1637,7 +1644,6 @@
       "version": "8.15.0",
       "resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.15.0.tgz",
       "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
-      "dev": true,
       "bin": {
         "acorn": "bin/acorn"
       },
@@ -1860,6 +1866,11 @@
         "node": ">=8"
       }
     },
+    "node_modules/buffer-from": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmmirror.com/buffer-from/-/buffer-from-1.1.2.tgz",
+      "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
+    },
     "node_modules/cache-base": {
       "version": "1.0.1",
       "resolved": "https://registry.npmmirror.com/cache-base/-/cache-base-1.0.1.tgz",
@@ -5449,6 +5460,23 @@
         "urix": "^0.1.0"
       }
     },
+    "node_modules/source-map-support": {
+      "version": "0.5.21",
+      "resolved": "https://registry.npmmirror.com/source-map-support/-/source-map-support-0.5.21.tgz",
+      "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
+      "dependencies": {
+        "buffer-from": "^1.0.0",
+        "source-map": "^0.6.0"
+      }
+    },
+    "node_modules/source-map-support/node_modules/source-map": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz",
+      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
     "node_modules/source-map-url": {
       "version": "0.4.1",
       "resolved": "https://registry.npmmirror.com/source-map-url/-/source-map-url-0.4.1.tgz",
@@ -5813,6 +5841,28 @@
         "node": ">=10.13.0"
       }
     },
+    "node_modules/terser": {
+      "version": "5.46.1",
+      "resolved": "https://registry.npmmirror.com/terser/-/terser-5.46.1.tgz",
+      "integrity": "sha512-vzCjQO/rgUuK9sf8VJZvjqiqiHFaZLnOiimmUuOKODxWL8mm/xua7viT7aqX7dgPY60otQjUotzFMmCB4VdmqQ==",
+      "dependencies": {
+        "@jridgewell/source-map": "^0.3.3",
+        "acorn": "^8.15.0",
+        "commander": "^2.20.0",
+        "source-map-support": "~0.5.20"
+      },
+      "bin": {
+        "terser": "bin/terser"
+      },
+      "engines": {
+        "node": ">=10"
+      }
+    },
+    "node_modules/terser/node_modules/commander": {
+      "version": "2.20.3",
+      "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz",
+      "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
+    },
     "node_modules/tiny-warning": {
       "version": "1.0.3",
       "resolved": "https://registry.npmmirror.com/tiny-warning/-/tiny-warning-1.0.3.tgz",

+ 1 - 0
package.json

@@ -17,6 +17,7 @@
     "jsencrypt": "^3.3.2",
     "nprogress": "^0.2.0",
     "pinia": "^3.0.2",
+    "terser": "^5.46.1",
     "v-viewer": "^3.0.11",
     "vue": "^3.5.13",
     "vue-img-cutter": "^3.0.7",

BIN
src/assets/img/login_txt2.png


+ 6 - 2
src/router/index.js

@@ -1,5 +1,5 @@
 // src/router/index.ts
-import { createRouter, createWebHistory } from "vue-router";
+import { createRouter, createWebHistory,createWebHashHistory } from "vue-router";
 import NProgress from "nprogress";
 import "nprogress/nprogress.css"; // 引入 NProgress 的 CSS 样式文件
 import { ElMessage } from "element-plus";
@@ -106,8 +106,12 @@ const routes = [
     redirect: "/404",
   },
 ];
+
+const basePath = import.meta.env.VITE_APP_BASE || '/'
+
 const router = createRouter({
-  history: createWebHistory(),
+  // history: createWebHistory(basePath),
+  history: createWebHashHistory(basePath),
   routes,
 });
 

+ 2 - 2
src/utils/request.js

@@ -5,7 +5,7 @@ import router from "@/router/index";
 // 创建 axios 实例
 const service = axios.create({
   // 基础路径,对应后端接口前缀(根据你的项目修改)
-  // baseURL: import.meta.env.VITE_API_BASE_URL,
+  baseURL:import.meta.env.VITE_BASE_API,
   // 请求超时时间
   timeout: 10000,
 });
@@ -58,7 +58,7 @@ service.interceptors.response.use(
       case 401:
         // 401:Token 过期/无效 → 提示用户,清除 Token,跳登录页
         msg = "登录已过期,请重新登录";
-        localStorage.removeItem("token");
+        sessionStorage.removeItem("token");
         router.push("/login");
         break;
       case 403:

+ 163 - 171
src/views/login/login copy.vue

@@ -1,6 +1,6 @@
+<!-- views/login/Login.vue -->
 <template>
   <div class="box">
-    <!-- <div class="middle"></div> -->
     <div class="left">
       <div class="loginForm">
         <div
@@ -8,27 +8,44 @@
             display: flex;
             flex-direction: column;
             align-items: center;
-            justify-content: center;
-            margin-top: 104px;
-            margin-bottom: 61px;
+            /* justify-content: center; */
+            margin-top: 90px;
+            margin-bottom: 20px;
           "
         >
-          <img
-            src="@/assets/img/logo.png"
-            alt=""
-            style="width: 95px; height: 95px; margin-bottom: 15px"
-          />
-          <div
+          <span
             style="
-              font-size: 30px;
+              font-size: 20px;
+              letter-spacing: 0px;
+              color: rgba(0, 0, 0, 0.6);
+              width: 420px;
+            "
+            >WELCOME</span
+          >
+          <span
+            style="
+              font-size: 45px;
+              font-weight: 600;
+              width: 420px;
+              letter-spacing: 0px;
+              color: rgba(0, 0, 0, 1);
+            "
+            >欢迎登录</span
+          >
+          <span
+            style="
+              font-size: 45px;
               font-weight: 600;
+              width: 420px;
               letter-spacing: 0px;
               color: rgba(0, 0, 0, 1);
             "
+            >校友信息管理系统</span
           >
-            迎新系统管理平台
-          </div>
+          <!-- <img src="@/assets/svgs/vue.svg" class="logo vue" alt="Vue logo" />
+          <SvgIcon name="vue" color="#000" size="22"></SvgIcon> -->
         </div>
+
         <el-form
           ref="ruleFormRef"
           :model="ruleForm"
@@ -39,59 +56,80 @@
         >
           <el-form-item label="" prop="user">
             <el-input
-              :prefix-icon="User"
               v-model="ruleForm.user"
               placeholder="请输入登录名"
               autocomplete="off"
-            />
+            >
+              <template #prefix>
+                <el-icon class="el-input__icon"
+                  ><img
+                    style="width: 24px; height: 24px"
+                    src="@/assets/img/login_user.png"
+                    alt=""
+                /></el-icon>
+              </template>
+            </el-input>
           </el-form-item>
           <el-form-item label="" prop="pass">
             <el-input
-              :prefix-icon="Lock"
               show-password
               v-model="ruleForm.pass"
               type="password"
               autocomplete="off"
               placeholder="请输入登录密码"
-            />
+            >
+              <template #prefix>
+                <el-icon class="el-input__icon"
+                  ><img
+                    style="width: 24px; height: 24px"
+                    src="@/assets/img/login_pass.png"
+                    alt=""
+                /></el-icon>
+              </template>
+            </el-input>
           </el-form-item>
-          <el-checkbox v-model="checked" class="remeberPwd el-form-item"
-            >记住密码</el-checkbox
-          >
           <el-form-item>
             <el-button
               :loading="loading"
               type="primary"
               @click="submitForm(ruleFormRef)"
+              color="#0095ff"
               >登录</el-button
             >
           </el-form-item>
         </el-form>
       </div>
-      <div class="rLogin">
-        <img src="@/assets/img/login3.png" alt="" />
-      </div>
+      <div class="rLogin"></div>
     </div>
   </div>
+  <div class="login_logo"></div>
+  <div class="login_txt"></div>
 </template>
 
 <script setup>
 import { ref, reactive, onMounted, onUnmounted } from "vue";
 import { User, Lock } from "@element-plus/icons-vue";
 import { useRouter } from "vue-router";
-import { ElMessage } from "element-plus";
-import { JSEncrypt } from "jsencrypt"; // 加密密码
-import { https } from "@/utils/request"; // 接口请求封装
+import { ElMessage, ElNotification } from "element-plus";
+
+import { storeToRefs } from "pinia";
 import { useCounterStore } from "@/stores/index";
+import { login, queryUserRole } from "@/api/login";
 
+const router = useRouter();
 const store = useCounterStore();
+const { roleList } = storeToRefs(store);
+
+const loginFlag = ref(true);
 
-const router = useRouter();
 const loading = ref(false);
 const ruleFormRef = ref();
 const ruleForm = reactive({
-  user: "",
-  pass: "",
+  user: "superAdmin",
+  pass: "Ncjti32003",
+  // user: "",
+  // pass: "",
+  role: "",
 });
 const checked = ref(false); // 记住密码
 
@@ -104,46 +142,53 @@ const submitForm = (formEl) => {
   if (!formEl) return;
   formEl.validate(async (valid) => {
     if (valid) {
-      loading.value = true;
-      // let publicKey =
-      //   "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMOcPB06u5yKyQsPjfVWiWgbEIrd14kiXNNihciaVKb6HnkQvq7zpQuZ80WEX94spnUMI3iOAl/GmIvHrpGwcbB4hJbznm+PajiwnUSPuCCXA68YJF640cJKb/8KeM7WVz69OFkIEPHhVxOy4FFF5QWe/kt6zOZ19HmE+ak+5x/QIDAQAB";
-      // let encryptor = new JSEncrypt(); // 新建JSEncrypt对象
-      // encryptor.setPublicKey(publicKey); // 设置公钥
-      // let rsaPassWord = encryptor.encrypt(ruleForm.pass); // 对密码进行加密
-      // console.log(rsaPassWord);
       let data = {
         account: ruleForm.user,
         password: ruleForm.pass,
       };
-      // let data = new FormData();
-      // data.set("number", ruleForm.user);
-      // data.set("password", ruleForm.pass); //前面的key记得对应!
-      const res = await https.post("/welcome/api/home/login", "data", data); // 使用封装的 get 方法
+      const res = await login(data); // 使用封装的 get 方法
       console.log(res, "登录获取数据");
       if (res.code == 200) {
-        sessionStorage.setItem("accountId", res.data.accountId);
-        if (checked.value) {
-          localStorage.setItem("user", ruleForm.user);
-          localStorage.setItem("pass", ruleForm.pass);
+        sessionStorage.setItem("token", res.data.token);
+        sessionStorage.setItem("userName", res.data.userName);
+
+        let roleList = await queryUserRole();
+        console.log(roleList, "获取当前用户角色权限数据");
+        if (roleList.code == 200) {
+          sessionStorage.setItem(
+            "roleList",
+            JSON.stringify(roleList.data.menus),
+          );
+          router.push({
+            path: `/alumni-info`,
+          });
         } else {
-          localStorage.removeItem("user", ruleForm.user);
-          localStorage.removeItem("pass", ruleForm.pass);
+          ElMessage({
+            type: "error",
+            showClose: true,
+            message: roleList.message,
+            center: true,
+          });
         }
-        localStorage.setItem("token", res.data.token);
-        localStorage.setItem("userName", res.data.userName);
-        store.ROLEAdd();
 
+        // 添加路由后跳转到第一个菜单项
+        // store.ROLEAdd().then(() => {
+        //   router.push({
+        //     path: `/home`,
+        //   });
+        // });
         ElMessage({
           type: "success",
           showClose: true,
-          message: "登录成功",
+          message: res.message,
           center: true,
         });
+        loading.value = false;
       } else {
         ElMessage({
           type: "error",
           showClose: true,
-          message: "登录失败",
+          message: res.message,
           center: true,
         });
         loading.value = false;
@@ -153,21 +198,14 @@ const submitForm = (formEl) => {
     }
   });
 };
+
 const Enters = (e) => {
-  // console.log("按键:", e.key);
   if (e.key == "Enter") {
     submitForm(ruleFormRef.value);
   }
 };
+
 onMounted(() => {
-  if (localStorage.getItem("pass") && localStorage.getItem("user")) {
-    ruleForm.user = localStorage.getItem("user");
-    ruleForm.pass = localStorage.getItem("pass");
-    checked.value = true;
-  }
-  if (localStorage.getItem("user")) {
-    ruleForm.user = localStorage.getItem("user");
-  }
   document.addEventListener("keyup", Enters);
 });
 onUnmounted(() => {
@@ -179,46 +217,54 @@ onUnmounted(() => {
 .box {
   width: 100%;
   height: 100vh;
-  min-width: 1200px;
-  // width: 1920px;
-  // height: 1080px;
-  background: url(@/assets/img/bg.png) 100% 100%;
-  background-size: cover;
+  background-size: 100% 100%;
   display: flex;
   align-items: center;
-  justify-content: center;
-  // .middle {
-  //   width: 1180px;
-  //   height: 740px;
-  //   position: absolute;
+  justify-content: flex-end;
+  background-image: url("@/assets/img/login_bg.png");
+  background-repeat: no-repeat;
+  background-position: center center;
+  background-size: cover; /* 等比缩放铺满容器,超出部分裁剪,仍不变形 */
 
-  // }
   .left {
-    box-shadow: 39px 30px 58px 0px rgba(8, 53, 115, 0.55);
-
-    width: 1180px;
-    height: 740px;
     border-radius: 18px;
     display: flex;
     align-items: center;
     background-size: 110% 116%;
     background-position: -19px -28px;
+
     .loginForm {
-      width: 497px;
-      height: 740px;
-      background-color: #fff;
-      border-radius: 18px 0 0 18px;
+      width: 557px;
+      height: 675px;
+      background-color: rgba(255, 255, 255, 1);
+      border-radius: 30px;
+      // border-top-left-radius:  30px;
+      // border-bottom-left-radius:  30px;
 
       .el-form {
-        width: 500px;
+        width: 100%;
         display: flex;
         flex-direction: column;
         justify-content: center;
         align-items: center;
+        padding: 35px 0;
+        border-radius: 16px;
+        background: rgba(255, 255, 255, 1);
+
+        .title {
+          color: rgba(0, 185, 170, 1);
+          font-size: 24px;
+        }
+
+        .el-divider {
+          width: 85%;
+          margin: 20px 0 30px;
+        }
+
         .el-form-item {
           width: 420px;
           height: 60px;
-          // margin-bottom: 40px;
+          margin-bottom: 35px;
 
           :deep(.el-form-item__content) {
             margin-left: 0 !important;
@@ -227,7 +273,8 @@ onUnmounted(() => {
               height: 60px;
 
               .el-input__wrapper {
-                border-radius: 12px;
+                border-radius: 30px;
+
                 .el-input__prefix {
                   margin: 0 10px 0 12px;
                 }
@@ -236,24 +283,28 @@ onUnmounted(() => {
               .el-icon {
                 width: 24px;
                 height: 24px;
+
                 svg {
                   width: 24px;
                   height: 24px;
                 }
               }
+
               .el-input__inner {
                 height: 100%;
                 font-size: 24px;
               }
             }
+
             .el-form-item__error {
               font-size: 16px;
             }
+
             .el-button {
               width: 100%;
               height: 60px;
               font-size: 24px;
-              border-radius: 12px;
+              border-radius: 30px;
             }
           }
 
@@ -261,124 +312,65 @@ onUnmounted(() => {
             width: 380px;
           }
         }
+
         .remeberPwd {
           height: 30px;
           margin-bottom: 30px;
+
           :deep(.el-checkbox__input) {
             .el-checkbox__inner {
               width: 18px;
               height: 18px;
             }
+
             .el-checkbox__inner::after {
               width: 6px;
               height: 12px;
               top: -1px;
             }
           }
+
           :deep(.el-checkbox__label) {
             font-size: 18px;
           }
         }
       }
     }
+
     .rLogin {
       width: 683px;
       height: 740px;
       border-radius: 0 18px 18px 0;
       display: flex;
-      background: rgba(41, 142, 243, 1);
+      display: none;
+
       img {
         width: 683px;
         align-self: flex-end;
       }
     }
   }
-  // @media (max-width: 500px) {
-  //   .left {
-  //     width: 100%;
-  //     height:100%;
-  //     .loginForm {
-  //       width:100%;
-  //       height:100%;
-  //       background-color: #fff;
-  //       border-radius: 18px 0 0 18px;
-
-  //       .el-form {
-  //         width: 100%;
-  //         display: flex;
-  //         flex-direction: column;
-  //         justify-content: center;
-  //         align-items: center;
-  //         .el-form-item {
-  //           width: 90%;
-  //           height: 40px;
-  //           // margin-bottom: 40px;
-
-  //           :deep(.el-form-item__content) {
-  //             margin-left: 0 !important;
-
-  //             .el-input {
-  //               height: 50px;
-
-  //               .el-input__wrapper {
-  //                 border-radius: 12px;
-  //                 .el-input__prefix {
-  //                   margin: 0 10px 0 12px;
-  //                 }
-  //               }
-
-  //               .el-icon {
-  //                 width: 24px;
-  //                 height: 24px;
-  //                 svg {
-  //                   width: 24px;
-  //                   height: 24px;
-  //                 }
-  //               }
-  //               .el-input__inner {
-  //                 height: 100%;
-  //                 font-size: 24px;
-  //               }
-  //             }
-  //             .el-form-item__error {
-  //               font-size: 16px;
-  //             }
-  //             .el-button {
-  //               width: 100%;
-  //               height: 50px;
-  //               font-size: 24px;
-  //               border-radius: 12px;
-  //             }
-  //           }
-
-  //           .el-button--primary {
-  //             width: 90%;
-  //           }
-  //         }
-  //         .remeberPwd {
-  //           height: 30px;
-  //           margin-bottom: 30px;
-  //           :deep(.el-checkbox__input) {
-  //             .el-checkbox__inner {
-  //               width: 18px;
-  //               height: 18px;
-  //             }
-  //             .el-checkbox__inner::after {
-  //               width: 6px;
-  //               height: 12px;
-  //               top: -1px;
-  //             }
-  //           }
-  //           :deep(.el-checkbox__label) {
-  //             font-size: 18px;
-  //           }
-  //         }
-  //       }
-  //     }
-  //     .rLogin {
-  //       display: none;
-  //     }
-  //   }
-  // }
+}
+.login_logo {
+  position: absolute;
+  top: 40px;
+  left: 60px;
+  width: 100%;
+  height: 80px;
+  background-image: url("@/assets/img/login_logo.png");
+  background-repeat: no-repeat; /* 禁止平铺,只显示一张 */
+  background-position: left center; /* 水平+垂直居中(垂直居中可省略,因高度已适配) */
+  background-size: auto 100%; /* 核心:高度铺满容器,宽度按原始宽高比自动计算(绝对不变形) */
+}
+.login_txt {
+  position: absolute;
+  top: 150px;
+  // left: 40px;
+  width: 100%;
+  height: 75px;
+  background-image: url("@/assets/img/login_txt2.png");
+  background-repeat: no-repeat; /* 禁止平铺,只显示一张 */
+  background-position: 12% center; /* 水平+垂直居中(垂直居中可省略,因高度已适配) */
+  background-size: auto 100%; /* 核心:高度铺满容器,宽度按原始宽高比自动计算(绝对不变形) */
 }
 </style>

+ 39 - 22
src/views/login/login.vue

@@ -1,6 +1,9 @@
 <!-- views/login/Login.vue -->
 <template>
   <div class="box">
+    <div class="right">
+      <div class="login_txt"></div>
+    </div>
     <div class="left">
       <div class="loginForm">
         <div
@@ -103,7 +106,6 @@
     </div>
   </div>
   <div class="login_logo"></div>
-  <div class="login_txt"></div>
 </template>
 
 <script setup>
@@ -127,6 +129,8 @@ const ruleFormRef = ref();
 const ruleForm = reactive({
   user: "superAdmin",
   pass: "Ncjti32003",
+  // user: "",
+  // pass: "",
   role: "",
 });
 const checked = ref(false); // 记住密码
@@ -214,28 +218,32 @@ onUnmounted(() => {
 <style lang="scss" scoped>
 .box {
   width: 100%;
+  min-width: 1400px;
   height: 100vh;
+  min-height: 800px;
   background-size: 100% 100%;
   display: flex;
   align-items: center;
   justify-content: flex-end;
-  background-image: url("@/assets/img/login_bg.png");
-  background-repeat: no-repeat;
-  background-position: center center;
-  background-size: cover; /* 等比缩放铺满容器,超出部分裁剪,仍不变形 */
+  // background-image: url("@/assets/img/login_bg.png");
+  // background-repeat: no-repeat;
+  // background-position: center center;
+  // background-size: cover; /* 等比缩放铺满容器,超出部分裁剪,仍不变形 */
 
   .left {
-    border-radius: 18px;
+    height: 100%;
+    background-color: rgba(250, 251, 255, 1);
+    // border-radius: 18px;
     display: flex;
     align-items: center;
     background-size: 110% 116%;
     background-position: -19px -28px;
 
     .loginForm {
-      width: 557px;
+      width: 650px;
       height: 675px;
-      background-color: rgba(255, 255, 255, 1);
-      border-radius: 30px;
+      // background-color: rgba(255, 255, 255, 1);
+      // border-radius: 30px;
       // border-top-left-radius:  30px;
       // border-bottom-left-radius:  30px;
 
@@ -246,8 +254,8 @@ onUnmounted(() => {
         justify-content: center;
         align-items: center;
         padding: 35px 0;
-        border-radius: 16px;
-        background: rgba(255, 255, 255, 1);
+        // border-radius: 16px;
+        // background: rgba(255, 255, 255, 1);
 
         .title {
           color: rgba(0, 185, 170, 1);
@@ -348,6 +356,26 @@ onUnmounted(() => {
       }
     }
   }
+  .right {
+    width: calc(100% - 650px);
+    height: 100%;
+    background-image: url("@/assets/img/login_bg.png");
+    background-repeat: no-repeat;
+    background-position: center top;
+    background-size: auto 110%; /* 等比缩放铺满容器,超出部分裁剪,仍不变形 */
+    .login_txt {
+      // position: absolute;
+      // top: 200px;
+      // left: 150px;
+      margin:  170px auto;
+      width: 510px;
+      height: 75px;
+      background-image: url("@/assets/img/login_txt2.png");
+      background-repeat: no-repeat; /* 禁止平铺,只显示一张 */
+      background-position: left center; /* 水平+垂直居中(垂直居中可省略,因高度已适配) */
+      background-size: auto 100%; /* 核心:高度铺满容器,宽度按原始宽高比自动计算(绝对不变形) */
+    }
+  }
 }
 .login_logo {
   position: absolute;
@@ -360,15 +388,4 @@ onUnmounted(() => {
   background-position: left center; /* 水平+垂直居中(垂直居中可省略,因高度已适配) */
   background-size: auto 100%; /* 核心:高度铺满容器,宽度按原始宽高比自动计算(绝对不变形) */
 }
-.login_txt {
-  position: absolute;
-  top: 150px;
-  // left: 40px;
-  width: 100%;
-  height: 75px;
-  background-image: url("@/assets/img/login_txt.png");
-  background-repeat: no-repeat; /* 禁止平铺,只显示一张 */
-  background-position: 12% center; /* 水平+垂直居中(垂直居中可省略,因高度已适配) */
-  background-size: auto 100%; /* 核心:高度铺满容器,宽度按原始宽高比自动计算(绝对不变形) */
-}
 </style>

+ 2 - 2
vite.config.js

@@ -9,6 +9,7 @@ import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
 
 // https://vitejs.dev/config/
 export default defineConfig({
+  base: '/alumnus/alumniWebTest/',
   plugins: [
     vue(), //配置svg全局可用
     // 配置 SVG 图标插件
@@ -50,14 +51,13 @@ export default defineConfig({
     // https: false,
     proxy: {
       "/api": {
-        target: "https://chtech.ncjti.edu.cn/alumnus/alumni_testapi/alumni/api", // 线上环境
+        target: "https://chtech.ncjti.edu.cn/alumnus/alumni_testapi/alumni", // 线上环境
         changeOrigin: true,
         rewrite: (path) => path.replace(/^\/api/,''),
       },
     },
   },
   publicDir: "public",
-  base: "./",
   // 打包配置
   build: {
     target: "modules", //设置最终构建的浏览器兼容目标  //es2015(编译成es5) | modules