index.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <view class="info">
  3. <view class='zhanline'></view>
  4. <view class="pl12">
  5. <view class="flexc infolist">
  6. <view class="f16 fw c34 flex0">账号名称</view>
  7. <view class="f16 c34 flex1 txr">{{user.userName}}</view>
  8. </view>
  9. <view class="flexc infolist">
  10. <view class="f16 fw c34 flex0">用户类型</view>
  11. <view class="f16 c34 flex1 txr">{{roleGroup}}</view>
  12. </view>
  13. <!-- <view class="flexc infolist">
  14. <view class="f16 fw c34 flex0">联系方式</view>
  15. <view class="f16 c34 flex1 txr">180****5668</view>
  16. </view> -->
  17. <view class="infobtn flexcc cf f16 mt60 f500" @click="handleLogout">退出登录</view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import { getUserProfile } from "@/api/system/user"
  23. export default {
  24. data() {
  25. return {
  26. user: {},
  27. roleGroup: "",
  28. postGroup: "",
  29. }
  30. },
  31. onLoad() {
  32. this.getUser()
  33. },
  34. methods: {
  35. getUser() {
  36. getUserProfile().then(response => {
  37. this.user = response.data
  38. this.roleGroup = response.roleGroup
  39. this.postGroup = response.postGroup
  40. })
  41. },
  42. handleLogout() {
  43. this.$modal.confirm('确定注销并退出系统吗?').then(() => {
  44. this.$store.dispatch('LogOut').then(() => {
  45. this.$tab.reLaunch('/pages/index')
  46. })
  47. })
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss">
  53. page {
  54. background-color: #ffffff;
  55. }
  56. .infolist{border-bottom: 2rpx solid #E5E5E5;padding: 40rpx 0;padding-right: 24rpx;}
  57. .infobtn{width: 700rpx;height: 88rpx;background: #FA5F03;border-radius:10rpx;line-height: 88rpx;}
  58. </style>