Przeglądaj źródła

😁增加点击头像时显示账号具体信息提示

zuohuaijun 2 lat temu
rodzic
commit
8bd7d7a9d4

+ 15 - 0
Admin.NET/Admin.NET.Core/Service/Auth/Dto/LoginUserOutput.cs

@@ -29,6 +29,21 @@ public class LoginUserOutput
     /// </summary>
     public string RealName { get; set; }
 
+    /// <summary>
+    /// 电话
+    /// </summary>
+    public string Phone { get; set; }
+
+    /// <summary>
+    /// 身份证
+    /// </summary>
+    public string IdCardNum { get; set; }
+
+    /// <summary>
+    /// 邮箱
+    /// </summary>
+    public string Email { get; set; }
+
     /// <summary>
     /// 账号类型
     /// </summary>

+ 3 - 0
Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs

@@ -185,6 +185,9 @@ public class SysAuthService : IDynamicApiController, ITransient
             Id = user.Id,
             Account = user.Account,
             RealName = user.RealName,
+            Phone = user.Phone,
+            IdCardNum = user.IdCardNum,
+            Email = user.Email,
             AccountType = user.AccountType,
             Avatar = user.Avatar,
             Address = user.Address,

+ 1 - 0
Web/src/api-services/api.ts

@@ -16,6 +16,7 @@ export * from './apis/sys-auth-api';
 export * from './apis/sys-cache-api';
 export * from './apis/sys-code-gen-api';
 export * from './apis/sys-code-gen-config-api';
+export * from './apis/sys-common-api';
 export * from './apis/sys-config-api';
 export * from './apis/sys-const-api';
 export * from './apis/sys-database-api';

+ 130 - 0
Web/src/api-services/apis/sys-common-api.ts

@@ -0,0 +1,130 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Admin.NET 通用权限开发平台
+ * 让 .NET 开发更简单、更通用、更流行。前后端分离架构(.NET6/Vue3),开箱即用紧随前沿技术。<br/><a href='https://gitee.com/zuohuaijun/Admin.NET/'>https://gitee.com/zuohuaijun/Admin.NET</a>
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: 515096995@qq.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
+import { Configuration } from '../configuration';
+// Some imports not used depending on template conditions
+// @ts-ignore
+import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
+import { AdminResultListApiOutput } from '../models';
+/**
+ * SysCommonApi - axios parameter creator
+ * @export
+ */
+export const SysCommonApiAxiosParamCreator = function (configuration?: Configuration) {
+    return {
+        /**
+         * 
+         * @summary 获取所有接口/动态API
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        apiSysCommonApiListGet: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
+            const localVarPath = `/api/sysCommon/apiList`;
+            // use dummy base URL string because the URL constructor only accepts absolute URLs.
+            const localVarUrlObj = new URL(localVarPath, 'https://example.com');
+            let baseOptions;
+            if (configuration) {
+                baseOptions = configuration.baseOptions;
+            }
+            const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
+            const localVarHeaderParameter = {} as any;
+            const localVarQueryParameter = {} as any;
+
+            // authentication Bearer required
+            // http bearer authentication required
+            if (configuration && configuration.accessToken) {
+                const accessToken = typeof configuration.accessToken === 'function'
+                    ? await configuration.accessToken()
+                    : await configuration.accessToken;
+                localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
+            }
+
+            const query = new URLSearchParams(localVarUrlObj.search);
+            for (const key in localVarQueryParameter) {
+                query.set(key, localVarQueryParameter[key]);
+            }
+            for (const key in options.params) {
+                query.set(key, options.params[key]);
+            }
+            localVarUrlObj.search = (new URLSearchParams(query)).toString();
+            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
+            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
+
+            return {
+                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
+                options: localVarRequestOptions,
+            };
+        },
+    }
+};
+
+/**
+ * SysCommonApi - functional programming interface
+ * @export
+ */
+export const SysCommonApiFp = function(configuration?: Configuration) {
+    return {
+        /**
+         * 
+         * @summary 获取所有接口/动态API
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        async apiSysCommonApiListGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListApiOutput>>> {
+            const localVarAxiosArgs = await SysCommonApiAxiosParamCreator(configuration).apiSysCommonApiListGet(options);
+            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
+                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
+                return axios.request(axiosRequestArgs);
+            };
+        },
+    }
+};
+
+/**
+ * SysCommonApi - factory interface
+ * @export
+ */
+export const SysCommonApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
+    return {
+        /**
+         * 
+         * @summary 获取所有接口/动态API
+         * @param {*} [options] Override http request option.
+         * @throws {RequiredError}
+         */
+        async apiSysCommonApiListGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListApiOutput>> {
+            return SysCommonApiFp(configuration).apiSysCommonApiListGet(options).then((request) => request(axios, basePath));
+        },
+    };
+};
+
+/**
+ * SysCommonApi - object-oriented interface
+ * @export
+ * @class SysCommonApi
+ * @extends {BaseAPI}
+ */
+export class SysCommonApi extends BaseAPI {
+    /**
+     * 
+     * @summary 获取所有接口/动态API
+     * @param {*} [options] Override http request option.
+     * @throws {RequiredError}
+     * @memberof SysCommonApi
+     */
+    public async apiSysCommonApiListGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListApiOutput>> {
+        return SysCommonApiFp(this.configuration).apiSysCommonApiListGet(options).then((request) => request(this.axios, this.basePath));
+    }
+}

+ 75 - 0
Web/src/api-services/models/admin-result-list-api-output.ts

@@ -0,0 +1,75 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Admin.NET 通用权限开发平台
+ * 让 .NET 开发更简单、更通用、更流行。前后端分离架构(.NET6/Vue3),开箱即用紧随前沿技术。<br/><a href='https://gitee.com/zuohuaijun/Admin.NET/'>https://gitee.com/zuohuaijun/Admin.NET</a>
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: 515096995@qq.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+import { ApiOutput } from './api-output';
+import {
+    ApiOutput,
+} from ".";
+
+/**
+ * 全局返回结果
+ *
+ * @export
+ * @interface AdminResultListApiOutput
+ */
+export interface AdminResultListApiOutput {
+
+    /**
+     * 状态码
+     *
+     * @type {number}
+     * @memberof AdminResultListApiOutput
+     */
+    code?: number;
+
+    /**
+     * 类型success、warning、error
+     *
+     * @type {string}
+     * @memberof AdminResultListApiOutput
+     */
+    type?: string | null;
+
+    /**
+     * 错误信息
+     *
+     * @type {string}
+     * @memberof AdminResultListApiOutput
+     */
+    message?: string | null;
+
+    /**
+     * 数据
+     *
+     * @type {Array<ApiOutput>}
+     * @memberof AdminResultListApiOutput
+     */
+    result?: Array<ApiOutput> | null;
+
+    /**
+     * 附加数据
+     *
+     * @type {any}
+     * @memberof AdminResultListApiOutput
+     */
+    extras?: any | null;
+
+    /**
+     * 时间
+     *
+     * @type {Date}
+     * @memberof AdminResultListApiOutput
+     */
+    time?: Date;
+}

+ 50 - 0
Web/src/api-services/models/api-output.ts

@@ -0,0 +1,50 @@
+/* tslint:disable */
+/* eslint-disable */
+/**
+ * Admin.NET 通用权限开发平台
+ * 让 .NET 开发更简单、更通用、更流行。前后端分离架构(.NET6/Vue3),开箱即用紧随前沿技术。<br/><a href='https://gitee.com/zuohuaijun/Admin.NET/'>https://gitee.com/zuohuaijun/Admin.NET</a>
+ *
+ * OpenAPI spec version: 1.0.0
+ * Contact: 515096995@qq.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ * Do not edit the class manually.
+ */
+
+import {
+    
+} from ".";
+
+/**
+ * 接口/动态API输出
+ *
+ * @export
+ * @interface ApiOutput
+ */
+export interface ApiOutput {
+
+    /**
+     * 组名称
+     *
+     * @type {string}
+     * @memberof ApiOutput
+     */
+    groupName?: string | null;
+
+    /**
+     * 接口名称
+     *
+     * @type {string}
+     * @memberof ApiOutput
+     */
+    displayName?: string | null;
+
+    /**
+     * 路由名称
+     *
+     * @type {string}
+     * @memberof ApiOutput
+     */
+    routeName?: string | null;
+}

+ 2 - 0
Web/src/api-services/models/index.ts

@@ -23,6 +23,7 @@ export * from './admin-result-iaction-result';
 export * from './admin-result-int32';
 export * from './admin-result-int64';
 export * from './admin-result-jobject';
+export * from './admin-result-list-api-output';
 export * from './admin-result-list-code-gen-config';
 export * from './admin-result-list-column-ouput';
 export * from './admin-result-list-const-output';
@@ -86,6 +87,7 @@ export * from './admin-result-sys-wechat-pay';
 export * from './admin-result-wechat-pay-output';
 export * from './admin-result-wx-open-id-output';
 export * from './admin-result-wx-phone-output';
+export * from './api-output';
 export * from './card-type-enum';
 export * from './change-pwd-input';
 export * from './cluster-status';

+ 32 - 0
Web/src/api-services/models/login-user-output.ts

@@ -49,6 +49,30 @@ export interface LoginUserOutput {
      */
     realName?: string | null;
 
+    /**
+     * 电话
+     *
+     * @type {string}
+     * @memberof LoginUserOutput
+     */
+    phone?: string | null;
+
+    /**
+     * 身份证
+     *
+     * @type {string}
+     * @memberof LoginUserOutput
+     */
+    idCardNum?: string | null;
+
+    /**
+     * 邮箱
+     *
+     * @type {string}
+     * @memberof LoginUserOutput
+     */
+    email?: string | null;
+
     /**
      * @type {AccountTypeEnum}
      * @memberof LoginUserOutput
@@ -126,4 +150,12 @@ export interface LoginUserOutput {
      * @memberof LoginUserOutput
      */
     buttons?: Array<string> | null;
+
+    /**
+     * 角色集合
+     *
+     * @type {Array<number>}
+     * @memberof LoginUserOutput
+     */
+    roleIds?: Array<number> | null;
 }

+ 12 - 1
Web/src/layout/navBars/topBar/user.vue

@@ -54,7 +54,18 @@
 		</div>
 		<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" />
+				<el-tooltip effect="dark" placement="left">
+					<template #content>
+						账号:{{ userInfos.account }}<br />
+						姓名:{{ userInfos.realName }}<br />
+						电话:{{ userInfos.phone }}<br />
+						邮箱:{{ userInfos.email }}<br />
+						部门:{{ userInfos.orgName }}<br />
+						职位:{{ userInfos.posName }}<br />
+					</template>
+					<img :src="userInfos.avatar" class="layout-navbars-breadcrumb-user-link-photo mr5" />
+				</el-tooltip>
+
 				{{ userInfos.realName == '' ? userInfos.account : userInfos.realName }}
 				<el-icon class="el-icon--right">
 					<ele-ArrowDown />

+ 3 - 0
Web/src/stores/userInfo.ts

@@ -66,6 +66,9 @@ export const useUserInfo = defineStore('userInfo', {
 							id: d.id,
 							account: d.account,
 							realName: d.realName,
+							phone: d.phone,
+							idCardNum: d.idCardNum,
+							email: d.Email,
 							accountType: d.accountType,
 							avatar: d.avatar ? '/' + d.avatar : '/favicon.ico',
 							address: d.address,