😎1、优化系统配置 2、代码优化
This commit is contained in:
parent
2b0b94542a
commit
282788e82d
@ -23,7 +23,7 @@
|
||||
"DocExpansionState": "List", // List、Full、None
|
||||
"EnableAllGroups": true,
|
||||
//"ServerDir": "xxx", // 二级虚拟目录并且开启 Servers 选择列表
|
||||
"HideServers": true,
|
||||
"HideServers": false,
|
||||
"Servers": [
|
||||
{
|
||||
"Url": "http://ip/xxx",
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
<PackageReference Include="Magicodes.IE.Word" Version="2.7.5.2" />
|
||||
<PackageReference Include="MailKit" Version="4.9.0" />
|
||||
<PackageReference Include="Microsoft.PowerShell.SDK" Version="7.4.6" />
|
||||
<PackageReference Include="MiniExcel" Version="1.36.1" />
|
||||
<PackageReference Include="MiniExcel" Version="1.37.0" />
|
||||
<PackageReference Include="MiniWord" Version="0.9.2" />
|
||||
<PackageReference Include="MQTTnet" Version="5.0.1.1416" />
|
||||
<PackageReference Include="MySqlBackup.NET.MySqlConnector" Version="2.3.8" />
|
||||
@ -49,7 +49,7 @@
|
||||
<PackageReference Include="SSH.NET" Version="2024.2.0" />
|
||||
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.5.1" />
|
||||
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
||||
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1166" />
|
||||
<PackageReference Include="TencentCloudSDK.Sms" Version="3.0.1168" />
|
||||
<PackageReference Include="UAParser" Version="3.1.47" />
|
||||
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
|
||||
</ItemGroup>
|
||||
|
||||
@ -170,12 +170,12 @@ public partial class SysTenant : EntityBase
|
||||
/// <summary>
|
||||
/// 图形验证码
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "图形验证码", DefaultValue = "1")]
|
||||
[SugarColumn(ColumnDescription = "图形验证码")]
|
||||
public virtual bool Captcha { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 登录二次验证
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnDescription = "登录二次验证", DefaultValue = "0")]
|
||||
[SugarColumn(ColumnDescription = "登录二次验证")]
|
||||
public virtual bool SecondVer { get; set; } = false;
|
||||
}
|
||||
45
Admin.NET/Admin.NET.Core/Entity/SysTenantCarousel.cs
Normal file
45
Admin.NET/Admin.NET.Core/Entity/SysTenantCarousel.cs
Normal file
@ -0,0 +1,45 @@
|
||||
//// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||
////
|
||||
//// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||
////
|
||||
//// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!
|
||||
|
||||
//namespace Admin.NET.Core;
|
||||
|
||||
///// <summary>
|
||||
///// 系统租户轮播图表
|
||||
///// </summary>
|
||||
//[SugarTable(null, "系统租户轮播图表")]
|
||||
//[SysTable]
|
||||
//public partial class SysTenantCarousel : EntityBaseId
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// 租户Id
|
||||
// /// </summary>
|
||||
// [SugarColumn(ColumnDescription = "租户Id")]
|
||||
// public long TenantId { get; set; }
|
||||
|
||||
// ///// <summary>
|
||||
// ///// 文件Id
|
||||
// ///// </summary>
|
||||
// //[SugarColumn(ColumnDescription = "文件Id")]
|
||||
// //public long? FileId { get; set; }
|
||||
|
||||
// /// <summary>
|
||||
// /// 文件名称
|
||||
// /// </summary>
|
||||
// [SugarColumn(ColumnDescription = "文件名称", Length = 64), MaxLength(64)]
|
||||
// public string? FileName { get; set; }
|
||||
|
||||
// /// <summary>
|
||||
// /// 文件路径
|
||||
// /// </summary>
|
||||
// [SugarColumn(ColumnDescription = "文件路径", Length = 256), MaxLength(256)]
|
||||
// public string? FilePath { get; set; }
|
||||
|
||||
// /// <summary>
|
||||
// /// 排序
|
||||
// /// </summary>
|
||||
// [SugarColumn(ColumnDescription = "排序", DefaultValue = "100")]
|
||||
// public int OrderNo { get; set; } = 100;
|
||||
//}
|
||||
@ -13,7 +13,7 @@ namespace Admin.NET.Core.Service;
|
||||
/// 系统登录授权服务 🧩
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(Order = 500, Description = "登录授权")]
|
||||
[AppApiDescription("账号密码登录 🔖")]
|
||||
[AppApiDescription("登录授权")]
|
||||
public class SysAuthService : IDynamicApiController, ITransient
|
||||
{
|
||||
private readonly UserManager _userManager;
|
||||
|
||||
@ -97,4 +97,9 @@ public class SysInfoInput
|
||||
/// 登录二次验证
|
||||
/// </summary>
|
||||
public bool SecondVer { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 轮播图
|
||||
/// </summary>
|
||||
public List<IFormFile> CarouselFiles { get; set; }
|
||||
}
|
||||
@ -566,7 +566,7 @@ public class SysTenantService : IDynamicApiController, ITransient
|
||||
var tenant = await _sysTenantRep.GetFirstAsync(u => u.Id == tenantId);
|
||||
if (tenant == null) return "";
|
||||
|
||||
// 若租户系统标题为空,则获取默认租户系统信息
|
||||
// 若租户系统标题为空,则获取默认租户系统信息(兼容已有未配置的租户)
|
||||
if (string.IsNullOrWhiteSpace(tenant.Title))
|
||||
tenant = await _sysTenantRep.GetFirstAsync(u => u.Id == SqlSugarConst.DefaultTenantId);
|
||||
|
||||
@ -615,6 +615,8 @@ public class SysTenantService : IDynamicApiController, ITransient
|
||||
tenant = input.Adapt<SysTenant>();
|
||||
tenant.Id = input.TenantId;
|
||||
|
||||
// 保存轮播图
|
||||
|
||||
// logo 不为空才保存
|
||||
if (!string.IsNullOrEmpty(input.LogoBase64))
|
||||
{
|
||||
@ -629,8 +631,8 @@ public class SysTenantService : IDynamicApiController, ITransient
|
||||
// 根据文件名取扩展名
|
||||
var ext = string.IsNullOrWhiteSpace(input.LogoFileName) ? ".png" : Path.GetExtension(input.LogoFileName);
|
||||
// 本地图标保存路径
|
||||
var path = "upload";
|
||||
var fileName = $"{input.TenantId}-logo{ext}".ToLower();
|
||||
var path = $"upload/{input.TenantId}/";
|
||||
var fileName = $"logo{ext}".ToLower();
|
||||
var absoluteFilePath = Path.Combine(App.WebHostEnvironment.WebRootPath, path, fileName);
|
||||
|
||||
// 删除已存在文件
|
||||
@ -648,6 +650,7 @@ public class SysTenantService : IDynamicApiController, ITransient
|
||||
// 保存图标配置
|
||||
tenant.Logo = $"/{path}/{fileName}";
|
||||
}
|
||||
|
||||
await _sysTenantRep.AsUpdateable(tenant).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "admin.net.pro",
|
||||
"type": "module",
|
||||
"version": "2.4.33",
|
||||
"lastBuildTime": "2025.01.17",
|
||||
"lastBuildTime": "2025.01.21",
|
||||
"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
|
||||
"author": "zuohuaijun",
|
||||
"license": "MIT",
|
||||
@ -51,7 +51,7 @@
|
||||
"mqtt": "^5.10.3",
|
||||
"nprogress": "^0.2.0",
|
||||
"ol": "^10.3.1",
|
||||
"pinia": "^2.3.0",
|
||||
"pinia": "^2.3.1",
|
||||
"print-js": "^1.6.0",
|
||||
"push.js": "^1.0.12",
|
||||
"qrcodejs2-fixes": "^0.0.2",
|
||||
@ -74,7 +74,7 @@
|
||||
"vue-router": "^4.5.0",
|
||||
"vue-signature-pad": "^3.0.2",
|
||||
"vue3-tree-org": "^4.2.2",
|
||||
"vxe-pc-ui": "^4.3.75",
|
||||
"vxe-pc-ui": "^4.3.76",
|
||||
"vxe-table": "^4.10.0",
|
||||
"vxe-table-plugin-element": "^4.0.4",
|
||||
"vxe-table-plugin-export-xlsx": "^4.0.7",
|
||||
@ -88,8 +88,8 @@
|
||||
"@types/node": "^20.17.14",
|
||||
"@types/nprogress": "^0.2.3",
|
||||
"@types/sortablejs": "^1.15.8",
|
||||
"@typescript-eslint/eslint-plugin": "^8.20.0",
|
||||
"@typescript-eslint/parser": "^8.20.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.21.0",
|
||||
"@typescript-eslint/parser": "^8.21.0",
|
||||
"@vitejs/plugin-vue": "^5.2.1",
|
||||
"@vitejs/plugin-vue-jsx": "^4.1.1",
|
||||
"@vue/compiler-sfc": "^3.5.13",
|
||||
@ -97,13 +97,13 @@
|
||||
"eslint": "^9.18.0",
|
||||
"eslint-plugin-vue": "^9.32.0",
|
||||
"globals": "^15.14.0",
|
||||
"less": "^4.2.1",
|
||||
"less": "^4.2.2",
|
||||
"prettier": "^3.4.2",
|
||||
"rollup-plugin-visualizer": "^5.14.0",
|
||||
"sass": "^1.83.4",
|
||||
"terser": "^5.37.0",
|
||||
"typescript": "^5.7.3",
|
||||
"vite": "^6.0.7",
|
||||
"vite": "^6.0.10",
|
||||
"vite-plugin-cdn-import": "^1.0.1",
|
||||
"vite-plugin-compression2": "^1.3.3",
|
||||
"vite-plugin-vue-setup-extend": "^0.4.0",
|
||||
|
||||
@ -174,6 +174,59 @@ export const SysCommonApiAxiosParamCreator = function (configuration?: Configura
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 生成所有移动端接口 🔖
|
||||
* @param {string} [groupName]
|
||||
* @param {boolean} [isAppApi]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiSysCommonGenerateAppApiGet: async (groupName?: string, isAppApi?: boolean, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/sysCommon/generateAppApi`;
|
||||
// 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;
|
||||
}
|
||||
|
||||
if (groupName !== undefined) {
|
||||
localVarQueryParameter['groupName'] = groupName;
|
||||
}
|
||||
|
||||
if (isAppApi !== undefined) {
|
||||
localVarQueryParameter['isAppApi'] = isAppApi;
|
||||
}
|
||||
|
||||
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 获取MD5加密字符串 🏆
|
||||
@ -512,6 +565,21 @@ export const SysCommonApiFp = function(configuration?: Configuration) {
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 生成所有移动端接口 🔖
|
||||
* @param {string} [groupName]
|
||||
* @param {boolean} [isAppApi]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysCommonGenerateAppApiGet(groupName?: string, isAppApi?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
||||
const localVarAxiosArgs = await SysCommonApiAxiosParamCreator(configuration).apiSysCommonGenerateAppApiGet(groupName, isAppApi, options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取MD5加密字符串 🏆
|
||||
@ -634,6 +702,17 @@ export const SysCommonApiFactory = function (configuration?: Configuration, base
|
||||
async apiSysCommonDownloadErrorExcelTempPost(fileName?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultIActionResult>> {
|
||||
return SysCommonApiFp(configuration).apiSysCommonDownloadErrorExcelTempPost(fileName, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 生成所有移动端接口 🔖
|
||||
* @param {string} [groupName]
|
||||
* @param {boolean} [isAppApi]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysCommonGenerateAppApiGet(groupName?: string, isAppApi?: boolean, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||
return SysCommonApiFp(configuration).apiSysCommonGenerateAppApiGet(groupName, isAppApi, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 获取MD5加密字符串 🏆
|
||||
@ -736,6 +815,18 @@ export class SysCommonApi extends BaseAPI {
|
||||
public async apiSysCommonDownloadErrorExcelTempPost(fileName?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultIActionResult>> {
|
||||
return SysCommonApiFp(this.configuration).apiSysCommonDownloadErrorExcelTempPost(fileName, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 生成所有移动端接口 🔖
|
||||
* @param {string} [groupName]
|
||||
* @param {boolean} [isAppApi]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysCommonApi
|
||||
*/
|
||||
public async apiSysCommonGenerateAppApiGet(groupName?: string, isAppApi?: boolean, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||
return SysCommonApiFp(this.configuration).apiSysCommonGenerateAppApiGet(groupName, isAppApi, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 获取MD5加密字符串 🏆
|
||||
|
||||
@ -132,54 +132,6 @@ export const SysUserApiAxiosParamCreator = function (configuration?: Configurati
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新用户基本信息 🔖
|
||||
* @param {SysUser} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiSysUserBaseInfoPost: async (body?: SysUser, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/sysUser/baseInfo`;
|
||||
// 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: 'POST', ...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;
|
||||
}
|
||||
|
||||
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
|
||||
|
||||
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};
|
||||
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
||||
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
||||
|
||||
return {
|
||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 修改用户密码 🔖
|
||||
@ -614,6 +566,54 @@ export const SysUserApiAxiosParamCreator = function (configuration?: Configurati
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新用户基本信息 🔖
|
||||
* @param {SysUser} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
apiSysUserUpdateBaseInfoPost: async (body?: SysUser, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/api/sysUser/updateBaseInfo`;
|
||||
// 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: 'POST', ...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;
|
||||
}
|
||||
|
||||
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
|
||||
|
||||
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};
|
||||
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
||||
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
||||
|
||||
return {
|
||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||
options: localVarRequestOptions,
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新用户 🔖
|
||||
@ -741,20 +741,6 @@ export const SysUserApiFp = function(configuration?: Configuration) {
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新用户基本信息 🔖
|
||||
* @param {SysUser} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysUserBaseInfoPost(body?: SysUser, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultInt32>>> {
|
||||
const localVarAxiosArgs = await SysUserApiAxiosParamCreator(configuration).apiSysUserBaseInfoPost(body, options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 修改用户密码 🔖
|
||||
@ -881,6 +867,20 @@ export const SysUserApiFp = function(configuration?: Configuration) {
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新用户基本信息 🔖
|
||||
* @param {SysUser} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysUserUpdateBaseInfoPost(body?: SysUser, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminNETResultInt32>>> {
|
||||
const localVarAxiosArgs = await SysUserApiAxiosParamCreator(configuration).apiSysUserUpdateBaseInfoPost(body, options);
|
||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||
return axios.request(axiosRequestArgs);
|
||||
};
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新用户 🔖
|
||||
@ -936,16 +936,6 @@ export const SysUserApiFactory = function (configuration?: Configuration, basePa
|
||||
async apiSysUserBaseInfoGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultSysUser>> {
|
||||
return SysUserApiFp(configuration).apiSysUserBaseInfoGet(options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新用户基本信息 🔖
|
||||
* @param {SysUser} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysUserBaseInfoPost(body?: SysUser, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultInt32>> {
|
||||
return SysUserApiFp(configuration).apiSysUserBaseInfoPost(body, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 修改用户密码 🔖
|
||||
@ -1036,6 +1026,16 @@ export const SysUserApiFactory = function (configuration?: Configuration, basePa
|
||||
async apiSysUserUnlockLoginPost(body?: UnlockLoginInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||
return SysUserApiFp(configuration).apiSysUserUnlockLoginPost(body, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新用户基本信息 🔖
|
||||
* @param {SysUser} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async apiSysUserUpdateBaseInfoPost(body?: SysUser, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminNETResultInt32>> {
|
||||
return SysUserApiFp(configuration).apiSysUserUpdateBaseInfoPost(body, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @summary 更新用户 🔖
|
||||
@ -1086,17 +1086,6 @@ export class SysUserApi extends BaseAPI {
|
||||
public async apiSysUserBaseInfoGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultSysUser>> {
|
||||
return SysUserApiFp(this.configuration).apiSysUserBaseInfoGet(options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 更新用户基本信息 🔖
|
||||
* @param {SysUser} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysUserApi
|
||||
*/
|
||||
public async apiSysUserBaseInfoPost(body?: SysUser, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultInt32>> {
|
||||
return SysUserApiFp(this.configuration).apiSysUserBaseInfoPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 修改用户密码 🔖
|
||||
@ -1196,6 +1185,17 @@ export class SysUserApi extends BaseAPI {
|
||||
public async apiSysUserUnlockLoginPost(body?: UnlockLoginInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||
return SysUserApiFp(this.configuration).apiSysUserUnlockLoginPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 更新用户基本信息 🔖
|
||||
* @param {SysUser} [body]
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof SysUserApi
|
||||
*/
|
||||
public async apiSysUserUpdateBaseInfoPost(body?: SysUser, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminNETResultInt32>> {
|
||||
return SysUserApiFp(this.configuration).apiSysUserUpdateBaseInfoPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @summary 更新用户 🔖
|
||||
|
||||
@ -17,7 +17,7 @@ import { Configuration } from "./configuration";
|
||||
// @ts-ignore
|
||||
import globalAxios, { AxiosRequestConfig, AxiosInstance } from 'axios';
|
||||
|
||||
export const BASE_PATH = "/".replace(/\/+$/, "");
|
||||
export const BASE_PATH = "http://localhost:5005".replace(/\/+$/, "");
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@ -45,6 +45,14 @@ export interface ApiOutput {
|
||||
*/
|
||||
route?: string | null;
|
||||
|
||||
/**
|
||||
* 控制器名称
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ApiOutput
|
||||
*/
|
||||
action?: string | null;
|
||||
|
||||
/**
|
||||
* 请求方式
|
||||
*
|
||||
|
||||
@ -147,4 +147,12 @@ export interface SysInfoInput {
|
||||
* @memberof SysInfoInput
|
||||
*/
|
||||
secondVer?: boolean;
|
||||
|
||||
/**
|
||||
* 轮播图
|
||||
*
|
||||
* @type {Array<Blob>}
|
||||
* @memberof SysInfoInput
|
||||
*/
|
||||
carouselFiles?: Array<Blob> | null;
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@
|
||||
<template #label>
|
||||
<el-icon><ele-Picture /></el-icon> 首页轮播图
|
||||
</template>
|
||||
<el-upload v-model:file-list="carouselFileList" list-type="picture-card" :on-preview="handlePictureCardPreview" :on-remove="handleRemove">
|
||||
<el-upload v-model:file-list="state.carouselFileList" list-type="picture-card" :http-request="uploadCarouselFile" :on-preview="previewCarouselFile" :before-remove="beforeRemoveCarouselFile">
|
||||
<el-icon><ele-Plus /></el-icon>
|
||||
</el-upload>
|
||||
</el-descriptions-item>
|
||||
@ -191,16 +191,12 @@
|
||||
|
||||
<script setup lang="ts" name="sysInfoSetting">
|
||||
import { nextTick, onMounted, reactive, ref } from 'vue';
|
||||
import { ElMessage, UploadInstance, UploadProps, UploadUserFile } from 'element-plus';
|
||||
import { ElMessage, ElMessageBox, UploadInstance } from 'element-plus';
|
||||
import { fileToBase64 } from '/@/utils/base64Conver';
|
||||
import chineseColors from '/@/layout/navBars/topBar/colors.json';
|
||||
|
||||
import { getAPI } from '/@/utils/axios-utils';
|
||||
import { SysInfoInput, SysTenantApi } from '/@/api-services';
|
||||
|
||||
import loginIconTwo from '/@/assets/login-icon-two.svg';
|
||||
import loginIconTwo1 from '/@/assets/login-icon-two1.svg';
|
||||
import loginIconTwo2 from '/@/assets/login-icon-two2.svg';
|
||||
import { SysFileApi, SysInfoInput, SysTenantApi } from '/@/api-services';
|
||||
|
||||
const host = window.location.host;
|
||||
const uploadRef = ref<UploadInstance>();
|
||||
@ -212,24 +208,12 @@ const state = reactive({
|
||||
colorName: '飞燕草蓝', // 主题颜色名称
|
||||
dialogImagePreviewVisible: false, // 预览图片弹窗
|
||||
dialogImagePreviewUrl: '', // 预览图片地址
|
||||
isDelete: false, // 是否删除图片
|
||||
fileList: [] as any, // 轮播图片文件列表
|
||||
fileDeleteList: [] as any, // 删除文件列表
|
||||
carouselFileList: [] as any, // 轮播图片文件列表
|
||||
});
|
||||
|
||||
// 首页轮播图片列表
|
||||
const carouselFileList = ref<UploadUserFile[]>([
|
||||
{
|
||||
name: '1',
|
||||
url: loginIconTwo,
|
||||
},
|
||||
{
|
||||
name: '2',
|
||||
url: loginIconTwo1,
|
||||
},
|
||||
{
|
||||
name: '3',
|
||||
url: loginIconTwo2,
|
||||
},
|
||||
]);
|
||||
|
||||
// 页面初始化
|
||||
onMounted(async () => {
|
||||
await loadSysInfoData();
|
||||
@ -250,6 +234,11 @@ const saveSysInfo = async () => {
|
||||
state.sysInfo.logoFileName = state.logoFile.raw.name;
|
||||
}
|
||||
|
||||
// 轮播图文件列表处理
|
||||
// state.sysInfo.carouselFiles = [];
|
||||
// state.carouselFileList.forEach((e: any) => {
|
||||
// state.sysInfo.carouselFiles.push(e.raw);
|
||||
// });
|
||||
try {
|
||||
state.isLoading = true;
|
||||
await getAPI(SysTenantApi).apiSysTenantSaveSysInfoPost(state.sysInfo);
|
||||
@ -276,14 +265,34 @@ const loadSysInfoData = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 删除轮播图
|
||||
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
|
||||
console.log(uploadFile, uploadFiles);
|
||||
// 上传轮播图文件
|
||||
const uploadCarouselFile = async (e: any) => {
|
||||
await getAPI(SysFileApi).apiSysFileUploadFilePostForm(e.file);
|
||||
};
|
||||
|
||||
// 删除轮播图文件
|
||||
const beforeRemoveCarouselFile = (file: any, fileList: any) => {
|
||||
const result = new Promise((resolve, reject) => {
|
||||
ElMessageBox.confirm(`确定删除此轮播图?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
await getAPI(SysFileApi).apiSysFileDeletePost({ id: 0 });
|
||||
let index = fileList.indexOf(file);
|
||||
fileList.splice(index, 1);
|
||||
})
|
||||
.catch(() => {
|
||||
reject(false);
|
||||
});
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
// 预览轮播图
|
||||
const handlePictureCardPreview: UploadProps['onPreview'] = (uploadFile) => {
|
||||
state.dialogImagePreviewUrl = uploadFile.url!;
|
||||
const previewCarouselFile = (file: any) => {
|
||||
state.dialogImagePreviewUrl = file.url!;
|
||||
state.dialogImagePreviewVisible = true;
|
||||
};
|
||||
|
||||
|
||||
@ -277,7 +277,7 @@ const submitUserBase = () => {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(async () => {
|
||||
await getAPI(SysUserApi).apiSysUserBaseInfoPost(state.ruleFormBase);
|
||||
await getAPI(SysUserApi).apiSysUserUpdateBaseInfoPost(state.ruleFormBase);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user