u_info.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <div class="w-full">
  3. <div class="page-header">
  4. <div class="page-title flex align-center">
  5. <el-button icon="el-icon-back" size="mini" style="font-size: 20px; color: #000;" type="text" @click="toBack" ></el-button>
  6. <el-divider direction="vertical"></el-divider>
  7. 个人信息管理
  8. </div>
  9. <div class="page-header-btn">
  10. <el-button @click="logout">注销</el-button>
  11. </div>
  12. </div>
  13. <div class="u-container">
  14. <div class="u-i-info">
  15. <h2>欢迎回来
  16. <span class="text-ornament">【</span>
  17. <span class="text-user">{{username}}</span>
  18. <span class="text-ornament">】</span>
  19. </h2>
  20. </div>
  21. <div class="u-i-info">
  22. <el-button @click="changePassword">修改密码</el-button>
  23. </div>
  24. </div>
  25. <change-password ref="changePasswordDialog"></change-password>
  26. </div>
  27. </template>
  28. <script>
  29. import api_user from "@/apiStore/api_user";
  30. import handle from "@/until/handle";
  31. import ChangePassword from "@/components/dialog/changePassword";
  32. import userService from "@/components/service/UserService";
  33. export default {
  34. name: "u_info",
  35. components: {ChangePassword},
  36. data(){
  37. return {
  38. username: ""
  39. }
  40. },
  41. beforeMount() {
  42. let u = userService.getUser();
  43. this.username = u.username;
  44. },
  45. methods:{
  46. toBack(){
  47. this.$router.back();
  48. // if (this.alarmId === "") {
  49. // this.beforeUrl = "/"
  50. // }
  51. },
  52. async logout() {
  53. console.log('----------')
  54. await handle(api_user.logout(this))
  55. },
  56. changePassword() {
  57. this.$refs.changePasswordDialog.openDialog()
  58. },
  59. }
  60. }
  61. </script>
  62. <style scoped>
  63. .u-container{
  64. background: #fff;
  65. width: 100%;
  66. text-align: left;
  67. padding: 5px;
  68. box-sizing: border-box;
  69. }
  70. </style>