From 447a59c76ab12961bce6ae2f9ca6c5cce1905ad8 Mon Sep 17 00:00:00 2001 From: luobisheng <727299681@qq.com> Date: 星期四, 24 十一月 2022 18:00:42 +0800 Subject: [PATCH] 修改密码 --- src/views/systemSetting/device/point/index.vue | 75 ++---------------- src/views/layout/components/Header/updatePassword/index.vue | 136 +++++++++++----------------------- src/views/operate/message/myIndex/update/index.vue | 4 + src/api/users.js | 8 ++ 4 files changed, 67 insertions(+), 156 deletions(-) diff --git a/src/api/users.js b/src/api/users.js index 0aa85ac..1252c53 100644 --- a/src/api/users.js +++ b/src/api/users.js @@ -10,5 +10,13 @@ getMenu: (params) => { return http.get('/sccg/admin/info', params); + }, + + updatePassword: (params) => { + return http.post('/sccg/admin/updatePassword', params); + }, + + logout: () => { + return http.post('/sccg/admin/logout'); } }; \ No newline at end of file diff --git a/src/views/layout/components/Header/updatePassword/index.vue b/src/views/layout/components/Header/updatePassword/index.vue index bd9562e..cfe2094 100644 --- a/src/views/layout/components/Header/updatePassword/index.vue +++ b/src/views/layout/components/Header/updatePassword/index.vue @@ -2,116 +2,69 @@ <div class="createUser"> <main> <div class="mainContent"> - <el-form ref="user" label-width="140px" :rules="createCarRules" autoComplete="on" :model="car" + <el-form ref="password" label-width="140px" :rules="passwordRules" autoComplete="on" :model="password" label-position="right"> - <!-- 杞︾墝鍙� --> - <el-form-item class="optionItem" label="褰撳墠瀵嗙爜:" prop="carNumber"> - <el-input v-model="car.carNumber" placeholder="璇峰~鍐欏綋鍓嶅瘑鐮�"></el-input> + <el-form-item class="optionItem" label="褰撳墠瀵嗙爜:" prop="oldPassword"> + <el-input type="password" v-model="password.oldPassword" placeholder="璇峰~鍐欏綋鍓嶅瘑鐮�"></el-input> </el-form-item> - <!-- 鎵�灞為儴闂� --> - <el-form-item class="optionItems" label="鏂板瘑鐮�:" prop="depart"> - <el-input v-model="car.depart" placeholder="璇峰~鍐欐柊瀵嗙爜"></el-input> + <el-form-item class="optionItems" label="鏂板瘑鐮�:" prop="newPassword"> + <el-input type="password" v-model="password.newPassword" placeholder="璇峰~鍐欐柊瀵嗙爜"></el-input> </el-form-item> - <!-- 鎵�灞炲ぇ闃� --> - <el-form-item class="optionItems" label="纭畾鏂板瘑鐮�:" prop="belong"> - <el-input v-model="car.belong" placeholder="璇蜂簩娆″~鍐欐柊瀵嗙爜"></el-input> + <el-form-item class="optionItems" label="纭畾鏂板瘑鐮�:" prop="confirmPassword"> + <el-input type="password" v-model="password.confirmPassword" placeholder="璇峰啀娆″~鍐欐柊瀵嗙爜"></el-input> </el-form-item> + <el-form-item class="optionItems"> + <el-button type="primary" @click="onSubmit">鎻愪氦</el-button> + </el-form-item> </el-form> </div> </main> </div> </template> <script> -import {validateCarNum,validatePhone,validateName} from '@/utils/validate' +import users from "@/api/users"; + export default { data() { - const checkCarNum = (rule, value, callback) => { - if (value) { - if(validateCarNum(value)){ - callback() - }else{ - callback(new Error('璇疯緭鍏ユ纭殑瀵嗙爜')); - } - } else { - callback(new Error('瀵嗙爜涓嶈兘涓虹┖')); - } - } - const checkName = (rule, value, callback) => { - if (value) { - if(validateName(value)){ - callback() - }else{ - callback(new Error('璇疯緭鍏ユ纭殑瀵嗙爜')); - } - } else { - callback(new Error('鏂板瘑鐮佷笉鑳戒负绌�')); - } - } - const checkUser = (rule, value, callback) => { - if (value) { - if(validateName(value)){ - callback() - }else{ - callback(new Error('璇疯緭鍏ユ纭殑瀵嗙爜')); - } - } else { - callback(new Error('鏂板瘑鐮佷笉鑳戒负绌�')); - } - } - const checkPhone = (rule, value, callback) => { - if (value) { - if(validatePhone(value)){ - callback() - }else{ - callback(new Error('璇疯緭鍏ユ纭殑鎵嬫満鍙�')); - } - } else { - callback(new Error('鎵嬫満鍙风爜涓嶈兘涓虹┖')); - } - } return { - car: { - }, - createCarRules: { - carNumber: [ - { - required: true, trigger:'blur', validator: checkCarNum - } - ], - contact: [ - { - required: true,trigger:'blur', validator: checkPhone - } - ], - // id: 0, - ownerName: [ - { - required: true,trigger:'blur', validator: checkName - } - ], - vehicleUser: [ - { - required: true,trigger:'blur', validator: checkUser - } - ] - }, - teamList: [ - { - label: '澶ч槦涓�', - value: 1, - }, - { - label: '澶ч槦浜�', - value: 2, - }, - ] + password: { + oldPassword: null, + newPassword: null, + confirmPassword: null + }, + passwordRules: { + newPassword: [{ required: true, trigger: 'blur', message: '瀵嗙爜涓嶈兘涓虹┖' }], + oldPassword: [{ required: true, trigger: 'blur', message: '鏂板瘑鐮佷笉鑳戒负绌�' }], + confirmPassword: [{ required: true, trigger: 'blur', message: '鏂板瘑鐮佷笉鑳戒负绌�' }], + }, } }, created() { }, methods: { + onSubmit() { + this.$refs.password.validate(valid => { + if (valid) { + const userName = JSON.parse(sessionStorage.getItem('name')); + const passwordParams = Object.assign({}, this.password); + delete passwordParams.confirmPassword; + users.updatePassword({ username: userName, ...passwordParams }) + .then(() => { + this.$message.success('淇敼瀵嗙爜鎴愬姛, 鍗冲皢閲嶆柊鐧诲綍'); + this.logout(); + }) + .catch(err => this.$message.error(err)) + } + }) + }, + logout() { + users.logout() + .then(() => { + sessionStorage.clear(); + }) + .catch(err => this.$message.error(err)) + } }, - // props: ['info'] } </script> <style lang="scss" scoped> @@ -120,7 +73,6 @@ background-color: #09152f; main { - // border: 1px solid #fff; text-align: left; padding: 0 55px; background-color: #09152f; diff --git a/src/views/operate/message/myIndex/update/index.vue b/src/views/operate/message/myIndex/update/index.vue index f8a1f91..92f232e 100644 --- a/src/views/operate/message/myIndex/update/index.vue +++ b/src/views/operate/message/myIndex/update/index.vue @@ -289,6 +289,9 @@ targetTo: this.checkedList.join(","), status: mystatus, }; + if (this.role.channelCode === '03') { + delete params.messageType; + } if (this.type === "create") { sendMessage(params) .then(() => { @@ -340,6 +343,7 @@ // 娑堟伅棰勮 handleView() { + this.role.body = this.$refs.edit.editor.txt.html(); this.$refs.user.validate((valid) => { if (valid) { const { body, head, channelCode } = this.role; diff --git a/src/views/systemSetting/device/point/index.vue b/src/views/systemSetting/device/point/index.vue index 925d4b3..aaf86a2 100644 --- a/src/views/systemSetting/device/point/index.vue +++ b/src/views/systemSetting/device/point/index.vue @@ -1,27 +1,20 @@ <template> <el-container style="height: 100%;"> <el-aside heigth="100%" width="200px "> - <div style="line-height: 40px;text-align: left;padding: 0 20px 0 10px;"> - <span style="color:rgb(75, 155, 183);font-weight: 500; width: 196px;">缁勭粐鏈烘瀯</span> - <el-input placeholder="璇疯緭鍏ユ満鏋�"></el-input> - </div> - <el-tree :data="treedata" :props="defaultProps" @node-click="handleNodeClick"></el-tree> - - + <department-aside /> </el-aside> <el-container> <el-header style="display:flex;flex-direction: column;height: 120px;"> <div style="display:flex;justify-content: space-between;height: 80px;"> <span style="color:rgb(75, 155, 183);font-weight: 450;text-align: left; font-size: 16px;">褰撳墠鍏�8涓洃鎺х偣浣嶏紝鏈�澶氶厤缃�100璺棰戠洃鎺э紝鐩墠宸茬粡閰嶇疆200璺棰戠偣</span> - <!-- <el-button type="primary" >鍒犻櫎</el-button> --> </div> <div style="height:60px;display: flex;justify-content: flex-start;"> </div> </el-header> <el-main style="display:flex;flex-wrap: wrap;overflow-y: scroll;"> - <div v-for="item in videoDate " style="height: 240px ;width: 210px; position: relative;margin-left:20px ;"> + <div v-for="item in videoData " style="height: 240px ;width: 210px; position: relative;margin-left:20px ;"> <div style="color:rgb(75, 155, 183); font-size: 11px;line-height: 18px; position: absolute; z-index: 1;left: 50px;"> {{ item.steert }}{{ item.community }}</div> @@ -36,8 +29,8 @@ </el-main> <el-footer> <div style="margin-bottom:0;"> - <el-pagination background :current-page="currentPage" layout="prev, pager, next" :total="totalNum" - :page-size="pageSize" @current-change="changeCurrentPage" @prev-click="handlePrev" @next-click="handleNext"> + <el-pagination :current-page="currentPage" layout="prev, pager, next" :total="totalNum" + :page-size="pageSize"> </el-pagination> </div> </el-footer> @@ -143,14 +136,17 @@ color: rgb(75, 155, 183); } </style> -<script src="https://vjs.zencdn.net/7.20.3/video.min.js"></script> <script> +import departmentAside from "@/views/operate/fivepack/threepack/components/aside"; + export default { + components: { departmentAside }, data() { return { - totalNum:7, - pageSize:10, - videoDate:[ + currentPage: 1, + totalNum: 7, + pageSize: 10, + videoData:[ { id:12, steert:"xx琛楅亾", @@ -210,55 +206,6 @@ videoUrl:"http://vali-g1.cp31.ott.cibntv.net/youku/65730720cb94e7220271a3c96/0300080100632D30A3E43019FD116537F5162F-1035-48AC-BE1B-602DF0E92893.mp4?sid=166729534400010004780_00_Bda935cf9a33346c593fc27da8e694df3&sign=db39289573d143cf6e1ad8d8dff36682&ctype=50&si=183&psid=c732c4364319e7ef4685d8f1a568015941346" } ], - treedata: [{ - label: '濡欓珮琛楅亾', - children: [{ - label: '鍖楄鏉�', - children: [{ - label: '铻鸿洺鍨�' - }] - },{ - label: '涓滆鏉�', - children: [{ - label: '铻鸿洺鍨�' - }] - },{ - label: '鍙ら櫌绀惧尯', - children: [{ - label: '铻鸿洺鍨�' - }] - }] - }, { - label: '浜戝嘲琛楅亾', - children: [{ - label: '涓滀涵', - children: [{ - label: '闅旀邯' - }] - }, { - label: '椹ご', - children: [{ - label: '榫欏彛' - }] - }] - }, { - label: '鏂拌矾婀鹃晣', - children: [{ - label: '鏂拌矾婀鹃晣', - children: [{ - label: '鏂拌矾婀鹃晣' - }] - }, { - label: '鏂拌矾婀鹃晣', - children: [{ - label: '鏂拌矾婀鹃晣' - }] - }] - }], - defaultProps: { - children: 'children', - label: 'label' - }, value:'' }; }, -- Gitblit v1.8.0