Browse Source

Merge branch 'master' of ssh://www.yixzm.cn:22022/Dim5-ideal/bj-maritime-dcds-web

Luka 5 days ago
parent
commit
a533f1e90c
3 changed files with 581 additions and 300 deletions
  1. 22 22
      package.json
  2. 494 278
      pnpm-lock.yaml
  3. 65 0
      src/views/login.vue

+ 22 - 22
package.json

@@ -15,48 +15,48 @@
         "@vueup/vue-quill": "1.1.0",
         "@vueuse/core": "9.5.0",
         "@wangeditor/editor-for-vue": "^5.1.12",
-        "@zeronejs/utils": "^1.4.2",
+        "@zeronejs/utils": "^1.4.0",
         "axios": "0.27.2",
         "crypto-js": "^4.2.0",
-        "dayjs": "^1.11.18",
+        "dayjs": "^1.11.11",
         "echarts": "5.4.0",
-        "element-china-area-data": "^6.1.0",
+        "element-china-area-data": "^6.0.2",
         "element-plus": "2.2.27",
         "file-saver": "2.0.5",
         "fuse.js": "6.6.2",
-        "jodit": "^4.6.2",
+        "jodit": "^4.0.18",
         "js-cookie": "3.0.1",
         "jsencrypt": "3.3.1",
         "lodash": "^4.17.21",
         "nprogress": "0.2.0",
         "pinia": "2.0.22",
-        "terser": "^5.43.1",
-        "tinymce": "^6.8.6",
+        "terser": "^5.30.0",
+        "tinymce": "^6.8.3",
         "vue": "3.2.45",
         "vue-cropper": "1.0.3",
         "vue-router": "4.1.4"
     },
     "devDependencies": {
         "@types/crypto-js": "^4.2.2",
-        "@types/file-saver": "^2.0.7",
-        "@types/js-cookie": "^3.0.6",
-        "@types/node": "^18.19.123",
-        "@types/nprogress": "^0.2.3",
-        "@typescript-eslint/eslint-plugin": "^5.62.0",
-        "@typescript-eslint/parser": "^5.62.0",
+        "@types/file-saver": "^2.0.5",
+        "@types/js-cookie": "^3.0.2",
+        "@types/node": "^18.7.15",
+        "@types/nprogress": "^0.2.0",
+        "@typescript-eslint/eslint-plugin": "^5.36.2",
+        "@typescript-eslint/parser": "^5.36.2",
         "@vitejs/plugin-vue": "3.1.0",
-        "autoprefixer": "^10.4.21",
-        "eslint": "^8.57.1",
-        "eslint-config-prettier": "^8.10.2",
-        "eslint-plugin-vue": "^9.33.0",
-        "postcss": "^8.5.6",
+        "autoprefixer": "^10.4.8",
+        "eslint": "^8.23.0",
+        "eslint-config-prettier": "^8.5.0",
+        "eslint-plugin-vue": "^9.4.0",
+        "postcss": "^8.4.16",
         "sass": "1.56.1",
-        "tailwindcss": "^3.4.17",
-        "ts-node": "^10.9.2",
-        "tsconfig-paths": "^4.2.0",
-        "typescript": "^4.9.5",
+        "tailwindcss": "^3.1.8",
+        "ts-node": "^10.9.1",
+        "tsconfig-paths": "^4.1.0",
+        "typescript": "^4.8.2",
         "unplugin-auto-import": "0.11.4",
-        "unplugin-vue-components": "^0.22.12",
+        "unplugin-vue-components": "^0.22.4",
         "vite": "3.2.3",
         "vite-plugin-compression": "^0.5.1",
         "vite-plugin-svg-icons": "2.0.1",

File diff suppressed because it is too large
+ 494 - 278
pnpm-lock.yaml


+ 65 - 0
src/views/login.vue

@@ -28,6 +28,8 @@
             <el-form-item style="width: 100%">
                 <el-button :loading="loading" size="large" type="primary" style="width: 100%"
                     @click.prevent="handleAllLogin">
+                    <!-- <span v-if="!loading">登 录</span>
+                    <span v-else>登 录 中...</span> -->
                     登 录
                 </el-button>
                 <div style="float: right" v-if="register">
@@ -86,6 +88,7 @@ const router = useRouter();
 const loginForm = ref<any>({
 <<<<<<< HEAD
 <<<<<<< HEAD
+<<<<<<< HEAD
 	username: 'admin',
 	password: 'admin123',
 	rememberMe: false,
@@ -103,6 +106,10 @@ const loginRules = {
 >>>>>>> 6c90d73fadd504a5827e77c4e8dc469f3608d6d0
     username: 'admin',
     password: 'admin123',
+=======
+    username: '',
+    password: '',
+>>>>>>> 69180c26f55572578b0158704d707e0a577a6786
     rememberMe: false,
     code: '',
     uuid: '',
@@ -114,9 +121,12 @@ const loginRules = {
     password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }],
     code: [{ required: true, trigger: 'change', message: '请输入验证码' }],
 <<<<<<< HEAD
+<<<<<<< HEAD
 >>>>>>> e94f5f44564039f665611f42b365b51740d0649c
 =======
 >>>>>>> 6c90d73fadd504a5827e77c4e8dc469f3608d6d0
+=======
+>>>>>>> 69180c26f55572578b0158704d707e0a577a6786
 };
 
 const codeUrl = ref('');
@@ -137,6 +147,7 @@ const isCountingDown = ref(false);
 const countdownText = computed(() => {
 <<<<<<< HEAD
 <<<<<<< HEAD
+<<<<<<< HEAD
 	return isCountingDown.value ? `${countdown.value}s 后重新获取` : '获取验证码';
 });
 const getVerificationCode = async () => {
@@ -220,6 +231,8 @@ const handleNext = () => {
 =======
 =======
 >>>>>>> 6c90d73fadd504a5827e77c4e8dc469f3608d6d0
+=======
+>>>>>>> 69180c26f55572578b0158704d707e0a577a6786
     return isCountingDown.value ? `${countdown.value}s 后重新获取` : '获取验证码';
 });
 const getVerificationCode = async () => {
@@ -301,15 +314,19 @@ const handleNext = () => {
         }
     });
 <<<<<<< HEAD
+<<<<<<< HEAD
 >>>>>>> e94f5f44564039f665611f42b365b51740d0649c
 =======
 >>>>>>> 6c90d73fadd504a5827e77c4e8dc469f3608d6d0
+=======
+>>>>>>> 69180c26f55572578b0158704d707e0a577a6786
 };
 
 // 有下一步的最后一步
 const handleEndLogin = () => {
 <<<<<<< HEAD
 <<<<<<< HEAD
+<<<<<<< HEAD
 	userStore
 		.phoneLogin(loginForm.value)
 		.then((res: any) => {
@@ -327,6 +344,8 @@ const handleEndLogin = () => {
 =======
 =======
 >>>>>>> 6c90d73fadd504a5827e77c4e8dc469f3608d6d0
+=======
+>>>>>>> 69180c26f55572578b0158704d707e0a577a6786
     userStore
         .phoneLogin(loginForm.value)
         .then((res: any) => {
@@ -342,15 +361,19 @@ const handleEndLogin = () => {
             loading.value = false;
         });
 <<<<<<< HEAD
+<<<<<<< HEAD
 >>>>>>> e94f5f44564039f665611f42b365b51740d0649c
 =======
 >>>>>>> 6c90d73fadd504a5827e77c4e8dc469f3608d6d0
+=======
+>>>>>>> 69180c26f55572578b0158704d707e0a577a6786
 };
 
 // 无下一步的登陆
 function handleLogin() {
 <<<<<<< HEAD
 <<<<<<< HEAD
+<<<<<<< HEAD
 	loginFirstRef.value?.validate(valid => {
 		if (valid) {
 			loading.value = true;
@@ -375,6 +398,27 @@ function handleLogin() {
     loginFirstRef.value?.validate(valid => {
         if (valid) {
             loading.value = true;
+=======
+    loginFirstRef.value?.validate(valid => {
+        if (valid) {
+            loading.value = true;
+            // 勾选了需要记住密码设置在 cookie 中设置记住用户名和密码
+            if (loginForm.value.rememberMe) {
+                Cookies.set('username', loginForm.value.username, { expires: 30 });
+                const enPwd = encrypt(loginForm.value.password, publicKey);
+                if (enPwd) {
+                    Cookies.set('password', enPwd, { expires: 30 });
+                }
+                if (loginForm.value.rememberMe) {
+                    Cookies.set('rememberMe', String(loginForm.value.rememberMe), { expires: 30 });
+                }
+            } else {
+                // 否则移除
+                Cookies.remove('username');
+                Cookies.remove('password');
+                Cookies.remove('rememberMe');
+            }
+>>>>>>> 69180c26f55572578b0158704d707e0a577a6786
             // 调用action的登录方法
             userStore
                 .login(loginForm.value)
@@ -391,15 +435,19 @@ function handleLogin() {
         }
     });
 <<<<<<< HEAD
+<<<<<<< HEAD
 >>>>>>> e94f5f44564039f665611f42b365b51740d0649c
 =======
 >>>>>>> 6c90d73fadd504a5827e77c4e8dc469f3608d6d0
+=======
+>>>>>>> 69180c26f55572578b0158704d707e0a577a6786
 }
 
 // 登陆按钮
 const handleAllLogin = () => {
 <<<<<<< HEAD
 <<<<<<< HEAD
+<<<<<<< HEAD
 	// 本地
 	// if (env === 'development') {
 	//     handleLogin();
@@ -415,6 +463,8 @@ const handleAllLogin = () => {
 =======
 =======
 >>>>>>> 6c90d73fadd504a5827e77c4e8dc469f3608d6d0
+=======
+>>>>>>> 69180c26f55572578b0158704d707e0a577a6786
     // 本地
     // if (env === 'development') {
     //     handleLogin();
@@ -428,9 +478,12 @@ const handleAllLogin = () => {
         handleLogin();
     }
 <<<<<<< HEAD
+<<<<<<< HEAD
 >>>>>>> e94f5f44564039f665611f42b365b51740d0649c
 =======
 >>>>>>> 6c90d73fadd504a5827e77c4e8dc469f3608d6d0
+=======
+>>>>>>> 69180c26f55572578b0158704d707e0a577a6786
 };
 
 // 是否有手机号
@@ -438,6 +491,7 @@ const phoneCaptchaEnabled = ref(false);
 function getCode() {
 <<<<<<< HEAD
 <<<<<<< HEAD
+<<<<<<< HEAD
 	getCodeImg().then((res: any) => {
 		captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled;
 		phoneCaptchaEnabled.value = res.phoneCaptchaEnabled;
@@ -467,6 +521,8 @@ function getCookie() {
 =======
 =======
 >>>>>>> 6c90d73fadd504a5827e77c4e8dc469f3608d6d0
+=======
+>>>>>>> 69180c26f55572578b0158704d707e0a577a6786
     getCodeImg().then((res: any) => {
         captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled;
         phoneCaptchaEnabled.value = res.phoneCaptchaEnabled;
@@ -494,9 +550,12 @@ function getCookie() {
         rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
     };
 <<<<<<< HEAD
+<<<<<<< HEAD
 >>>>>>> e94f5f44564039f665611f42b365b51740d0649c
 =======
 >>>>>>> 6c90d73fadd504a5827e77c4e8dc469f3608d6d0
+=======
+>>>>>>> 69180c26f55572578b0158704d707e0a577a6786
 }
 
 getCode();
@@ -507,6 +566,7 @@ getCookie();
 .login {
 <<<<<<< HEAD
 <<<<<<< HEAD
+<<<<<<< HEAD
 	display: flex;
 	justify-content: center;
 	align-items: center;
@@ -578,6 +638,8 @@ getCookie();
 =======
 =======
 >>>>>>> 6c90d73fadd504a5827e77c4e8dc469f3608d6d0
+=======
+>>>>>>> 69180c26f55572578b0158704d707e0a577a6786
     display: flex;
     justify-content: center;
     align-items: center;
@@ -647,8 +709,11 @@ getCookie();
     height: 40px;
     padding-left: 12px;
 <<<<<<< HEAD
+<<<<<<< HEAD
 >>>>>>> e94f5f44564039f665611f42b365b51740d0649c
 =======
 >>>>>>> 6c90d73fadd504a5827e77c4e8dc469f3608d6d0
+=======
+>>>>>>> 69180c26f55572578b0158704d707e0a577a6786
 }
 </style>

Some files were not shown because too many files changed in this diff