feat:个人信息界面改动
This commit is contained in:
@@ -577,6 +577,22 @@ const local: any = {
|
||||
currentdevice:"The device is currently connected",
|
||||
refresh:"Refresh",
|
||||
},
|
||||
usercard:{
|
||||
changeInfo:"Change Information",
|
||||
resetpwd:"Reset password",
|
||||
KYC:"KYC Certification",
|
||||
deviceconsole:"Device management",
|
||||
},
|
||||
device:{
|
||||
title: "Device management",
|
||||
noDevices: "There are no devices yet",
|
||||
confirmDelete: "Confirm deletion.",
|
||||
deleteWarning: "Are you sure you want to remove the device {name}?",
|
||||
deleteSuccess: "Deletion successful.",
|
||||
deleteFailed: "Delete failed.",
|
||||
fetchFailed: "Failed to retrieve the list of devices.",
|
||||
lastActive: "Last active time.",
|
||||
}
|
||||
},
|
||||
form: {
|
||||
required: 'Cannot be empty',
|
||||
|
||||
@@ -577,6 +577,22 @@ const local:any = {
|
||||
currentdevice:"当前接入设备",
|
||||
refresh:"刷新",
|
||||
},
|
||||
usercard:{
|
||||
changeInfo:"修改信息",
|
||||
resetpwd:"修改密码",
|
||||
KYC:"KYC认证",
|
||||
deviceconsole:"设备管理",
|
||||
},
|
||||
device:{
|
||||
title: "设备管理",
|
||||
noDevices: "暂无设备",
|
||||
confirmDelete: "确认删除",
|
||||
deleteWarning: "确定要删除设备 {name} 吗?",
|
||||
deleteSuccess: "删除成功",
|
||||
deleteFailed: "删除失败",
|
||||
fetchFailed: "获取设备列表失败",
|
||||
lastActive: "最后活跃时间",
|
||||
}
|
||||
},
|
||||
form: {
|
||||
required: '不能为空',
|
||||
|
||||
@@ -321,10 +321,9 @@ export const customRoutes: GeneratedRoute[] = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'user-info',
|
||||
path: '/userInfo',
|
||||
component: 'layout.base$view.userInfo',
|
||||
redirect: '/userInfo/index',
|
||||
name: 'user-info/usercard',
|
||||
path: '/userInfo/usercard',
|
||||
component: 'layout.base',
|
||||
meta: {
|
||||
title: '个人信息',
|
||||
i18nKey: 'view.userInfo',
|
||||
@@ -333,22 +332,46 @@ export const customRoutes: GeneratedRoute[] = [
|
||||
},
|
||||
children: [
|
||||
{
|
||||
name: 'user-info_index',
|
||||
path: 'index',
|
||||
component: 'view.userInfo.index',
|
||||
name: 'user-info_usercard',
|
||||
path: '/userInfo/usercard',
|
||||
component: 'view.userInfo_usercard',
|
||||
meta: {
|
||||
title: '个人信息',
|
||||
i18nKey: 'view.userInfo_index',
|
||||
i18nKey: 'view.userInfo',
|
||||
order: 17,
|
||||
hideInMenu: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'user-info_profile',
|
||||
path: 'profile',
|
||||
component: 'view.userInfo.profile',
|
||||
path: '/userInfo/profile',
|
||||
component: 'view.userInfo_profile',
|
||||
meta: {
|
||||
title: '个人资料',
|
||||
i18nKey: 'view.userInfo_profile',
|
||||
order:18,
|
||||
hideInMenu: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'user-info_resetpwd',
|
||||
path: '/userInfo/resetpwd',
|
||||
component: 'view.userInfo_resetpwd',
|
||||
meta: {
|
||||
title: '修改密码',
|
||||
i18nKey: 'view.userInfo_resetpwd',
|
||||
order:18,
|
||||
hideInMenu: true
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'user-info_device',
|
||||
path: '/userInfo/device',
|
||||
component: 'view.userInfo_device',
|
||||
meta: {
|
||||
title: '设备管理',
|
||||
i18nKey: 'view.userInfo_device',
|
||||
order:19,
|
||||
hideInMenu: true
|
||||
}
|
||||
}
|
||||
|
||||
1
src/typings/components.d.ts
vendored
1
src/typings/components.d.ts
vendored
@@ -19,6 +19,7 @@ declare module 'vue' {
|
||||
ADivider: typeof import('ant-design-vue/es')['Divider']
|
||||
ADrawer: typeof import('ant-design-vue/es')['Drawer']
|
||||
ADropdown: typeof import('ant-design-vue/es')['Dropdown']
|
||||
AEmpty: typeof import('ant-design-vue/es')['Empty']
|
||||
AForm: typeof import('ant-design-vue/es')['Form']
|
||||
AFormItem: typeof import('ant-design-vue/es')['FormItem']
|
||||
AImage: typeof import('ant-design-vue/es')['Image']
|
||||
|
||||
@@ -1,76 +1,60 @@
|
||||
<script setup lang="ts">
|
||||
import { useAuthStore } from '@/store/modules/auth';
|
||||
import {clientUnAuth,clientAuth, clientInfo} from '@/service/ue/client';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { ref, computed } from 'vue';
|
||||
import { UserOutlined } from '@ant-design/icons-vue';
|
||||
import { computed } from 'vue';
|
||||
import { UserOutlined, LockOutlined, SafetyCertificateOutlined, MobileOutlined, RightOutlined} from '@ant-design/icons-vue';
|
||||
import { useRouterPush } from '@/hooks/common/router';
|
||||
import {useI18n} from "vue-i18n";
|
||||
|
||||
const {t} = useI18n();
|
||||
|
||||
// 添加用户信息的类型定义
|
||||
interface UserInfo {
|
||||
avatar?: string;
|
||||
nickName?: string;
|
||||
userName?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
const router = useRouter();
|
||||
const authStore = useAuthStore();
|
||||
const user = computed(() => authStore.userInfo?.user || null);
|
||||
const { toLogin } = useRouterPush();
|
||||
// 添加类型断言
|
||||
const user = computed<UserInfo | null>(() => authStore.userInfo?.user || null);
|
||||
|
||||
const menuItems = [
|
||||
{
|
||||
icon: 'i-carbon:user-profile',
|
||||
title: '个人信息',
|
||||
path: '/user/profile'
|
||||
icon: UserOutlined,
|
||||
title: t('page.usercard.changeInfo'),
|
||||
path: 'profile'
|
||||
},
|
||||
{
|
||||
icon: 'i-carbon:password',
|
||||
title: '修改密码',
|
||||
path: '/user/change-password'
|
||||
icon: LockOutlined,
|
||||
title: t('page.usercard.resetpwd'),
|
||||
path: 'resetpwd'
|
||||
},
|
||||
{
|
||||
icon: 'i-carbon:security',
|
||||
title: 'KYC认证',
|
||||
icon: SafetyCertificateOutlined,
|
||||
title: t('page.usercard.KYC'),
|
||||
path: '/user/kyc'
|
||||
},
|
||||
{
|
||||
icon: 'i-carbon:devices',
|
||||
title: '设备管理',
|
||||
path: '/user/devices'
|
||||
},
|
||||
{
|
||||
icon: 'i-carbon:devices',
|
||||
title: '终端上网',
|
||||
path: 'auth'
|
||||
},
|
||||
{
|
||||
icon: 'i-carbon:devices',
|
||||
title: '终端下线',
|
||||
path: 'unauth'
|
||||
},
|
||||
{
|
||||
icon: 'i-carbon:devices',
|
||||
title: '终端信息',
|
||||
path: 'info'
|
||||
icon: MobileOutlined,
|
||||
title: t('page.usercard.deviceconsole'),
|
||||
path: 'device'
|
||||
}
|
||||
];
|
||||
|
||||
const infoC = ref({})
|
||||
const handleMenuClick = (path: string) => {
|
||||
if(path==="auth"){
|
||||
clientAuth().then((res)=>{
|
||||
console.log(res)
|
||||
infoC.value = res.data
|
||||
})
|
||||
return
|
||||
if (path === '_reset_pwd') {
|
||||
toLogin('reset-pwd');
|
||||
return;
|
||||
}
|
||||
if(path==="unauth"){
|
||||
clientUnAuth().then((res)=>{
|
||||
console.log(res)
|
||||
infoC.value = res.data
|
||||
})
|
||||
return
|
||||
if (path.startsWith('/')) {
|
||||
router.push(path);
|
||||
} else {
|
||||
router.push(`/userInfo/${path}`);
|
||||
}
|
||||
if(path==="info"){
|
||||
clientInfo().then((res)=>{
|
||||
console.log(res)
|
||||
infoC.value = res.data
|
||||
})
|
||||
return
|
||||
}
|
||||
router.push(path);
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -106,20 +90,19 @@ const handleMenuClick = (path: string) => {
|
||||
>
|
||||
<div class="menu-content">
|
||||
<div class="icon-wrapper">
|
||||
<div :class="item.icon"></div>
|
||||
<component :is="item.icon" />
|
||||
</div>
|
||||
<span>{{ item.title }}</span>
|
||||
</div>
|
||||
<div class="i-carbon:chevron-right"></div>
|
||||
<RightOutlined />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{infoC || '无信息'}}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* 移动优先的响应式设计 */
|
||||
/* 移优先的响应式设计 */
|
||||
.user-center {
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
@@ -215,11 +198,7 @@ const handleMenuClick = (path: string) => {
|
||||
justify-content: center;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
[class^="i-"] {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* 平板设备断点 */
|
||||
Reference in New Issue
Block a user