11
jhzh
2025-10-30 0b0bb61067f570aa7af992418596d4fdc2cedc02
src/components/GlobalHeader/RightContent.vue
@@ -8,8 +8,7 @@
<script>
import AvatarDropdown from './AvatarDropdown'
import SelectLang from '@/components/SelectLang'
import { adminlist } from '@/api/managesettings'
import { agentgetAgentInfo } from '@/api/home'
export default {
  name: 'RightContent',
  components: {
@@ -49,17 +48,25 @@
    }
  },
  mounted () {
    this.getnowuser()
    this.getAgentInfo()
  },
  methods: {
    getnowuser () {
      adminlist().then(res => {
        var index = res.data.list.findIndex(item => item.adminPhone == window.localStorage.getItem('phones'))
        setTimeout(() => {
          this.currentUser = {
            name: res.data.list[index].adminName
          }
        }, 1500)
    // 获取代理信息
    getAgentInfo () {
      agentgetAgentInfo().then(res => {
        if (res.status == 0) {
          setTimeout(() => {
            this.currentUser = {
              name: res.data.agentName
            }
          }, 1500)
        } else {
          setTimeout(() => {
            this.currentUser = {
              name: '代理'
            }
          }, 1500)
        }
      })
    }
  }