123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716 |
- <template>
-
- <div>
- <div class="box-bon">
- <div class="top-btm-box" v-if="changePassword"></div>
- </div>
- <div class="tal-top">
- <span class="tal-first">Добро пожаловать на общее собрание!</span>
- <span class="tal-second" @click="goOut">
- <img src="@/assets/ballot/退出.png" alt="" />
- выйти</span
- >
- <span class="tal-third">|</span>
- <span class="tal-fourc" @click="openChange">
- <img src="@/assets/ballot/修改密码.png" alt="" />
- Изменить пароль</span
- >
- </div>
-
- <div class="box-big" v-if="changePassword">
- <div class="change-top">
- <!-- <div class="change-box">
- <el-select v-model="language.value" class="change-change">
- <el-option v-for="item in optionsInfoList" :key="item.value" :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </div> -->
- <div></div>
- <div class="change-text">Изменить пароль</div>
- <div class="change-pic" @click="closeList">
- <img src="@/assets/ballot/close-l.png" alt="" />
- </div>
- </div>
- <div class="change-user-info">
- <div class="change-user-id">
- <div class="change-title">Старый пароль:</div>
- <el-input
- v-model="changeList.oldPassword"
- placeholder="Введите старый пароль"
- show-password
- >
- </el-input>
- </div>
- <div class="change-user-pws">
- <div class="change-title">Новый пароль:</div>
- <el-input
- placeholder="Введите новый пароль"
- v-model="changeList.password"
- show-password
- @blur="getInp"
- ></el-input>
- </div>
- <div class="change-user-yzm">
- <div class="change-title">Подтвердить:</div>
- <el-input
- placeholder="Подтвердить ваш новый пароль"
- v-model="changeList.newPassword"
- show-password
- >
- </el-input>
- </div>
- <div class="user-change">Требования к паролям:</div>
- <div class="user-long">1. от 8 до 20 символов</div>
- <div class="user-style">
- 2. Пароль должен содержать как минимум три категории
- символов из следующих:заглавные и строчные буквы, цифры и специальные
- символы. Ваш пароль должен соответствовать требованиям к безопасности
- </div>
- <div class="user-change-pic" @click="sureChange" v-if="getDisabled">
- Сохранить
- </div>
- <div class="user-change-pic" @click="sureToChange" v-else>
- Сохранить
- </div>
- </div>
- <div class="change-btm-pic">
- <img src="@/assets/ballot/未标题-2.png" alt="" />
- </div>
- </div>
- </div>
- </template>
- <script>
- import { BallotChanges } from '@/api/ballot/ballot'
- export default {
- name: 'ballotLogin',
- data() {
- return {
- getDisabled: false,
- changePassword: false,
- optionsInfoList: [
- {
- value: 'CN',
- label: '中文',
- },
- {
- value: 'EN',
- label: 'English',
- },
- {
- value: 'FR',
- label: 'Français',
- },
- {
- value: 'RU',
- label: 'Русский',
- },
- ],
- language: {
- value: 'RU',
- },
- changeList: {
- id: undefined,
- oldPassword: undefined,
- password: undefined,
- newPassword: undefined,
- },
- }
- },
- mounted() {
- let language = sessionStorage.getItem('language')
- this.language.value = language
- },
- methods: {
- getInp() {
- let value = this.changeList.password
- console.log(value)
- if (value == '' || value == undefined || value == null) {
- this.$message.error(
- 'Пожалуйста, введите пароль от 8 до 20 символов. Пароль должен содержать как минимум три категории символов:заглавные и строчные буквы, цифры и специальные символы.'
- )
- } else {
- const reg =
- /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[~!@#$%^&*_+\?<>:"\{\}\|\\';/\.,`=-])[^\u4E00-\u9FA5][A-Za-z\d~!@#$%^&*_+\?<>:"\{\}\|\\';/\.,`=-]{7,19}$/
- console.log(reg.test(value))
- if (!reg.test(value)) {
- this.$message.error(
- 'Пожалуйста, введите пароль от 8 до 20 символов. Пароль должен содержать как минимум три категории символов:заглавные и строчные буквы, цифры и специальные символы.'
- )
- } else {
- this.$message.success('Правильный код!')
- this.getDisabled = true
- }
- }
- },
- goOut() {
- sessionStorage.removeItem('language')
- sessionStorage.removeItem('mettingUser')
- sessionStorage.removeItem('item')
- sessionStorage.removeItem('lastList')
- localStorage.removeItem('language')
- localStorage.removeItem('mettingUser')
- localStorage.removeItem('item')
- localStorage.removeItem('lastList')
- this.$message.success('Выход, пожалуйста...')
- setTimeout(() => {
- this.$router.push({ path: 'home' })
- }, 1500)
- },
- openChange() {
- this.changePassword = true
- },
- closeList() {
- this.changeList.oldPassword = ''
- this.changeList.password = ''
- this.changeList.newPassword = ''
- this.changePassword = false
- },
- sureToChange() {
- this.$message.error(
- 'Пожалуйста, введите пароль от 8 до 20 символов. Пароль должен содержать как минимум три категории символов:заглавные и строчные буквы, цифры и специальные символы.'
- )
- },
- sureChange() {
- if (this.changeList.password != this.changeList.newPassword) {
- this.$message.error('Два неверных пароля, пожалуйста, введите снова!')
- } else {
- let id = JSON.parse(sessionStorage.getItem('mettingUser')).userId
- let params = {
- id: id,
- oldPassword: this.changeList.oldPassword,
- password: this.changeList.password,
- }
- console.log(params)
- BallotChanges(params)
- .then((res) => {
- console.log(res)
- this.$message.success('Удачная модификация')
- let params = JSON.stringify(params)
- sessionStorage.setItem('userPassword', [params])
- setTimeout(() => {
- this.goOut()
- }, 1500)
- })
- .catch((error) => {
- console.log(error)
- this.$message.error('Ошибка при введении исходного кода')
- })
- }
- },
- },
- }
- </script>
- <style scoped>
- @media screen and (min-width: 1080px) {
- .tal-top {
- width: 100%;
- height: 40px;
- background-color: #155199;
- }
- .box-bon {
- position: relative;
- }
- .top-btm-box {
- width: 100%;
- height: 1298px;
- background-color: #000;
- opacity: 0.5;
- z-index: 998;
- position: absolute;
- top: -100%;
- }
- .tal-first {
- display: inline-block;
- /* width: 140px; */
- height: 40px;
- font-size: 15px;
- text-align: center;
- line-height: 40px;
- color: #fff;
- margin-left: 45.5%;
- margin-right: 3%;
- }
- .tal-second {
- display: inline-block;
- height: 40px;
- font-size: 15px;
- text-align: center;
- line-height: 40px;
- color: #fff;
- cursor: pointer;
- font-weight: 600;
- }
- .tal-second > img {
- width: 16px;
- height: 16px;
- transform: translateY(3px);
- }
- .tal-third {
- display: inline-block;
- height: 40px;
- text-align: center;
- line-height: 40px;
- color: #fff;
- margin-left: 1%;
- margin-right: 1%;
- }
- .tal-fourc {
- display: inline-block;
- height: 40px;
- font-size: 15px;
- text-align: center;
- line-height: 40px;
- color: #fff;
- cursor: pointer;
- font-weight: 600;
- }
- .tal-fourc > img {
- width: 20px;
- height: 20px;
- transform: translateY(5px);
- }
- .box-big {
- margin: 50px auto;
- width: 650px;
- height: 570px;
- background: linear-gradient(0deg, #00b4ff 0%, #094fc0 100%);
- box-shadow: 0px -2px 4px 0px rgba(0, 0, 0, 0.5);
- overflow: hidden;
- z-index: 999;
- position: absolute;
- top: 50px;
- left: 50%;
- transform: translateX(-50%);
- }
- .change-top {
- width: 650px;
- height: 81px;
- background: #f5f5f5;
- border-radius: 4px 4px 0px 0px;
- position: relative;
- }
- .change-change {
- width: 120px;
- height: 41px;
- line-height: 41px;
- font-size: 14px;
- transform: translateX(30px) translateY(20px);
- }
- .change-text {
- width: 260px;
- height: 20px;
- text-align: center;
- font-size: 20px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #262626;
- line-height: 20px;
- position: absolute;
- top: 32px;
- left: 191px;
- }
- .change-pic {
- width: 25px;
- height: 24px;
- text-align: center;
- overflow: hidden;
- border-radius: 20px;
- cursor: pointer;
- position: absolute;
- top: 32px;
- right: 21px;
- }
- .change-pic > img {
- width: 100%;
- height: 100%;
- }
- .change-user-info {
- width: 650px;
- height: 508px;
- padding: 0 40px;
- }
- .change-item-id {
- width: 570px;
- height: 51px;
- margin-top: 10px;
- position: relative;
- }
- .change-user-id {
- width: 570px;
- height: 51px;
- margin-top: 10px;
- position: relative;
- }
- .change-user-id {
- width: 570px;
- height: 51px;
- margin-top: 20px;
- position: relative;
- }
- .change-user-pws {
- width: 570px;
- height: 51px;
- margin-top: 20px;
- position: relative;
- }
- .change-user-yzm {
- width: 570px;
- height: 51px;
- margin-top: 20px;
- position: relative;
- }
- .change-title {
- height: 39px;
- line-height: 39px;
- z-index: 997;
- width: 120px;
- font-size: 13px;
- text-align: left;
- border-radius: 10px;
- position: absolute;
- top: 0;
- left: 8px;
- }
- .user-change-pic {
- width: 570px;
- height: 59px;
- text-align: center;
- line-height: 59px;
- cursor: pointer;
- font-size: 24px;
- color: #fff;
- margin-top: 80px;
- background: linear-gradient(177deg, #84e2ff 0%, #30ade8 100%);
- box-shadow: 0px 2px 4px 0px #097fb0,
- inset 0px 3px 3px 0px rgba(194, 235, 255, 0.63);
- border-radius: 8px;
- }
- .user-change {
- width: 570px;
- height: 16px;
- font-size: 16px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 16px;
- margin-left: 10px;
- }
- .user-style {
- width: 570px;
- height: 24px;
- font-size: 16px;
- margin-top: 10px;
- margin-left: 10px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 24px;
- }
- .user-long {
- width: 570px;
- height: 20px;
- font-size: 16px;
- margin-top: 10px;
- margin-left: 10px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 20px;
- }
- .change-btm-pic {
- width: 100%;
- position: absolute;
- top: 535px;
- }
- .change-btm-pic > img {
- width: 100%;
- }
- /deep/.change-user-info .el-input__inner {
- padding-left: 140px;
- background-color: #f5f5f5;
- }
- }
- @media screen and (max-width: 1079px) {
- .tal-top {
- width: 100%;
- height: 40px;
- background-color: #155199;
- }
- .box-bon {
- position: relative;
- }
- .top-btm-box {
- width: 100%;
- height: 1298px;
- background-color: #000;
- opacity: 0.5;
- z-index: 998;
- position: absolute;
- top: -100%;
- }
- .tal-first {
- display: inline-block;
- /* width: 140px; */
- height: 40px;
- font-size: 15px;
- text-align: center;
- line-height: 40px;
- color: #fff;
- margin-left: 45.5%;
- margin-right: 3%;
- }
- .tal-second {
- display: inline-block;
- height: 40px;
- font-size: 15px;
- text-align: center;
- line-height: 40px;
- color: #fff;
- cursor: pointer;
- font-weight: 600;
- }
- .tal-second > img {
- width: 16px;
- height: 16px;
- transform: translateY(3px);
- }
- .tal-third {
- display: inline-block;
- height: 40px;
- text-align: center;
- line-height: 40px;
- color: #fff;
- margin-left: 1%;
- margin-right: 1%;
- }
- .tal-fourc {
- display: inline-block;
- height: 40px;
- font-size: 15px;
- text-align: center;
- line-height: 40px;
- color: #fff;
- cursor: pointer;
- font-weight: 600;
- }
- .tal-fourc > img {
- width: 20px;
- height: 20px;
- transform: translateY(5px);
- }
- .box-big {
- margin: 50px auto;
- width: 650px;
- height: 570px;
- background: linear-gradient(0deg, #00b4ff 0%, #094fc0 100%);
- box-shadow: 0px -2px 4px 0px rgba(0, 0, 0, 0.5);
- overflow: hidden;
- z-index: 999;
- position: absolute;
- top: 50px;
- left: 200px;
- }
- .change-top {
- width: 650px;
- height: 81px;
- background: #f5f5f5;
- border-radius: 4px 4px 0px 0px;
- position: relative;
- }
- .change-change {
- width: 120px;
- height: 41px;
- line-height: 41px;
- font-size: 14px;
- transform: translateX(30px) translateY(20px);
- }
- .change-text {
- width: 260px;
- height: 20px;
- text-align: center;
- font-size: 20px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #262626;
- line-height: 20px;
- position: absolute;
- top: 32px;
- left: 191px;
- }
- .change-pic {
- width: 25px;
- height: 24px;
- text-align: center;
- overflow: hidden;
- border-radius: 20px;
- cursor: pointer;
- position: absolute;
- top: 32px;
- right: 21px;
- }
- .change-pic > img {
- width: 100%;
- height: 100%;
- }
- .change-user-info {
- width: 650px;
- height: 508px;
- padding: 0 40px;
- }
- .change-item-id {
- width: 570px;
- height: 51px;
- margin-top: 10px;
- position: relative;
- }
- .change-user-id {
- width: 570px;
- height: 51px;
- margin-top: 10px;
- position: relative;
- }
- .change-user-id {
- width: 570px;
- height: 51px;
- margin-top: 20px;
- position: relative;
- }
- .change-user-pws {
- width: 570px;
- height: 51px;
- margin-top: 20px;
- position: relative;
- }
- .change-user-yzm {
- width: 570px;
- height: 51px;
- margin-top: 20px;
- position: relative;
- }
- .change-title {
- height: 39px;
- line-height: 39px;
- z-index: 997;
- width: 120px;
- font-size: 13px;
- text-align: left;
- border-radius: 10px;
- position: absolute;
- top: 0;
- left: 8px;
- }
- .user-change-pic {
- width: 570px;
- height: 59px;
- text-align: center;
- line-height: 59px;
- cursor: pointer;
- font-size: 24px;
- color: #fff;
- margin-top: 80px;
- background: linear-gradient(177deg, #84e2ff 0%, #30ade8 100%);
- box-shadow: 0px 2px 4px 0px #097fb0,
- inset 0px 3px 3px 0px rgba(194, 235, 255, 0.63);
- border-radius: 8px;
- }
- .user-change {
- width: 570px;
- height: 16px;
- font-size: 16px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 16px;
- margin-left: 10px;
- }
- .user-style {
- width: 570px;
- height: 24px;
- font-size: 16px;
- margin-top: 10px;
- margin-left: 10px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 24px;
- }
- .user-long {
- width: 570px;
- height: 20px;
- font-size: 16px;
- margin-top: 10px;
- margin-left: 10px;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #333333;
- line-height: 20px;
- }
- .change-btm-pic {
- width: 100%;
- position: absolute;
- top: 535px;
- }
- .change-btm-pic > img {
- width: 100%;
- }
- /deep/.change-user-info .el-input__inner {
- padding-left: 140px;
- background-color: #f5f5f5;
- }
- }
- </style>
|