123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- <template>
- <div>
- <div class="box">
- <div class="toptext">{{$t('application.Reset')}}</div>
- <div class="centerbox">
- <el-input class="cen_email" :placeholder="$t('application.New')" v-model="password" show-password></el-input>
- <el-input class="cen_email" :placeholder="$t('application.Confirm')" v-model="confirmPassword" show-password></el-input>
- <button class="cen_button" v-loading.fullscreen.lock="fullscreenLoading" @click="appli">{{$t('application.Submit')}}</button>
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- components: {
- },
- name: 'applications',
- data () {
- return {
- code: '',
- email: '',
- password: '',
- confirmPassword: '',
- fullscreenLoading: false
- }
- },
- methods: {
- verification () {
- if (!this.password) {
- this.$message.error(this.$t('register.Password') + this.$t('register.Cannot'))
- return false
- } else if (!this.$util.passwordValid(this.password)) {
- this.$message.error(this.$t('register.kinds'))
- return false
- } else if (this.password !== this.confirmPassword) {
- this.$message.error(this.$t('register.inconsistent'))
- return false
- } else {
- return true
- }
- },
- appli () {
- if (this.verification()) {
- var code = this.$route.query.code.split(' ')
- // console.log(code)
- this.fullscreenLoading = true;
- this.$api.post('auth/resetPassword', {
- code: code[0],
- email: this.$route.query.email,
- password: this.password,
- confirmPassword: this.confirmPassword
- }).then((res) => {
- if (res.code == 0) {
- this.$message({
- message: this.$t('register.successfully'),
- type: 'success'
- })
- this.fullscreenLoading = false;
- setTimeout(()=> {
- this.$util.goRoute({
- name: 'login'
- })
- }, 1000)
- } else if (res.code == 302) {
- this.$message.error(this.$t('register.registered'))
- this.fullscreenLoading = false;
- } else if (res.code == 407) {
- this.$message.error(this.$t('message.submitFailed'))
- this.fullscreenLoading = false;
- } else {
- this.$message.error(res.msg)
- this.fullscreenLoading = false;
- }
- })
- }
- }
- },
- mounted () {
- },
- created () {
- }
- }
- </script>
- <style lang="scss" scoped>
- @media screen and (min-width: 751px) and (max-width: 9999px) {
- .box{
- overflow: hidden;
- }
- .toptext{
- margin-top: 3rem;
- font-size: 16px;
- color:
- background:
- font-weight: 700;
- padding: 2rem 0;
- text-align: center;
- }
- .centerbox /deep/{
- width: 100%;
- box-shadow: 2px 3px 8px 0px rgba(180, 180, 180, 0.3);
- background:
- padding: 50px;
- border: 1px solid
- .cen_email{
- width: 40%;
- margin: 0 auto 2rem;
- height: 40px;
- color:
- border: 1px solid
- display: block;
- // text-indent: 1rem;
- border-radius: 4px;
- }
- .cen_button{
- width: 40%;
- margin: 0 auto;
- height: 40px;
- display: block;
- background:
- border: none;
- color:
- border-radius: 4px;
- font-size: 14px;
- }
- }
- }
- @media screen and (min-width: 0px) and (max-width: 750px) {
- .box{
- overflow: hidden;
- }
- .toptext{
- margin-top: 0.1rem;
- height: 0.5rem;
- font-size: 16px;
- color:
- background:
- line-height: 0.5rem;
- text-indent: 0.1rem;
- font-weight: 700;
- }
- .centerbox{
- width: 100%;
- box-shadow: 2px 3px 8px 0px rgba(180, 180, 180, 0.3);
- background:
- padding: 0.3rem;
- border: 1px solid
- .cen_email{
- width: 100%;
- margin: 0 auto 0.2rem;
- height: 40px;
- color:
- border: 1px solid
- display: block;
- // text-indent: 0.1rem;
- border-radius: 4px;
- }
- .cen_button{
- width: 100%;
- margin: 0 auto;
- height: 40px;
- display: block;
- background:
- border: none;
- color:
- border-radius: 4px;
- font-size: 14px;
- }
- }
- }
- </style>
|