Quellcode durchsuchen

清理登录选择租户模式代码

zuohuaijun vor 3 Jahren
Ursprung
Commit
7faa1442dc

+ 0 - 11
Admin.NET/Admin.NET.Core/Admin.NET.Core.xml

@@ -212,11 +212,6 @@
             单用户登录
             </summary>
         </member>
-        <member name="F:Admin.NET.Core.CommonConst.SysTenantDb">
-            <summary>
-            开启多库租户
-            </summary>
-        </member>
         <member name="F:Admin.NET.Core.CommonConst.SysAdminRole">
             <summary>
             系统管理员角色编码
@@ -3973,12 +3968,6 @@
             </summary>
             <returns></returns>
         </member>
-        <member name="M:Admin.NET.Core.Service.SysAuthService.GetTenantDbList">
-            <summary>
-            是否启用多库租户
-            </summary>
-            <returns></returns>
-        </member>
         <member name="M:Admin.NET.Core.Service.SysAuthService.SwaggerCheckUrl">
             <summary>
             Swagger登录检查

+ 0 - 5
Admin.NET/Admin.NET.Core/Const/CommonConst.cs

@@ -35,11 +35,6 @@ public class CommonConst
     /// </summary>
     public const string SysSingleLogin = "sys_single_login";
 
-    /// <summary>
-    /// 开启多库租户
-    /// </summary>
-    public const string SysTenantDb = "sys_tenant_db";
-
     /// <summary>
     /// 系统管理员角色编码
     /// </summary>

+ 0 - 1
Admin.NET/Admin.NET.Core/SeedData/SysConfigSeedData.cs

@@ -20,7 +20,6 @@ public class SysConfigSeedData : ISqlSugarEntitySeedData<SysConfig>
             new SysConfig{ Id=252885263003803, Name="操作日志", Code="sys_oplog", Value="True", SysFlag=YesNoEnum.Y, Remark="开启操作日志", Order=4, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
             new SysConfig{ Id=252885263003804, Name="单点登录", Code="sys_single_login", Value="True", SysFlag=YesNoEnum.Y, Remark="开启单点登录", Order=5, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
             new SysConfig{ Id=252885263003805, Name="验证码", Code="sys_captcha", Value="True", SysFlag=YesNoEnum.Y, Remark="开启验证码", Order=6, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
-            new SysConfig{ Id=252885263003806, Name="多库租户", Code="sys_tenant_db", Value="True", SysFlag=YesNoEnum.Y, Remark="开启多库租户", Order=7, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
         };
     }
 }

+ 0 - 5
Admin.NET/Admin.NET.Core/Service/Auth/Dto/LoginInput.cs

@@ -28,9 +28,4 @@ public class LoginInput
     /// 验证码
     /// </summary>
     public string Code { get; set; }
-
-    ///// <summary>
-    ///// 租户Id
-    ///// </summary>
-    //public long TenantId { get; set; }
 }

+ 1 - 18
Admin.NET/Admin.NET.Core/Service/Auth/SysAuthService.cs

@@ -16,7 +16,6 @@ public class SysAuthService : IDynamicApiController, ITransient
     private readonly IHttpContextAccessor _httpContextAccessor;
     private readonly IEventPublisher _eventPublisher;
     private readonly SysMenuService _sysMenuService;
-    private readonly SysTenantService _sysTenantService;
     private readonly SysOnlineUserService _sysOnlineUserService;
     private readonly SysConfigService _sysConfigService;
     private readonly IMemoryCache _cache;
@@ -28,7 +27,6 @@ public class SysAuthService : IDynamicApiController, ITransient
         IHttpContextAccessor httpContextAccessor,
         IEventPublisher eventPublisher,
         SysMenuService sysMenuService,
-        SysTenantService sysTenantService,
         SysOnlineUserService sysOnlineUserService,
         SysConfigService sysConfigService,
         IMemoryCache cache,
@@ -40,7 +38,6 @@ public class SysAuthService : IDynamicApiController, ITransient
         _refreshTokenOptions = refreshTokenOptions.Value;
         _eventPublisher = eventPublisher;
         _sysMenuService = sysMenuService;
-        _sysTenantService = sysTenantService;
         _sysOnlineUserService = sysOnlineUserService;
         _sysConfigService = sysConfigService;
         _cache = cache;
@@ -68,9 +65,8 @@ public class SysAuthService : IDynamicApiController, ITransient
 
         var encryptPasswod = MD5Encryption.Encrypt(input.Password);
 
-        // 判断用户名密码 
+        // 判断用户名密码
         var user = await _sysUserRep.AsQueryable().Filter(null, true)
-            // .WhereIF(input.TenantId > 0, u => u.TenantId == input.TenantId)
             .FirstAsync(u => u.Account.Equals(input.Account) && u.Password.Equals(encryptPasswod));
         _ = user ?? throw Oops.Oh(ErrorCodeEnum.D1000);
 
@@ -218,19 +214,6 @@ public class SysAuthService : IDynamicApiController, ITransient
         return new { Id = codeId, Img = captcha.Base64 };
     }
 
-    /// <summary>
-    /// 是否启用多库租户
-    /// </summary>
-    /// <returns></returns>
-    [HttpGet("/tenantDbList")]
-    [AllowAnonymous]
-    [SuppressMonitor]
-    public async Task<List<SysTenant>> GetTenantDbList()
-    {
-        var tenantDbEnabled = await _sysConfigService.GetConfigValue<bool>(CommonConst.SysTenantDb);
-        return tenantDbEnabled ? await _sysTenantService.GetTenantDbList() : new List<SysTenant>();
-    }
-
     /// <summary>
     /// Swagger登录检查
     /// </summary>

+ 0 - 69
Web/src/api-services/apis/sys-auth-api.ts

@@ -17,7 +17,6 @@ import { Configuration } from '../configuration';
 // @ts-ignore
 import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
 import { AdminResultBoolean } from '../models';
-import { AdminResultListSysTenant } from '../models';
 import { AdminResultLoginOutput } from '../models';
 import { AdminResultLoginUserOutput } from '../models';
 import { AdminResultObject } from '../models';
@@ -313,42 +312,6 @@ export const SysAuthApiAxiosParamCreator = function (configuration?: Configurati
                 options: localVarRequestOptions,
             };
         },
-        /**
-         * 
-         * @summary 是否启用多库租户
-         * @param {*} [options] Override http request option.
-         * @throws {RequiredError}
-         */
-        tenantDbListGet: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
-            const localVarPath = `/tenantDbList`;
-            // 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
-
-            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,
-            };
-        },
         /**
          * 
          * @summary 获取用户信息
@@ -489,19 +452,6 @@ export const SysAuthApiFp = function(configuration?: Configuration) {
                 return axios.request(axiosRequestArgs);
             };
         },
-        /**
-         * 
-         * @summary 是否启用多库租户
-         * @param {*} [options] Override http request option.
-         * @throws {RequiredError}
-         */
-        async tenantDbListGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListSysTenant>>> {
-            const localVarAxiosArgs = await SysAuthApiAxiosParamCreator(configuration).tenantDbListGet(options);
-            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
-                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
-                return axios.request(axiosRequestArgs);
-            };
-        },
         /**
          * 
          * @summary 获取用户信息
@@ -591,15 +541,6 @@ export const SysAuthApiFactory = function (configuration?: Configuration, basePa
         async swaggerSubmitUrlPostForm(userName?: string, password?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<number>> {
             return SysAuthApiFp(configuration).swaggerSubmitUrlPostForm(userName, password, options).then((request) => request(axios, basePath));
         },
-        /**
-         * 
-         * @summary 是否启用多库租户
-         * @param {*} [options] Override http request option.
-         * @throws {RequiredError}
-         */
-        async tenantDbListGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListSysTenant>> {
-            return SysAuthApiFp(configuration).tenantDbListGet(options).then((request) => request(axios, basePath));
-        },
         /**
          * 
          * @summary 获取用户信息
@@ -693,16 +634,6 @@ export class SysAuthApi extends BaseAPI {
     public async swaggerSubmitUrlPostForm(userName?: string, password?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<number>> {
         return SysAuthApiFp(this.configuration).swaggerSubmitUrlPostForm(userName, password, options).then((request) => request(this.axios, this.basePath));
     }
-    /**
-     * 
-     * @summary 是否启用多库租户
-     * @param {*} [options] Override http request option.
-     * @throws {RequiredError}
-     * @memberof SysAuthApi
-     */
-    public async tenantDbListGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListSysTenant>> {
-        return SysAuthApiFp(this.configuration).tenantDbListGet(options).then((request) => request(this.axios, this.basePath));
-    }
     /**
      * 
      * @summary 获取用户信息

+ 0 - 57
Web/src/api-services/models/admin-result-list-sys-tenant.ts

@@ -1,57 +0,0 @@
-/* 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 { SysTenant } from './sys-tenant';
-/**
- * 全局返回结果
- * @export
- * @interface AdminResultListSysTenant
- */
-export interface AdminResultListSysTenant {
-    /**
-     * 状态码
-     * @type {number}
-     * @memberof AdminResultListSysTenant
-     */
-    code?: number;
-    /**
-     * 类型success、warning、error
-     * @type {string}
-     * @memberof AdminResultListSysTenant
-     */
-    type?: string | null;
-    /**
-     * 错误信息
-     * @type {string}
-     * @memberof AdminResultListSysTenant
-     */
-    message?: string | null;
-    /**
-     * 数据
-     * @type {Array<SysTenant>}
-     * @memberof AdminResultListSysTenant
-     */
-    result?: Array<SysTenant> | null;
-    /**
-     * 附加数据
-     * @type {any}
-     * @memberof AdminResultListSysTenant
-     */
-    extras?: any | null;
-    /**
-     * 时间
-     * @type {Date}
-     * @memberof AdminResultListSysTenant
-     */
-    time?: Date;
-}

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

@@ -36,7 +36,6 @@ export * from './admin-result-list-sys-notice';
 export * from './admin-result-list-sys-org';
 export * from './admin-result-list-sys-pos';
 export * from './admin-result-list-sys-region';
-export * from './admin-result-list-sys-tenant';
 export * from './admin-result-list-sys-user-ext-org';
 export * from './admin-result-list-table-column-ouput';
 export * from './admin-result-list-table-output';

+ 0 - 18
Web/src/views/login/component/account.vue

@@ -1,15 +1,5 @@
 <template>
 	<el-form ref="ruleFormRef" :model="ruleForm" size="large" :rules="rules" class="login-content-form">
-		<!-- <el-form-item class="login-animation0" v-show="tenantList.length > 0">
-			<el-select v-model="ruleForm.tenantId" value-key="id" placeholder="租户名称" class="w100">
-				<template #prefix>
-					<el-icon>
-						<ele-OfficeBuilding />
-					</el-icon>
-				</template>
-				<el-option v-for="item in tenantList" :key="item.id" :label="item.name" :value="item.id" />
-			</el-select>
-		</el-form-item> -->
 		<el-form-item class="login-animation1" prop="account">
 			<el-input type="text" placeholder="请输入账号" v-model="ruleForm.account" clearable autocomplete="off">
 				<template #prefix>
@@ -84,7 +74,6 @@ import { NextLoading } from '/@/utils/loading';
 
 import { clearTokens, feature, getAPI } from '/@/utils/axios-utils';
 import { SysAuthApi } from '/@/api-services/api';
-//import { SysTenant } from '/@/api-services/models';
 
 // 旋转图片滑块组件
 import DragVerifyImgRotate from '/@/components/dragVerify/dragVerifyImgRotate.vue';
@@ -107,7 +96,6 @@ export default defineComponent({
 				password: '123456',
 				code: '',
 				codeId: 0,
-				//tenantId: 0,
 			},
 			rules: {
 				account: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
@@ -122,14 +110,8 @@ export default defineComponent({
 			verifyImg: verifyImg,
 			captchaImage: '',
 			captchaEnabled: true,
-			//tenantList: [] as Array<SysTenant>,
 		});
 		onMounted(async () => {
-			// // 是否开启多库租户
-			// var res = await getAPI(SysAuthApi).tenantDbListGet();
-			// state.tenantList = res.data.result ?? [];
-			// if (state.tenantList.length > 0) state.ruleForm.tenantId = state.tenantList[0].id ?? 0;
-
 			// 是否开启验证码验证
 			var res1 = await getAPI(SysAuthApi).captchaFlagGet();
 			state.captchaEnabled = res1.data.result ?? true;