()
+ const loading = ref(false)
+
+ const rules = {
+ name: {
+ required: true,
+ message: t('LoginModule.NamePlaceholder'),
+ trigger: ['blur', 'input'],
+ },
+ pwd: {
+ required: true,
+ message: t('LoginModule.PasswordPlaceholder'),
+ trigger: ['blur', 'input'],
+ },
+ }
+
+ const handleLogin = () => {
+ loginFormRef.value?.validate((valid) => {
+ if (!valid) {
+ window.$message.info('登陆中...')
+
+ loading.value = true
+
+ setTimeout(() => {
+ router.push('/dashboard')
+
+ setCache('token', 'tokenValue')
+ }, 2 * 1000)
+ } else {
+ window.$message.error('不可以这样哟, 不可以哟')
+ }
+ })
+ }
+
+ return {
+ signinForm,
+ loginFormRef,
+ handleLogin,
+ rules,
+ loading,
+ t,
+ }
+ },
+ render() {
+ return (
+
+
+
+
+
+
+
+
+ {this.t('LoginModule.Login')}
+
+
+ )
+ },
+})
+
+export default Signin
diff --git a/src/views/login/index.scss b/src/views/login/index.scss
new file mode 100644
index 00000000..0e85e726
--- /dev/null
+++ b/src/views/login/index.scss
@@ -0,0 +1,23 @@
+.login {
+ @include flexCenter;
+ flex-direction: column;
+ font-size: 36px;
+
+ &.login--dark {
+ background-color: #101014;
+ color: #ffffff;
+ }
+
+ & .login-title {
+ padding: 18px 0;
+ }
+
+ & .login-icon {
+ border: none;
+ outline: none;
+ }
+
+ & .n-card {
+ width: 360px;
+ }
+}
diff --git a/src/views/login/index.tsx b/src/views/login/index.tsx
new file mode 100644
index 00000000..51ce0587
--- /dev/null
+++ b/src/views/login/index.tsx
@@ -0,0 +1,68 @@
+import './index.scss'
+import {
+ NSpace,
+ NCard,
+ NTabs,
+ NTabPane,
+ NGradientText,
+ NDropdown,
+} from 'naive-ui'
+import Signin from './components/Signin/index'
+import Register from './components/Register/index'
+import { useSetting } from '@/store'
+import RayIcon from '@/components/RayIcon'
+import { useLanguageOptions } from '@/language/index'
+
+const Login = defineComponent({
+ name: 'Login',
+ setup() {
+ const state = reactive({
+ tabsValue: 'signin',
+ })
+ const { t } = useI18n()
+ const { height: windowHeight } = useWindowSize()
+ const settingStore = useSetting()
+ const { themeValue } = storeToRefs(settingStore)
+ const { updateLocale } = settingStore
+
+ return {
+ ...toRefs(state),
+ windowHeight,
+ themeValue,
+ updateLocale,
+ ray: t,
+ }
+ },
+ render() {
+ return (
+
+
+
+ Ray Template
+
+ this.updateLocale(key)}
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+ },
+})
+
+export default Login