diff --git a/src/locales/lang/en.js b/src/locales/lang/en.js index 08936077..8731e33e 100644 --- a/src/locales/lang/en.js +++ b/src/locales/lang/en.js @@ -3,6 +3,8 @@ export default { slogan: 'High performance / delicate / grace', describe: 'Vue3 + element plus based front-end solutions in the background.', signInTitle: 'Sign in', + accountLogin: 'Account sign in', + mobileLogin: 'Mobile sign in', rememberMe: 'Remember me', forgetPassword: 'Forget password', signIn: 'Sign in', @@ -12,7 +14,18 @@ export default { PWPlaceholder: 'Please input a password', PWError: 'Please input a password', admin: 'Administrator', - user: 'User' + user: 'User', + mobilePlaceholder: 'Mobile', + mobileError: 'Please input mobile', + smsPlaceholder: 'SMS Code', + smsError: 'Please input sms code', + smsGet: 'Get SMS Code', + smsSent: 'SMS sent to mobile number', + noAccount: 'No account?', + createAccount: 'Create a new account', + wechatLoginTitle: 'QR code sign in', + wechatLoginMsg: 'Please use wechat to scan and log in | Auto scan after 3 seconds of simulation', + wechatLoginResult: 'Scanned | Please click authorize login in the device' }, user: { dynamic: 'Dynamic', diff --git a/src/locales/lang/zh-cn.js b/src/locales/lang/zh-cn.js index 3937d681..87c01502 100644 --- a/src/locales/lang/zh-cn.js +++ b/src/locales/lang/zh-cn.js @@ -3,7 +3,9 @@ export default { slogan: '高性能 / 精致 / 优雅', describe: '基于Vue3 + Element-Plus 的中后台前端解决方案。', signInTitle: '用户登录', - rememberMe: '记住我', + accountLogin: '账号登录', + mobileLogin: '手机号登录', + rememberMe: '24小时免登录', forgetPassword: '忘记密码', signIn: '登录', signInOther: '其他登录方式', @@ -12,7 +14,18 @@ export default { PWPlaceholder: '请输入密码', PWError: '请输入密码', admin: '管理员', - user: '用户' + user: '用户', + mobilePlaceholder: '手机号码', + mobileError: '请输入手机号码', + smsPlaceholder: '短信验证码', + smsError: '请输入短信验证码', + smsGet: '获取验证码', + smsSent: '已发送短信至手机号码', + noAccount: '还没有账号?', + createAccount: '创建新账号', + wechatLoginTitle: '二维码登录', + wechatLoginMsg: '请使用微信扫一扫登录 | 模拟3秒后自动扫描', + wechatLoginResult: '已扫描 | 请在设备中点击授权登录' }, user: { dynamic: '近期动态', diff --git a/src/router/index.js b/src/router/index.js index b9126f09..f2a6ed3f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -48,6 +48,11 @@ router.beforeEach(async (to, from, next) => { return false; } + if(routes.findIndex(r => r.path === to.path) >= 0){ + next(); + return false; + } + if(!token){ next({ path: '/login' diff --git a/src/router/systemRouter.js b/src/router/systemRouter.js index 5d4c65b2..fd51a958 100644 --- a/src/router/systemRouter.js +++ b/src/router/systemRouter.js @@ -11,10 +11,24 @@ const routes = [ }, { path: "/login", - component: () => import(/* webpackChunkName: "login" */ '@/views/userCenter/login'), + component: () => import(/* webpackChunkName: "login" */ '@/views/login'), meta: { title: "登录" } + }, + { + path: "/user_register", + component: () => import(/* webpackChunkName: "userRegister" */ '@/views/login/userRegister'), + meta: { + title: "注册" + } + }, + { + path: "/reset_password", + component: () => import(/* webpackChunkName: "resetPassword" */ '@/views/login/resetPassword'), + meta: { + title: "重置密码" + } } ] diff --git a/src/style/media.scss b/src/style/media.scss index 41f6f258..01cd3e1e 100644 --- a/src/style/media.scss +++ b/src/style/media.scss @@ -43,4 +43,8 @@ .adminui-main > .el-container > .el-container > .el-header .right-panel {display: block;margin-top: 15px;} .sc-page {width: 100%;margin: 0;} + + .common-main .el-form {width: 100% !important;} + .common-header-logo label {display: none;} + .common-header-title {display: none;} } diff --git a/src/style/pages.scss b/src/style/pages.scss index 4c76a1ee..564c8cae 100644 --- a/src/style/pages.scss +++ b/src/style/pages.scss @@ -21,3 +21,24 @@ .header-tabs .el-tabs__nav {border-radius: 0 !important;} .header-tabs .el-tabs__item {font-size: 13px;} .header-tabs .el-tabs__item.is-active {background-color: var(--el-bg-color-overlay);} + +/*common-page*/ +.common-page {} +.common-header-left {display: flex;align-items: center;} +.common-header-logo {display: flex;align-items: center;} +.common-header-logo img {height:30px;margin-right: 10px;vertical-align: bottom;} +.common-header-logo label {font-size: 20px;} +.common-header-title {font-size: 16px;border-left: 1px solid var(--el-border-color-light);margin-left: 15px;padding-left: 15px;} +.common-header-right {display: flex;align-items: center;} +.common-header-right a {font-size: 14px;color: var(--el-color-primary);cursor: pointer;} +.common-header-right a:hover {color: var(--el-color-primary-light-3);} +.common-container {max-width: 1240px;margin:30px auto 30px auto;} +.common-main {padding:20px;} +.common-title {font-size: 26px;margin-bottom: 20px;font-weight: normal;} +.common-main .el-form {width: 500px;margin:30px auto;} +.common-main .el-steps .el-step__title {font-size: 14px;} +.common-main .el-steps .el-step__icon {border: 1px solid;} +.common-main .yzm {display: flex;width: 100%;} +.common-main .yzm .el-button {margin-left: 10px;} +.common-main .link {color: var(--el-color-primary);cursor: pointer;} +.common-main .link:hover {color: var(--el-color-primary-light-3);} diff --git a/src/views/login/components/commonPage.vue b/src/views/login/components/commonPage.vue new file mode 100644 index 00000000..ccac3d02 --- /dev/null +++ b/src/views/login/components/commonPage.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/views/login/components/passwordForm.vue b/src/views/login/components/passwordForm.vue new file mode 100644 index 00000000..db827088 --- /dev/null +++ b/src/views/login/components/passwordForm.vue @@ -0,0 +1,126 @@ + + + + + diff --git a/src/views/login/components/phoneForm.vue b/src/views/login/components/phoneForm.vue new file mode 100644 index 00000000..aa43c57c --- /dev/null +++ b/src/views/login/components/phoneForm.vue @@ -0,0 +1,74 @@ + + + + + diff --git a/src/views/userCenter/login.vue b/src/views/login/index.vue similarity index 59% rename from src/views/userCenter/login.vue rename to src/views/login/index.vue index 59fdaa51..75f625d1 100644 --- a/src/views/userCenter/login.vue +++ b/src/views/login/index.vue @@ -42,64 +42,44 @@ -

{{ $t('login.signInTitle') }}

- - - - - - - - - - - - - - - {{ $t('login.forgetPassword') }}? - - - - {{ $t('login.signIn') }} - - - + + + + + + + + {{ $t('login.signInOther') }} -
- +
+ +
+ +

{{$tc('login.wechatLoginMsg', 1)}}
{{$tc('login.wechatLoginMsg', 2)}}

+
+ +
+
+
+ + diff --git a/src/views/login/userRegister.vue b/src/views/login/userRegister.vue new file mode 100644 index 00000000..a3ba9a28 --- /dev/null +++ b/src/views/login/userRegister.vue @@ -0,0 +1,168 @@ + + + + +