提交 4a793a41 authored 作者: 王鹏飞's avatar 王鹏飞

add prp

上级 dac9d690
......@@ -67,6 +67,9 @@ module.exports = {
},
xtraining: {
url: 'http://x-training2.ezijing.com'
},
prp: {
url: 'http://prp-learning2.ezijing.com'
}
}
}
......@@ -48,6 +48,9 @@ module.exports = {
},
xtraining: {
url: 'http://xtraining.ezijing.com'
},
prp: {
url: 'http://prp-learning.ezijing.com'
}
}
}
......@@ -49,6 +49,9 @@ module.exports = {
},
xtraining: {
url: 'http://x-training2.ezijing.com'
},
prp: {
url: 'http://prp-learning2.ezijing.com'
}
}
}
<template>
<div>
<el-form :model="ruleForm" :rules="rules" ref="form" @submit.native.prevent>
<el-form :model="ruleForm" :rules="rules" ref="form" :hide-required-asterisk="true" @submit.native.prevent>
<el-form-item prop="account" :label="$t('password.account.title')">
<el-input v-model="ruleForm.account" :placeholder="$t('password.account.placeholder')">
<i slot="prefix" class="el-input__icon el-icon-user"></i>
......
差异被折叠。
<template>
<div class="login-page">
<div class="login-box">
<div class="login-mian">
<div class="login-modules">
<router-view></router-view>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'WmpLayout',
metaInfo() {
return {
link: [{ rel: 'icon', href: 'https://zws-imgs-pub.ezijing.com/static/build/learn-enterprise/favicon.png' }]
}
},
data() {
return {
imgUrl: 'pc'
}
},
created() {
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
this.imgUrl = 'mobile'
} else {
this.imgUrl = 'pc'
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .el-button--primary {
background: #fff;
border: none;
color: #0028a8;
}
::v-deep .el-page-header__content,
::v-deep .el-form-item__label {
color: #fff;
}
.login-page {
color: #fff;
}
.login-box {
height: 100vh;
background: #142564 url('../assets/login-bg.png') no-repeat center top;
background-size: 100% 100%;
.login-mian {
// position: relative;
// width: 1400px;
height: 100%;
margin: 0 auto;
.login-modules {
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 8%;
width: 340px;
}
}
}
</style>
<template>
<div>
<router-view @success="handleSuccess"></router-view>
<!-- <div class="new-user" @click="$router.push('../register')">我是新用户?</div> -->
</div>
</template>
<script>
export default {
methods: {
handleSuccess(response) {
const { url } = webConf.others.prp
window.location.href = url
}
}
}
</script>
<style lang="scss" scoped>
.new-user {
font-size: 16px;
font-weight: bold;
color: rgba(255, 158, 100, 1);
text-align: center;
padding-top: 30px;
text-decoration: underline;
}
</style>
<template>
<div class="password">
<el-page-header @back="$router.push('login')" title="返回登录" content="忘记密码"></el-page-header>
<div class="password-form">
<router-view></router-view>
</div>
</div>
</template>
<style lang="scss" scoped>
.password-form {
margin-top: 20px;
}
</style>
<template>
<div class="register">
<el-page-header @back="$router.push('login')" title="返回登录" content="注册"></el-page-header>
<div class="register-form">
<el-form :model="ruleForm" :rules="rules" ref="form" @submit.native.prevent>
<el-form-item prop="name">
<el-input v-model="ruleForm.name" placeholder="姓名"></el-input>
</el-form-item>
<el-form-item prop="organization">
<el-input v-model="ruleForm.organization" placeholder="机构"></el-input>
</el-form-item>
<el-form-item prop="job">
<el-input v-model="ruleForm.job" placeholder="职务"></el-input>
</el-form-item>
<el-form-item prop="mobile">
<el-input v-model="ruleForm.mobile" placeholder="手机"></el-input>
</el-form-item>
<el-form-item prop="code">
<el-input v-model="ruleForm.code" placeholder="验证码">
<countdown
slot="suffix"
size="mini"
:disabled="disabledSend"
@start="sendCodeRequest"
ref="countdown"
></countdown>
</el-input>
</el-form-item>
<el-form-item prop="email">
<el-input v-model="ruleForm.email" placeholder="邮箱"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input type="password" v-model="ruleForm.password" placeholder="密码"></el-input>
</el-form-item>
<el-button type="primary" class="submit-button" :loading="loading" @click="handleSubmit">注册</el-button>
</el-form>
</div>
</div>
</template>
<script>
import * as api from '@/api/account'
import countdown from '@/components/countdown.vue'
export default {
name: 'Register',
components: { countdown },
data() {
return {
ruleForm: { name: '', organization: '', job: '', mobile: '', code: '', email: '', password: '' },
rules: {
name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
organization: [{ required: true, message: '请输入机构名称', trigger: 'blur' }],
job: [{ required: true, message: '请输入职务', trigger: 'blur' }],
mobile: [{ required: true, message: '请输入手机号', trigger: 'blur' }],
code: [{ required: true, message: '请输入验证码', trigger: 'blur' }],
email: [{ required: true, message: '请输入邮箱', trigger: 'blur' }],
password: [
{ required: true, message: '请输入登录密码', trigger: 'blur' },
{ min: 6, max: 20, message: '长度为6-20个字符', trigger: 'blur' }
]
},
loading: false
}
},
computed: {
disabledSend() {
const value = this.ruleForm.mobile
return !(/^1[3-9]\d{9}$/.test(value) || /@/.test(value))
}
},
methods: {
// 提交
handleSubmit() {
this.$refs.form.validate().then(this.handleRequest)
},
// 接口请求
handleRequest() {
this.loading = true
api.register(this.ruleForm).then(response => {
response.code === 0 ? this.handleSuccess(response) : this.$message.error(response.msg)
this.loading = false
})
},
// 成功
handleSuccess(response) {
this.$alert('注册成功', '提示', {
type: 'success',
confirmButtonText: '去登录',
callback: action => {
this.$router.push('login')
}
})
},
// 验证码
sendCodeRequest() {
api
.sendCode({ account: this.ruleForm.mobile, signName: 'wmp', template: 'SMS_200186414' })
.then(response => {
console.log(response)
if (response.code === 0) {
this.$message({ type: 'success', message: '验证码已发送' })
} else {
// 停止计时
this.$refs.countdown.stop()
this.$message({ type: 'error', message: response.msg })
}
})
.catch(this.$refs.countdown.stop)
}
}
}
</script>
<style lang="scss" scoped>
.register-form {
margin-top: 20px;
}
</style>
<template>
<div class="wrapper">
<header class="header">
<div class="header-title">
<a :href="url">{{ title }}</a>
</div>
</header>
<section class="main">
<div class="bg"></div>
<div class="inner">
<div class="main-hd hidden-xs-only">
<h1 class="login-title">{{ subTitle }}</h1>
</div>
<div class="main-bd">
<h1 class="login-title">{{ subTitle }}</h1>
<router-view></router-view>
</div>
</div>
</section>
<!-- <footer class="footer">
<p class="t2">
Copyright © 2020 Zijing Education. All rights reserved.
<br />清控紫荆(北京)教育科技股份有限公司 京ICP证150431号 京公网安备 11010802023681号
</p>
</footer> -->
</div>
</template>
......@@ -41,79 +27,66 @@ export default {
</script>
<style lang="scss" scoped>
.header {
padding: 24px 0;
}
.header-title {
font-size: 24px;
color: #c01540;
font-weight: 600;
text-align: center;
a {
text-decoration: none;
color: currentColor;
}
.wrapper {
height: 100vh;
background: url(../assets/login_bg.png) no-repeat center center;
background-size: cover;
}
.main {
position: relative;
.inner {
position: relative;
display: flex;
max-width: 700px;
margin: -200px auto 0;
background-color: #fff;
box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.3);
height: 100vh;
align-items: center;
justify-content: flex-end;
max-width: 1200px;
margin: 0 auto;
}
}
.bg {
height: 360px;
background: url(../assets/login_bg.png) no-repeat center center;
background-size: cover;
}
.main-hd {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 260px;
text-align: center;
background-color: #bb133e;
color: #fff;
}
.login-logo {
margin-bottom: 30px;
}
.login-title {
font-weight: normal;
font-size: 20px;
line-height: 28px;
color: #fff;
margin: 0;
color: #06cae1;
text-align: center;
margin: 0 0 30px;
}
.main-bd {
flex: 1;
padding: 40px;
position: relative;
width: 300px;
padding: 100px 80px 80px;
background: url(../assets/bg.png) no-repeat center center;
background-size: 100% 100%;
}
.footer {
padding: 20px 10px;
text-align: center;
.t1 {
color: #535353;
.wrapper {
color: rgba(255, 255, 255, 0.4);
::v-deep .el-button--primary {
background: #33a0fe;
border-color: #33a0fe;
}
.t2 {
margin-top: 10px;
color: #898989;
::v-deep .el-input__inner {
color: #fff;
background-color: rgba(33, 116, 243, 0.4) !important;
border-color: rgba(0, 255, 255, 0.4) !important;
}
}
@media (max-width: 768px) {
.bg {
height: 215px;
::v-deep .el-input__inner:-webkit-autofill {
box-shadow: 0 0 0 30px #103379 inset !important;
-webkit-text-fill-color: #fff !important;
}
::v-deep .el-input__icon {
color: rgba(0, 255, 255, 0.4);
}
::v-deep .el-checkbox__input .el-checkbox__inner {
border-color: #33a0fe;
background-color: transparent;
}
.main .inner {
margin: -120px 20px 0;
::v-deep .el-checkbox__input.is-checked .el-checkbox__inner {
background-color: #33a0fe;
}
.main-bd {
padding: 20px;
::v-deep .el-checkbox__input + .el-checkbox__label {
color: #33a0fe;
}
}
</style>
......@@ -6,7 +6,7 @@
export default {
data() {
return {
title: '用户登录'
title: '录'
}
},
methods: {
......
......@@ -306,5 +306,33 @@ export default [
children: [{ path: '', component: password }]
}
]
},
// prp
{
path: '/prp',
component: () => import(/* webpackChunkName: "prp" */ '../pages/prp/components/layout.vue'),
children: [
{ path: '', redirect: 'login/index' },
{
path: 'login',
component: () => import(/* webpackChunkName: "prp" */ '../pages/prp/login.vue'),
children: [
{ path: '', redirect: 'index' },
{ path: 'index', component: loginAccount },
{ path: 'code', component: loginCode, props: { sendcode: { signName: 'prp', template: 'SMS_200181319' } } }
]
},
{
path: 'password',
component: () => import(/* webpackChunkName: "prp" */ '../pages/prp/password.vue'),
children: [
{ path: '', component: password, props: { sendcode: { signName: 'prp', template: 'SMS_200191908' } } }
]
},
{
path: 'register',
component: () => import(/* webpackChunkName: "prp" */ '../pages/prp/register.vue')
}
]
}
]
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论