|
|
|
@ -1,21 +1,36 @@
|
|
|
|
|
import { useEffect, useState } from 'react'
|
|
|
|
|
import { Descriptions, Col, Row } from 'antd';
|
|
|
|
|
import { useStore } from '@/stores/StoreContext.js';
|
|
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
|
import { fetchUserDetail } from '@/stores/Auth'
|
|
|
|
|
import { usingStorage } from '@/hooks/usingStorage'
|
|
|
|
|
|
|
|
|
|
function Profile() {
|
|
|
|
|
const { t } = useTranslation();
|
|
|
|
|
|
|
|
|
|
const { authStore } = useStore();
|
|
|
|
|
const { login } = authStore;
|
|
|
|
|
const { t } = useTranslation()
|
|
|
|
|
const [userDetail, setUserDetail] = useState({})
|
|
|
|
|
const { loginToken } = usingStorage()
|
|
|
|
|
|
|
|
|
|
useEffect (() => {
|
|
|
|
|
fetchUserDetail(loginToken)
|
|
|
|
|
.then(json => {
|
|
|
|
|
setUserDetail({
|
|
|
|
|
username: json.LoginName,
|
|
|
|
|
telephone: json.LkPhone,
|
|
|
|
|
emailAddress: json.LMI_listmail,
|
|
|
|
|
travelAgencyName: json.VName,
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}, [])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={12} offset={6}>
|
|
|
|
|
<Descriptions title={t('userProfile')} layout="vertical" column={2}>
|
|
|
|
|
<Descriptions.Item label={t("Username")}>{login.username}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label={t("Telephone")}>{login.telephone}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label={t("Email")}>{login.emailAddress}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label={t("Company")}>{login.travelAgencyName}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label={t("Username")}>{userDetail?.username}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label={t("Telephone")}>{userDetail?.telephone}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label={t("Email")}>{userDetail?.emailAddress}</Descriptions.Item>
|
|
|
|
|
<Descriptions.Item label={t("Company")}>{userDetail?.travelAgencyName}</Descriptions.Item>
|
|
|
|
|
</Descriptions>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|