44 <span class =" el-dropdown-link" >
55 <img src =" ../../assets/img/user/user.png" alt =" 管理员头像" class =" nav-avatar" >
66 </span >
7- <el-dropdown-menu slot =" dropdown" class =" user-box" style =" border :none ;
8- background-color :none ;
9- background :transparent ;
10- margin-bottom :0 ;
11- padding-bottom :0 ; " >
7+ <el-dropdown-menu slot =" dropdown" class =" user-box" >
128 <div class =" user-info" >
139 <img src =" ../../assets/img/user/user.png" class =" avatar" alt =" 管理员头像" >
1410 <div class =" text" >
1511 <div class =" username" >{{nickname}}</div >
1612 <div class =" desc" >{{title}}</div >
1713 </div >
18- <img src =" ../../assets/img/user/corner.png" class =" corner" / >
14+ <img src =" ../../assets/img/user/corner.png" class =" corner" >
1915 </div >
2016 <ul class =" dropdown-box" >
21- <li class =" password" @click =" changePassword" >
17+ <li class =" password" @click =" changePassword" >
2218 <i class =" iconfont icon-weibaoxitongshangchuanlogo-" ></i >
2319 <span >修改登录密码</span >
2420 </li >
2925 </ul >
3026 </el-dropdown-menu >
3127 </el-dropdown >
32- <el-dialog
28+ <el-dialog
3329 title =" 修改密码"
3430 :append-to-body =" true"
3531 :before-close =" handleClose"
36- :visible.sync =" dialogFormVisible" >
37- < el-divider style = " margin-top : -20 px ; margin-bottom : 20 px ; " ></ el-divider >
32+ :visible.sync =" dialogFormVisible"
33+ class = " user-dialog " >
3834 <el-form
3935 :model =" form"
4036 status-icon
4137 :rules =" rules"
4238 label-position =" left"
4339 ref =" form"
44- label-width =" 100px "
40+ label-width =" 90px "
4541 @submit.native.prevent >
4642 <el-form-item label =" 原始密码" prop =" old_password" >
4743 <el-input type =" password" v-model =" form.old_password" autocomplete =" off" ></el-input >
5854 </el-form-item >
5955 </el-form >
6056 </el-dialog >
57+
6158 </div >
6259</template >
6360
@@ -67,7 +64,8 @@ import User from '@/lin/models/user'
6764
6865export default {
6966 data () {
70- const oldPassword = (rule , value , callback ) => { // eslint-disable-line
67+ const oldPassword = (rule , value , callback ) => {
68+ // eslint-disable-line
7169 if (! value) {
7270 return callback (new Error (' 原始密码不能为空' ))
7371 }
@@ -135,15 +133,20 @@ export default {
135133 window .location .href = origin
136134 },
137135 submitForm (formName ) {
138- if (this .form .old_password === ' ' && this .form .new_password === ' ' && this .form .confirm_password === ' ' ) {
136+ if (
137+ this .form .old_password === ' '
138+ && this .form .new_password === ' '
139+ && this .form .confirm_password === ' '
140+ ) {
139141 this .dialogFormVisible = false
140142 return
141143 }
142144 if (this .form .old_password === this .form .new_password ) {
143145 this .$message .error (' 新密码不能与原始密码一样' )
144146 return
145147 }
146- this .$refs [formName].validate (async (valid ) => { // eslint-disable-line
148+ this .$refs [formName].validate (async (valid ) => {
149+ // eslint-disable-line
147150 if (valid) {
148151 const res = await User .updatePassword (this .form )
149152 if (res .error_code === 0 ) {
@@ -180,20 +183,34 @@ export default {
180183}
181184 </script >
182185
183- <style lang="scss">
186+ <style lang="scss" scoped>
187+ .user-dialog /deep/ .el-dialog .el-dialog__header {
188+ border-bottom : 1px solid #dae1ed ;
189+ padding-bottom :20px ;
190+ }
184191
185- .el-dropdown-link {
186- cursor : pointer ;
192+ .user-dialog /deep/ .el-dialog .el-dialog__body {
193+ padding-bottom :00px ;
194+ }
187195
188- .nav-avatar {
189- width : 40px ;
190- height : 40px ;
191- margin-right : 10px ;
196+ .user {
197+ .el-dropdown-link {
198+ cursor : pointer ;
199+
200+ .nav-avatar {
201+ width : 40px ;
202+ height : 40px ;
203+ margin-right : 10px ;
204+ }
192205 }
193206}
194207
195208.user-box {
196209 width : 326px ;
210+ background-color : none ;
211+ background : transparent ;
212+ margin-bottom : 0 ;
213+ padding-bottom : 0 ;
197214 border : none ;
198215
199216 .user-info {
0 commit comments