From 7f89d0b6ce12fd9ad39e501f63e2894b568aad02 Mon Sep 17 00:00:00 2001 From: children117cl <278950112@qq.com> Date: 星期三, 26 五月 2021 20:16:17 +0800 Subject: [PATCH] demo预留返回按钮、权限判断、objectName、富文本方法、部分注释 --- src/pages/login/index.vue | 32 +++++++++++++++++++++++--------- 1 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue index 4f66a0e..61d0696 100644 --- a/src/pages/login/index.vue +++ b/src/pages/login/index.vue @@ -18,6 +18,7 @@ type="text" tabindex="1" autocomplete="on" + maxlength="20" @keyup.enter.native="handleLogin" /> </el-form-item> @@ -36,6 +37,7 @@ name="password" tabindex="2" autocomplete="on" + maxlength="20" @keyup.native="checkCapslock" @blur="capsTooltip = false" @keyup.enter.native="handleLogin" @@ -58,6 +60,7 @@ name="safecode" type="text" tabindex="3" + maxlength="10" autocomplete="off" @keyup.enter.native="handleLogin" /> @@ -114,9 +117,9 @@ checkedId: '' }, loginRules: { - username: [{ required: true, trigger: 'change', validator: validateUsername }], - password: [{ required: true, trigger: 'change', validator: validatePassword }], - safecode: [{ required: true, trigger: 'change', validator: validateSafecode }] + username: [{ required: true, trigger: 'blur', validator: validateUsername }], + password: [{ required: true, trigger: 'blur', validator: validatePassword }], + safecode: [{ required: true, trigger: 'blur', validator: validateSafecode }] }, passwordType: 'password', capsTooltip: false, @@ -144,8 +147,7 @@ }, methods: { init() { - var loginData = localStorage.getItem('loginData') - console.log(loginData) + var loginData = localStorage.getItem('loginData_XXXX') // 鑾峰彇淇濆瓨鐨勮处鍙峰瘑鐮� if (loginData) this.loginForm = JSON.parse(loginData) @@ -221,7 +223,7 @@ name: '娼樺鎷夌殑鑷槾', // 鐢ㄦ埛鍚嶇О // arr: ['sys_admin_see'], // 鏉冮檺鍒楄〃 arr: ['sys_admin_see', 'sys_admin_add', 'sys_admin_edit', 'sys_admin_del', 'sys_admin_role_see', 'sys_admin_role_add', 'sys_admin_role_edit', 'sys_admin_role_del', 'corp_user_schedule_see', 'corp_user_schedule_add', 'corp_user_schedule_edit', 'corp_user_schedule_del', 'user_mp_banner_see', 'user_mp_banner_add', 'user_mp_banner_edit', 'user_mp_banner_del', 'shop_see', 'shop_add', 'shop_edit', 'shop_del', 'shop_device', 'corp_user_see', 'corp_user_add', 'corp_user_edit', 'corp_user_del', 'change_assistant_see', 'ser_pro_material_see', 'service_project_see', 'service_project_add', 'service_project_edit', 'service_project_del', 'service_topic_see', 'service_topic_add', 'service_topic_edit', 'service_topic_del', 'service_project_order_see', 'service_project_order_edit', 'goods_type_see', 'goods_type_add', 'goods_type_edit', 'goods_type_del', 'goods_see', 'goods_add', 'goods_edit', 'goods_del', 'goods_inventory', 'goods_order_see', 'goods_order_edit', 'goods_index_banner_see', 'goods_index_banner_add', 'goods_index_banner_edit', 'goods_index_banner_del', 'user_see', 'user_edit', 'user_cash_see', 'user_cash_edit', 'distribute_relate', 'distribute_order', 'document_edit', 'operation_see', - 'coupon_see', 'coupon_add', 'coupon_edit', 'coupon_del', 'activity_see', 'activity_add', 'activity_edit', 'activity_del' + 'coupon_see', 'coupon_add', 'coupon_edit', 'coupon_del', 'activity_see', 'activity_add', 'activity_edit', 'activity_del', 'banner_see', 'banner_add', 'banner_edit', 'banner_del' ] } } @@ -234,7 +236,7 @@ username: this.loginForm.username.trim(), password: this.loginForm.password.trim() }) - localStorage.setItem('loginData', loginData) + localStorage.setItem('loginData_XXXX', loginData) // 淇濆瓨鐢ㄦ埛鏁版嵁 setUserData(inf) @@ -284,6 +286,11 @@ /* reset element-ui css */ .login-container { + // 鑳屾櫙 鈫撯啌鈫撯啌鈫撯啌鈫撯啌鈫撯啌 + // background: url(../../assets/imgs/loginBg.jpg) no-repeat; + // background-size: cover; + // 鑳屾櫙 鈫戔啈鈫戔啈鈫戔啈鈫戔啈鈫戔啈 + background-color: $bg; .el-input { display: inline-block; height: 47px; @@ -324,16 +331,23 @@ .login-container { min-height: 100%; width: 100%; - background-color: $bg; + // background-color: $bg; overflow: hidden; .login-form { position: relative; width: 520px; max-width: 100%; - padding: 160px 35px 0; + padding: 35px 35px 0; margin: 0 auto; + margin-top: 160px; overflow: hidden; + // 鑳屾櫙 鈫撯啌鈫撯啌鈫撯啌鈫撯啌鈫撯啌 + // background-color: $bg; + // opacity: .96; + // border-radius: 10px; + // box-shadow: 0px 20px 60px rgba(0,0,0,0.4), 0px 0px 150px rgba(0,0,0,0.4); + // 鑳屾櫙 鈫戔啈鈫戔啈鈫戔啈鈫戔啈鈫戔啈 } .tips { -- Gitblit v1.8.0