perf: ⚡ 优化细节
This commit is contained in:
@@ -60,7 +60,7 @@
|
|||||||
<el-dropdown :show-timeout="70" :hide-timeout="50" @command="onHandleCommandClick">
|
<el-dropdown :show-timeout="70" :hide-timeout="50" @command="onHandleCommandClick">
|
||||||
<span class="layout-navbars-breadcrumb-user-link">
|
<span class="layout-navbars-breadcrumb-user-link">
|
||||||
<img :src="userInfos.avatar" class="layout-navbars-breadcrumb-user-link-photo mr5" />
|
<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">
|
<el-icon class="el-icon--right">
|
||||||
<ele-ArrowDown />
|
<ele-ArrowDown />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
// 用户信息
|
// 用户信息
|
||||||
export interface UserInfosState {
|
export interface UserInfosState {
|
||||||
avatar: string;
|
avatar: string;
|
||||||
userName: string;
|
username: string;
|
||||||
name: string;
|
name: string;
|
||||||
email: string;
|
email: string;
|
||||||
mobile: string;
|
mobile: string;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export const useUserInfo = defineStore('userInfo', {
|
|||||||
state: (): UserInfosStates => ({
|
state: (): UserInfosStates => ({
|
||||||
userInfos: {
|
userInfos: {
|
||||||
avatar: '',
|
avatar: '',
|
||||||
userName: '',
|
username: '',
|
||||||
name: '',
|
name: '',
|
||||||
email: '',
|
email: '',
|
||||||
mobile: '',
|
mobile: '',
|
||||||
@@ -30,7 +30,7 @@ export const useUserInfo = defineStore('userInfo', {
|
|||||||
actions: {
|
actions: {
|
||||||
async updateUserInfos() {
|
async updateUserInfos() {
|
||||||
let userInfos: any = await this.getApiUserInfo();
|
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.avatar = userInfos.data.avatar;
|
||||||
this.userInfos.name = userInfos.data.name;
|
this.userInfos.name = userInfos.data.name;
|
||||||
this.userInfos.email = userInfos.data.email;
|
this.userInfos.email = userInfos.data.email;
|
||||||
@@ -46,7 +46,7 @@ export const useUserInfo = defineStore('userInfo', {
|
|||||||
this.userInfos = Session.get('userInfo');
|
this.userInfos = Session.get('userInfo');
|
||||||
} else {
|
} else {
|
||||||
let userInfos: any = await this.getApiUserInfo();
|
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.avatar = userInfos.data.avatar;
|
||||||
this.userInfos.name = userInfos.data.name;
|
this.userInfos.name = userInfos.data.name;
|
||||||
this.userInfos.email = userInfos.data.email;
|
this.userInfos.email = userInfos.data.email;
|
||||||
|
|||||||
2
web/src/types/pinia.d.ts
vendored
2
web/src/types/pinia.d.ts
vendored
@@ -9,7 +9,7 @@ declare interface UserInfosState<T = any> {
|
|||||||
photo: string;
|
photo: string;
|
||||||
roles: string[];
|
roles: string[];
|
||||||
time: number;
|
time: number;
|
||||||
userName: string;
|
username: string;
|
||||||
[key: string]: T;
|
[key: string]: T;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
2
web/src/types/views.d.ts
vendored
2
web/src/types/views.d.ts
vendored
@@ -90,7 +90,7 @@ declare type TreeType = {
|
|||||||
|
|
||||||
// user
|
// user
|
||||||
declare type RowUserType<T = any> = {
|
declare type RowUserType<T = any> = {
|
||||||
userName: string;
|
username: string;
|
||||||
userNickname: string;
|
userNickname: string;
|
||||||
roleSign: string;
|
roleSign: string;
|
||||||
department: string[];
|
department: string[];
|
||||||
|
|||||||
@@ -45,6 +45,5 @@ export const handleMenu = (menuData: Array<any>) => {
|
|||||||
},
|
},
|
||||||
...data
|
...data
|
||||||
]
|
]
|
||||||
console.log(menu)
|
|
||||||
return menu
|
return menu
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-form size="large" class="login-content-form">
|
<el-form size="large" class="login-content-form">
|
||||||
<el-form-item class="login-animation1">
|
<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>
|
<template #prefix>
|
||||||
<i class="iconfont icon-dianhua el-input__icon"></i>
|
<i class="iconfont icon-dianhua el-input__icon"></i>
|
||||||
</template>
|
</template>
|
||||||
@@ -34,13 +34,13 @@ import { toRefs, reactive, defineComponent } from 'vue';
|
|||||||
|
|
||||||
// 定义接口来定义对象的类型
|
// 定义接口来定义对象的类型
|
||||||
interface LoginMobileState {
|
interface LoginMobileState {
|
||||||
userName: any;
|
username: any;
|
||||||
code: string | number | undefined;
|
code: string | number | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 定义对象与类型
|
// 定义对象与类型
|
||||||
const ruleForm: LoginMobileState = {
|
const ruleForm: LoginMobileState = {
|
||||||
userName: '',
|
username: '',
|
||||||
code: '',
|
code: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user