车间能级提升-智能设备管理系统
zhuguifei
2025-05-13 14681dfe7052cb76eefcc0c17d0a0d708e1ac9dd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<route lang="json5" type="page">
{
  layout: 'tabbar',
  needLogin: true,
  style: {
    navigationBarTitleText: '我的',
  },
}
</route>
 
<template>
  <view class="bg-base">
    <wd-cell-group border>
      <wd-cell title="登录用户" :value="realName" icon="user" is-link />
      <wd-cell title="角色" :value="loginRoleName()" icon="bags" is-link />
      <wd-cell title="人员管理" icon="usergroup" is-link @click="handleInfo" />
    </wd-cell-group>
    <wd-cell-group border class="mt-2">
      <wd-cell title="退出登录" icon="login" is-link @click="handleLogout" />
    </wd-cell-group>
  </view>
</template>
 
<script lang="ts" setup>
import { useUserStore, useAccessStore, useSystemConfigStore } from '@/store'
import { loginRoleName } from '@/utils/RoleUtils'
import { useMessage } from 'wot-design-uni'
const message = useMessage()
const userStore = useUserStore()
const accessStore = useAccessStore()
const configStore = useSystemConfigStore()
const realName = computed(() => userStore?.userInfo?.realName)
 
function handleLogout() {
  if (!isLogined()) {
    uni.navigateTo({ url: '/pages/login/index' })
    return false
  }
  message
    .confirm({
      msg: '提示',
      title: '确定退出登录吗?',
    })
    .then(() => {
      userStore.clearUserInfo()
      accessStore.clearAccessInfo()
      configStore.clearConfigInfo()
      uni.navigateTo({ url: '/pages/login/index' })
    })
    .catch(() => {})
}
 
const isLogined = () => {
  return accessStore.isLogined
}
 
function handleInfo() {
  uni.showToast({
    title: '功能开发中',
    icon: 'none',
  })
}
</script>
 
<style lang="scss" scoped>
//
</style>