perf: 优化细节

This commit is contained in:
H0nGzA1
2023-05-17 23:48:59 +08:00
parent d10127eafc
commit f4f958d2e9
7 changed files with 10 additions and 11 deletions

View File

@@ -60,7 +60,7 @@
<el-dropdown :show-timeout="70" :hide-timeout="50" @command="onHandleCommandClick">
<span class="layout-navbars-breadcrumb-user-link">
<img :src="userInfos.avatar" class="layout-navbars-breadcrumb-user-link-photo mr5" />
{{ userInfos.userName === '' ? 'common' : userInfos.userName }}
{{ userInfos.username === '' ? 'common' : userInfos.username }}
<el-icon class="el-icon--right">
<ele-ArrowDown />
</el-icon>

View File

@@ -6,7 +6,7 @@
// 用户信息
export interface UserInfosState {
avatar: string;
userName: string;
username: string;
name: string;
email: string;
mobile: string;

View File

@@ -10,7 +10,7 @@ export const useUserInfo = defineStore('userInfo', {
state: (): UserInfosStates => ({
userInfos: {
avatar: '',
userName: '',
username: '',
name: '',
email: '',
mobile: '',
@@ -30,7 +30,7 @@ export const useUserInfo = defineStore('userInfo', {
actions: {
async updateUserInfos() {
let userInfos: any = await this.getApiUserInfo();
this.userInfos.userName = userInfos.data.name;
this.userInfos.username = userInfos.data.name;
this.userInfos.avatar = userInfos.data.avatar;
this.userInfos.name = userInfos.data.name;
this.userInfos.email = userInfos.data.email;
@@ -46,7 +46,7 @@ export const useUserInfo = defineStore('userInfo', {
this.userInfos = Session.get('userInfo');
} else {
let userInfos: any = await this.getApiUserInfo();
this.userInfos.userName = userInfos.data.name;
this.userInfos.username = userInfos.data.name;
this.userInfos.avatar = userInfos.data.avatar;
this.userInfos.name = userInfos.data.name;
this.userInfos.email = userInfos.data.email;

View File

@@ -9,7 +9,7 @@ declare interface UserInfosState<T = any> {
photo: string;
roles: string[];
time: number;
userName: string;
username: string;
[key: string]: T;
};
}

View File

@@ -90,7 +90,7 @@ declare type TreeType = {
// user
declare type RowUserType<T = any> = {
userName: string;
username: string;
userNickname: string;
roleSign: string;
department: string[];

View File

@@ -45,6 +45,5 @@ export const handleMenu = (menuData: Array<any>) => {
},
...data
]
console.log(menu)
return menu
}

View File

@@ -1,7 +1,7 @@
<template>
<el-form size="large" class="login-content-form">
<el-form-item class="login-animation1">
<el-input type="text" :placeholder="$t('message.mobile.placeholder1')" v-model="ruleForm.userName" clearable autocomplete="off">
<el-input type="text" :placeholder="$t('message.mobile.placeholder1')" v-model="ruleForm.username" clearable autocomplete="off">
<template #prefix>
<i class="iconfont icon-dianhua el-input__icon"></i>
</template>
@@ -34,13 +34,13 @@ import { toRefs, reactive, defineComponent } from 'vue';
// 定义接口来定义对象的类型
interface LoginMobileState {
userName: any;
username: any;
code: string | number | undefined;
}
// 定义对象与类型
const ruleForm: LoginMobileState = {
userName: '',
username: '',
code: '',
};