Parcourir la source

忘记密码,修改密码跳转

luohailiang il y a 2 ans
Parent
commit
8e2c690165

+ 4 - 2
src/components/LoginForm/index.vue

@@ -6,7 +6,9 @@ import { encrypt } from "@/utils/crypto";
 // let loginShow.value= $ref(false)
 const passwordType = $ref('password')
 const router = useRouter();
-
+const linkTo = (name: any) => {
+  router.push({ name });
+};
 interface IForm {
   user_name: string
   user_password: string
@@ -115,7 +117,7 @@ function handleClose() {
 
           <div class="flex justify-between ">
             <el-checkbox v-model="isRemember" label="记住密码" size="large" />
-            <el-link type="primary" class="text-xs" :underline="false">
+            <el-link type="primary" class="text-xs" :underline="false" @click="linkTo('reset_auth')">
               忘记密码
             </el-link>
           </div>

+ 1 - 1
src/pages/auth.vue

@@ -36,7 +36,7 @@ let form = $ref({
     user_realname:''
 })
 const routerBack = () => {
-    window.location.href = 'https://www.txhlwxx.com/'
+  router.back();
 };
 const rules = {
     user_name:[{ required: true, message: "请输入用户名", trigger: "blur" }],

+ 1 - 0
src/pages/home.vue

@@ -26,6 +26,7 @@ const { data } = await request({
 const user_data_list = [{ k: 'user_num', v: '总用户数', icon: icon8 }, { k: 'school_num', v: '总学校数', icon: icon9 }, { k: 'teacher_num', v: '教师用户', icon: icon11 }, { k: 'student_num', v: '学生用户', icon: icon10 }, { k: 'today_login_num', v: '今日登录', icon: icon12 }]
 
 const router = useRouter()
+console.log(router,898)
 function routerPush(args?: RouteLocationRaw) {
   if (args)
     router.push(args)

+ 10 - 1
src/pages/jsd/personal/change_pwd.vue

@@ -62,13 +62,22 @@ function submitForm() {
           loading = false;
           if(res.code === '1') {
             ElMessage.success("密码修改成功!");
-
+            toOut();
           }
         })
       }
     }
   })
 }
+function toOut() {
+  if (sessionStorage.getItem("userInfo")) {
+    sessionStorage.removeItem("userInfo");
+    router.replace({ name: "home" });
+    setTimeout(() => {
+      location.reload();
+    }, 300);
+  }
+}
 </script>
 
 <style lang="scss" scoped>