diff --git a/src/router/index.js b/src/router/index.js index 5b7ddc9a6de8c1b168af25f0d4e42ab174afa712..78d1b725532e7f8a822982749bd54312d1190704 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,8 +1,7 @@ import Vue from 'vue'; import Router from 'vue-router'; const _import = require('./_import_' + process.env.NODE_ENV); -// in development env not use Lazy Loading,because Lazy Loading large page will cause webpack hot update too slow -// so only in production use Lazy Loading +// in development env not use Lazy Loading,because Lazy Loading large page will cause webpack hot update too slow.so only in production use Lazy Loading /* layout */ import Layout from '../views/layout/Layout'; @@ -10,8 +9,6 @@ import Layout from '../views/layout/Layout'; /* login */ const Login = _import('login/index'); const authRedirect = _import('login/authredirect'); -const sendPWD = _import('login/sendpwd'); -const reset = _import('login/reset'); /* dashboard */ const dashboard = _import('dashboard/index'); @@ -80,8 +77,6 @@ Vue.use(Router); export const constantRouterMap = [ { path: '/login', component: Login, hidden: true }, { path: '/authredirect', component: authRedirect, hidden: true }, - { path: '/sendpwd', component: sendPWD, hidden: true }, - { path: '/reset', component: reset, hidden: true }, { path: '/404', component: Err404, hidden: true }, { path: '/401', component: Err401, hidden: true }, { diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 3f669781cba7abcf586011b5a104b59b3338d99f..faaae648501d6a7507042870b8bbefed2205869d 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -21,9 +21,6 @@ </el-form-item> <div class='tips'>adminè´¦å·ä¸º:admin@wallstreetcn.com 密ç éšä¾¿å¡«</div> <div class='tips'>editorè´¦å·:editor@wallstreetcn.com 密ç éšä¾¿å¡«</div> - <router-link to="/sendpwd" class="forget-pwd"> - 忘记密ç ?(或首次登录) - </router-link> </el-form> <el-dialog title="第三方验è¯" :visible.sync="showDialog"> 邮箱登录æˆåŠŸ,è¯·é€‰æ‹©ç¬¬ä¸‰æ–¹éªŒè¯ @@ -33,9 +30,7 @@ </template> <script> - import { mapGetters } from 'vuex'; import { isWscnEmail } from 'utils/validate'; - // import { getQueryObject } from 'utils'; import socialSign from './socialsignin'; export default { diff --git a/src/views/login/reset.vue b/src/views/login/reset.vue deleted file mode 100644 index 26b1ef34fd30f6e0d3fec47acb1bf1cc5b6c01a2..0000000000000000000000000000000000000000 --- a/src/views/login/reset.vue +++ /dev/null @@ -1,178 +0,0 @@ -<template> - <div class="reset-container"> - <el-form autoComplete="on" :model="resetForm" :rules="resetRules" ref="resetForm" label-position="left" - label-width="0px" - class="card-box reset-form"> - <div> - <router-link to="/login" class="back-icon"> - <i class="el-icon-arrow-left"></i> - </router-link> - <h3 class="title">é‡è®¾å¯†ç </h3> - </div> - <el-form-item prop="email"> - <el-input name="email" type="text" v-model="resetForm.email" - placeholder="邮箱"></el-input> - </el-form-item> - <el-form-item prop="code"> - <el-input name="code" type="text" v-model="resetForm.code" - placeholder="验è¯ç "></el-input> - </el-form-item> - <el-form-item prop="password"> - <el-input name="password" :type="passwordType" v-model="resetForm.password" - placeholder="密ç "></el-input> - </el-form-item> - <el-form-item prop="checkPass"> - <el-input name="checkPass" :type="passwordType" - v-model="resetForm.checkPass" - placeholder="确认密ç "></el-input> - <i @click="togglePasswordType" class="el-icon-information"></i> - </el-form-item> - - <el-form-item style="width:100%;"> - <el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="setPWD"> - 修改密ç - </el-button> - </el-form-item> - </el-form> - </div> -</template> - -<script> - import { isWscnEmail } from 'utils/validate'; - // import { restPWD } from 'api/login'; - - export default { - name: 'reset', - data() { - const validateEmail = (rule, value, callback) => { - if (!isWscnEmail(value)) { - callback(new Error('邮箱错误')); - } else { - callback(); - } - }; - const validaePass = (rule, value, callback) => { - if (value.length < 6) { - callback(new Error('密ç ä¸èƒ½å°äºŽ6ä½')); - } else { - callback(); - } - }; - const validatePass2 = (rule, value, callback) => { - if (value === '') { - callback(new Error('请å†æ¬¡è¾“入密ç ')); - } else if (value !== this.resetForm.password) { - callback(new Error('两次输入密ç ä¸ä¸€è‡´!')); - } else { - callback(); - } - }; - return { - resetForm: { - email: '', - password: '', - checkPass: '', - code: '' - }, - passwordType: 'password', - resetRules: { - email: [ - { required: true, trigger: 'blur', validator: validateEmail } - ], - password: [ - { required: true, trigger: 'blur', validator: validaePass } - ], - checkPass: [ - { required: true, trigger: 'blur', validator: validatePass2 } - ], - code: [ - { required: true, message: '必填项', trigger: 'blur' } - ] - }, - loading: false - } - }, - methods: { - setPWD() { - // this.loading = true; - // const _this = this; - // this.$refs.resetForm.validate(valid => { - // if (valid) { - // const data = { - // email: this.resetForm.email, - // code: this.resetForm.code, - // new_password: this.resetForm.checkPass - // }; - // restPWD(data).then(() => { - // this.$message.success('密ç 设置æˆåŠŸ,五秒åŽè°ƒæ•´åˆ°ç™»å½•é¡µ'); - // setTimeout(() => { - // _this.$router.push({ path: '/login' }) - // }, 5 * 1000) - // }); - // } else { - // this.$message.error('error submit!!'); - // } - // this.loading = false; - // }); - }, - togglePasswordType() { - if (this.passwordType === 'text') { - this.passwordType = 'password' - } else { - this.passwordType = 'text' - } - } - } - } -</script> - -<style rel="stylesheet/scss" lang="scss"> - @import "src/styles/mixin.scss"; - - .reset-container { - input:-webkit-autofill { - -webkit-box-shadow: 0 0 0px 1000px #293444 inset !important; - -webkit-text-fill-color: #3E3E3E !important; - } - @include relative; - height: 100vh; - background-color: #324057; - .back-icon { - float: left; - margin-top: 5px; - } - .el-icon-information { - position: absolute; - right: -18px; - top: 10px; - } - .reset-form { - position: absolute; - left: 0; - right: 0; - width: 350px; - padding: 35px 35px 15px 35px; - margin: 120px auto; - } - - .card-box { - padding: 20px; - box-shadow: 0 0px 8px 0 rgba(0, 0, 0, 0.06), 0 1px 0px 0 rgba(0, 0, 0, 0.02); - -webkit-border-radius: 5px; - border-radius: 5px; - -moz-border-radius: 5px; - background-clip: padding-box; - margin-bottom: 20px; - background-color: #F9FAFC; - width: 400px; - border: 2px solid #8492A6; - } - - .title { - margin: 0px auto 40px auto; - text-align: center; - color: #505458; - } - } - -</style> diff --git a/src/views/login/sendpwd.vue b/src/views/login/sendpwd.vue deleted file mode 100644 index cd26484e59cb7f218872205f48876d2c33446871..0000000000000000000000000000000000000000 --- a/src/views/login/sendpwd.vue +++ /dev/null @@ -1,117 +0,0 @@ -<template> - <div class="sendpwd-container"> - <el-form autoComplete="on" :model="resetForm" :rules="resetRules" ref="resetForm" label-position="left" - label-width="0px" - class="card-box reset-form"> - <div> - <router-link to="/login" class="back-icon"> - <i class="el-icon-arrow-left"></i> - </router-link> - <h3 class="title">å‘é€éªŒè¯ç 至邮箱</h3> - </div> - <el-form-item prop="email"> - <el-input name="email" type="text" v-model="resetForm.email" - placeholder="邮箱"></el-input> - </el-form-item> - - <el-form-item style="width:100%;"> - <el-button type="primary" style="width:100%;" :loading="loading" @click.native.prevent="handleSendPWD"> - å‘é€éªŒè¯ç 至邮箱 - </el-button> - </el-form-item> - <router-link to="/reset"> - <el-button type="info" style="width:100%;"> - 已收到验è¯ç ,去é‡è®¾å¯†ç - </el-button> - </router-link> - </el-form> - </div> -</template> - -<script> - import { isWscnEmail } from 'utils/validate'; - // import { sendPWD2Email } from 'api/login'; - - export default { - name: 'reset', - data() { - const validateEmail = (rule, value, callback) => { - if (!isWscnEmail(value)) { - callback(new Error('请输入æ£ç¡®çš„邮箱')); - } else { - callback(); - } - }; - return { - resetForm: { - email: '' - }, - resetRules: { - email: [ - { required: true, trigger: 'blur' }, - { validator: validateEmail } - ] - }, - loading: false - } - }, - methods: { - handleSendPWD() { - this.loading = true; - this.$refs.resetForm.validate(valid => { - if (valid) { - // sendPWD2Email(this.resetForm.email).then(() => { - // this.$message.success('密ç 有å‘é€è‡³é‚®ç®±,请查收') - // }); - } else { - this.$message.error('错误æ交!!'); - } - this.loading = false; - }); - } - } - } -</script> - -<style rel="stylesheet/scss" lang="scss"> - .sendpwd-container { - height: 100vh; - background-color: #2d3a4b; - input:-webkit-autofill { - -webkit-box-shadow: 0 0 0px 1000px #293444 inset !important; - -webkit-text-fill-color: #3E3E3E !important; - } - .back-icon{ - float: left; - margin-top: 5px; - } - .reset-form { - position: absolute; - left: 0; - right: 0; - width: 350px; - padding: 35px 35px 15px 35px; - margin: 120px auto; - } - - .card-box { - padding: 20px; - box-shadow: 0 0px 8px 0 rgba(0, 0, 0, 0.06), 0 1px 0px 0 rgba(0, 0, 0, 0.02); - -webkit-border-radius: 5px; - border-radius: 5px; - -moz-border-radius: 5px; - background-clip: padding-box; - margin-bottom: 20px; - background-color: #F9FAFC; - width: 400px; - border: 2px solid #8492A6; - } - - .title { - margin: 0px auto 40px auto; - text-align: center; - color: #505458; - } - } - -</style>