pengjingzhao 2 hafta önce
ebeveyn
işleme
b1a6fdffcf
3 değiştirilmiş dosya ile 48 ekleme ve 6 silme
  1. 2 2
      package.json
  2. 32 3
      src/views/system/login.vue
  3. 14 1
      vite.config.js

+ 2 - 2
package.json

@@ -45,8 +45,8 @@
     "vue-router": "4.0.16",
     "vue3-json-viewer": "2.2.2",
     "vue3-print-nb": "0.1.4",
-    "vxe-pc-ui": "^4.0.67",
-    "vxe-table": "^4.7.50",
+    "vxe-pc-ui": "^4.7.27",
+    "vxe-table": "^4.14.6",
     "vxe-table-plugin-export-xlsx": "4.0.1",
     "xe-utils": "3.5.26",
     "xlsx": "0.17.0"

+ 32 - 3
src/views/system/login.vue

@@ -55,15 +55,15 @@
               </template>
             </el-input>
             <div style="margin-bottom: 10px; text-align: left">
-              <el-button link type="primary" @click="clickForgotPassword"
+              <!-- <el-button link type="primary" @click="clickForgotPassword"
                 >忘记密码?
-              </el-button>
+              </el-button> -->
             </div>
             <el-button
               size="large"
               style="width: 100%"
               type="primary"
-              @click="submit"
+              @click="loginSubmit"
               >登录
             </el-button>
           </el-form>
@@ -120,6 +120,35 @@ const checkForm = () => {
 };
 
 const userStore = useUserStore();
+const loginSubmit = () => {
+  //   console.log("3333");
+  checkForm();
+  const params = {
+    codeRs: form.codeRs,
+    password: form.password,
+  };
+  loginApi(params).then(res => {
+    // console.log("11111111111111", res);
+    localStorage.clear();
+    userStore.setUserInfo(res);
+    systemConfig.setConfig(res.userConfigJson);
+    router.push("/dashboard");
+    // if (!checkPasswordStrength(params.password) && !isDev) {
+    //   changePassword(false).then(newPassword => {
+    //     form.password = newPassword;
+    //     submit();
+    //   });
+    // } else {
+    //   changeToken();
+    //   const url = XEUtils.parseUrl(window.location.href);
+    //   if (url.searchQuery?.redirect) {
+    //     location.href = url.search.replace("?redirect=", "");
+    //   } else {
+    //     router.push("/dashboard");
+    //   }
+    // }
+  });
+};
 const submit = () => {
   checkForm();
   const params = {

+ 14 - 1
vite.config.js

@@ -41,7 +41,12 @@ export default defineConfig(({ mode }) => {
       BMapLib: "BMapLib",
     },
     resolve: {
-      alias,
+      alias: {
+        ...alias,
+        "vxe-pc-ui": pathResolve("node_modules/vxe-pc-ui"),
+        "vxe-table": pathResolve("node_modules/vxe-table"),
+      },
+      //   alias,
       extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"],
     },
     plugins: [
@@ -107,6 +112,14 @@ export default defineConfig(({ mode }) => {
     build: {
       chunkSizeWarningLimit: 1000,
       outDir: "release/dist",
+      //   rollupOptions: {
+      //     output: {
+      //       manualChunks: {
+      //         // 将 vxe 相关库打包在一起
+      //         'vxe-ui': ['vxe-pc-ui', 'vxe-table', 'vxe-table-plugin-export-xlsx']
+      //       }
+      //     }
+      //   }
       // 优化打包把第三方的东西每次打包时都不重复
       // rollupOptions: {
       //   output: {