index.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <view style="height: 100vh" class="bg-white">
  3. <view class="cu-bar bg-white solid-bottom">
  4. <view class="action">
  5. <text class="cuIcon-title text-orange "></text> 用户信息
  6. </view>
  7. </view>
  8. <view class="cu-list menu">
  9. <view class="cu-item">
  10. <view class="content">
  11. <view class="text-gray">用户账号</view>
  12. </view>
  13. <view class="content">
  14. <view class="text-gray">{{userInfo.account}}</view>
  15. </view>
  16. </view>
  17. <view class="cu-item">
  18. <view class="content">
  19. <view class="text-gray">用户名称</view>
  20. </view>
  21. <view class="content">
  22. <view class="text-gray">{{userInfo.name}}</view>
  23. </view>
  24. </view>
  25. <view class="cu-item">
  26. <view class="content">
  27. <view class="text-gray">是否管理员</view>
  28. </view>
  29. <view class="content">
  30. <view class="text-gray"> {{userInfo.adminType == 1?"是":"否"}}</view>
  31. </view>
  32. </view>
  33. </view>
  34. <u-line></u-line>
  35. <view class="content" style="margin-top: 50rpx;display: flex;text-align: center;">
  36. <view style="width: 50%;">
  37. <button class="cu-btn bg-blue shadow" style="height: 80rpx;" @click="modifyPassword">修改密码</button>
  38. </view>
  39. <view style="width: 50%;">
  40. <button class="cu-btn bg-blue shadow" style="height: 80rpx;" @click="logout">注销登录</button>
  41. </view>
  42. </view>
  43. <u-toast ref="uToast"></u-toast>
  44. </view>
  45. </template>
  46. <script>
  47. import {
  48. getLoginUserInfo
  49. } from '@/api/system/user.js'
  50. export default {
  51. data() {
  52. return {
  53. userInfo: {},
  54. }
  55. },
  56. methods: {
  57. modifyPassword() {
  58. uni.navigateTo({
  59. url: '/pages/user/modify-password?userId=' + this.userInfo.id
  60. })
  61. },
  62. getSysUserInfo() {
  63. getLoginUserInfo().then(res => {
  64. if (res.success) {
  65. this.userInfo = res.data
  66. }
  67. })
  68. },
  69. logout() {
  70. this.$store.dispatch("LogOut").then(res => {
  71. uni.navigateTo({
  72. url: '/pages/login/index'
  73. })
  74. })
  75. }
  76. },
  77. onLoad() {
  78. this.getSysUserInfo()
  79. }
  80. }
  81. </script>
  82. <style>
  83. </style>