Commit a33a5cb7 authored by nick zheng's avatar nick zheng

fix: 查看应用对应发布者信息

parent 78b9993e
......@@ -20,3 +20,7 @@ export function fetchEmailCode<T>(emailAddress: string) {
export function fetchUserDetailInfo<T>() {
return request.post<T>('/bizMemberInfoRest/getCurrentMemberInfo.json')
}
export function fetchGetMemberInfoById<T>(memberId: number) {
return request.post<T>(`/bizMemberInfoRest/getMemberNickName.json?memberId=${memberId}`)
}
......@@ -5,9 +5,11 @@ import CustomIcon from '@/components/custom-icon/custom-icon.vue'
import { useUserStore } from '@/store/modules/user'
import { PersonalAppConfigState } from '@/store/types/personal-app-config'
import { formatDateTime } from '@/utils/date-formatter'
import { UserInfo } from '@/store/types/user'
interface Props {
agentApplicationConfig: PersonalAppConfigState
agentMemberInfo: UserInfo
}
const { t } = useI18n()
......@@ -22,10 +24,6 @@ const emit = defineEmits<{
const userStore = useUserStore()
const useAvatar = computed(() => {
return userStore.userInfo.avatarUrl || 'https://gsst-poe-sit.gz.bcebos.com/data/20240910/1725952917468.png'
})
const isLogin = computed(() => {
return userStore.isLogin
})
......@@ -56,9 +54,9 @@ function handleToLogin() {
<div class="flex flex-col items-start justify-center">
<span class="mb-1 line-clamp-1 max-w-[200px] break-all">{{ agentApplicationConfig.baseInfo.agentTitle }}</span>
<div class="flex items-center text-xs text-[#84868c]">
<img v-show="isLogin" :src="useAvatar" class="mr-2 h-5 w-5 rounded-full" />
<img v-show="isLogin" :src="agentMemberInfo.avatarUrl" class="mr-2 h-5 w-5 rounded-full" />
<p v-show="isLogin" class="mr-4 line-clamp-1 max-w-[120px] break-words break-all">
{{ userStore.userInfo.nickName }}
{{ agentMemberInfo.nickName }}
</p>
<span>
{{ t('common_module.publish_time_in') }}
......
......@@ -11,6 +11,8 @@ import { PersonalAppConfigState } from '@/store/types/personal-app-config'
import { defaultPersonalAppConfigState } from '@/store/modules/personal-app-config'
import { useUserStore } from '@/store/modules/user'
import { useLayoutConfig } from '@/composables/useLayoutConfig'
import { fetchGetMemberInfoById } from '@/apis/user'
import { UserInfo } from '@/store/types/user'
const { t } = useI18n()
......@@ -23,6 +25,12 @@ const { isMobile } = useLayoutConfig()
const fullScreenLoading = ref(false)
const agentId = ref('')
const dialogsId = ref('')
const agentMemberInfo = ref<UserInfo>({
avatarUrl: 'https://gsst-poe-sit.gz.bcebos.com/data/20240910/1725952917468.png',
memberId: null,
mobilePhone: '',
nickName: '---',
})
const agentApplicationConfig = ref<PersonalAppConfigState>(defaultPersonalAppConfigState())
......@@ -63,12 +71,21 @@ async function handleGetApplicationDetail() {
agentApplicationConfig.value = res.data
continuousQuestionStatus.value = res.data.commConfig.continuousQuestionStatus
document.title = agentApplicationConfig.value.baseInfo.agentTitle
handleGetMemberInfo()
})
.catch(() => {
router.replace({ name: 'Home' })
})
}
async function handleGetMemberInfo() {
const res = await fetchGetMemberInfoById<UserInfo>(agentApplicationConfig.value.baseInfo.memberId)
if (res.code === 0) {
agentMemberInfo.value = res.data
}
}
async function handleCreateDialogues() {
const res = await fetchCreateDialogues(agentId.value)
......@@ -149,6 +166,7 @@ function handleResetContinueQuestionList() {
<main class="h-full min-w-[1100px]">
<PageHeader
:agent-application-config="agentApplicationConfig"
:agent-member-info="agentMemberInfo"
@back-home-page="handleBackHomePage"
@to-login="handleToLoginPage"
@to-create-application="handleCreateApplicationPage"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment