Explorar o código

feat: 登录页面 100%

luoyali hai 1 ano
pai
achega
bf5bad4e9e
Modificáronse 2 ficheiros con 12 adicións e 2 borrados
  1. 1 1
      src/permission.ts
  2. 11 1
      src/views/login/components/passwordForm.vue

+ 1 - 1
src/permission.ts

@@ -20,7 +20,7 @@ router.beforeEach(async (to, from, next) => {
 	// const hasToken = user.token
 	const hasToken = ls.get('token')
 	// 登录页特殊处理
-	if (to.path === '/login1') {
+	if (to.path === '/login') {
 		// 登录成功,跳转到首页(特)
 		hasToken ? next({ path: '/' }) : next()
 		return NProgress.done()

+ 11 - 1
src/views/login/components/passwordForm.vue

@@ -56,7 +56,17 @@ export default {
 				this.$message.success('Login Success 登录成功')
 			})
 		}
-	}
+	},
+	watch: {
+		'$route.query': {
+			handler(query) {
+				user.$patch({
+					loginQuery: query
+				})
+			},
+			immediate: true
+		}
+	},
 }
 </script>