😎优化系统配置与登录验证相关代码
This commit is contained in:
parent
f84a6fc50a
commit
f77ee3c15e
@ -25,8 +25,8 @@ public class SysConfigSeedData : ISqlSugarEntitySeedData<SysConfig>
|
|||||||
new SysConfig{ Id=1300000000131, Name="日志保留天数", Code=ConfigConst.SysLogRetentionDays, Value="180", SysFlag=YesNoEnum.Y, Remark="日志保留天数(天)", OrderNo=40, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000131, Name="日志保留天数", Code=ConfigConst.SysLogRetentionDays, Value="180", SysFlag=YesNoEnum.Y, Remark="日志保留天数(天)", OrderNo=40, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000141, Name="记录操作日志", Code=ConfigConst.SysOpLog, Value="True", SysFlag=YesNoEnum.Y, Remark="是否记录操作日志", OrderNo=50, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000141, Name="记录操作日志", Code=ConfigConst.SysOpLog, Value="True", SysFlag=YesNoEnum.Y, Remark="是否记录操作日志", OrderNo=50, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000151, Name="单设备登录", Code=ConfigConst.SysSingleLogin, Value="False", SysFlag=YesNoEnum.Y, Remark="是否开启单设备登录", OrderNo=60, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000151, Name="单设备登录", Code=ConfigConst.SysSingleLogin, Value="False", SysFlag=YesNoEnum.Y, Remark="是否开启单设备登录", OrderNo=60, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000161, Name="登录二次验证", Code=ConfigConst.SysSecondVer, Value="False", SysFlag=YesNoEnum.Y, Remark="是否开启登录二次验证", OrderNo=70, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000161, Name="登录二次验证", Code=ConfigConst.SysSecondVer, Value="False", SysFlag=YesNoEnum.Y, Remark="是否开启登录二次验证", OrderNo=70, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000171, Name="图形验证码", Code=ConfigConst.SysCaptcha, Value="True", SysFlag=YesNoEnum.Y, Remark="是否开启图形验证码", OrderNo=80, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000171, Name="图形验证码", Code=ConfigConst.SysCaptcha, Value="True", SysFlag=YesNoEnum.Y, Remark="是否开启图形验证码", OrderNo=80, GroupCode="WebConfig", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000181, Name="Token过期时间", Code=ConfigConst.SysTokenExpire, Value="10080", SysFlag=YesNoEnum.Y, Remark="Token过期时间(分钟)", OrderNo=90, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000181, Name="Token过期时间", Code=ConfigConst.SysTokenExpire, Value="10080", SysFlag=YesNoEnum.Y, Remark="Token过期时间(分钟)", OrderNo=90, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000191, Name="RefreshToken过期时间", Code=ConfigConst.SysRefreshTokenExpire, Value="20160", SysFlag=YesNoEnum.Y, Remark="刷新Token过期时间(分钟)(一般 refresh_token 的有效时间 > 2 * access_token 的有效时间)", OrderNo=100, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000191, Name="RefreshToken过期时间", Code=ConfigConst.SysRefreshTokenExpire, Value="20160", SysFlag=YesNoEnum.Y, Remark="刷新Token过期时间(分钟)(一般 refresh_token 的有效时间 > 2 * access_token 的有效时间)", OrderNo=100, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
new SysConfig{ Id=1300000000201, Name="发送异常日志邮件", Code=ConfigConst.SysErrorMail, Value="True", SysFlag=YesNoEnum.Y, Remark="是否发送异常日志邮件", OrderNo=110, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
new SysConfig{ Id=1300000000201, Name="发送异常日志邮件", Code=ConfigConst.SysErrorMail, Value="True", SysFlag=YesNoEnum.Y, Remark="是否发送异常日志邮件", OrderNo=110, GroupCode="Default", CreateTime=DateTime.Parse("2022-02-10 00:00:00") },
|
||||||
|
|||||||
@ -324,20 +324,6 @@ public class SysAuthService : IDynamicApiController, ITransient
|
|||||||
_httpContextAccessor.HttpContext.SignoutToSwagger();
|
_httpContextAccessor.HttpContext.SignoutToSwagger();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取登录配置 🔖
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
[AllowAnonymous]
|
|
||||||
[SuppressMonitor]
|
|
||||||
[DisplayName("获取登录配置")]
|
|
||||||
public async Task<dynamic> GetLoginConfig()
|
|
||||||
{
|
|
||||||
var secondVerEnabled = await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysSecondVer);
|
|
||||||
var captchaEnabled = await _sysConfigService.GetConfigValue<bool>(ConfigConst.SysCaptcha);
|
|
||||||
return new { SecondVerEnabled = secondVerEnabled, CaptchaEnabled = captchaEnabled };
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取验证码 🔖
|
/// 获取验证码 🔖
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -55,4 +55,14 @@ public class InfoSaveInput
|
|||||||
/// ICP地址
|
/// ICP地址
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string SysIcpUrl { get; set; }
|
public string SysIcpUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 登录二次验证
|
||||||
|
/// </summary>
|
||||||
|
public bool? SysSecondVer { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图形验证码
|
||||||
|
/// </summary>
|
||||||
|
public bool? SysCaptcha { get; set; }
|
||||||
}
|
}
|
||||||
@ -245,6 +245,8 @@ public class SysConfigService : IDynamicApiController, ITransient
|
|||||||
var sysCopyright = await GetConfigValue<string>(ConfigConst.SysWebCopyright);
|
var sysCopyright = await GetConfigValue<string>(ConfigConst.SysWebCopyright);
|
||||||
var sysIcp = await GetConfigValue<string>(ConfigConst.SysWebIcp);
|
var sysIcp = await GetConfigValue<string>(ConfigConst.SysWebIcp);
|
||||||
var sysIcpUrl = await GetConfigValue<string>(ConfigConst.SysWebIcpUrl);
|
var sysIcpUrl = await GetConfigValue<string>(ConfigConst.SysWebIcpUrl);
|
||||||
|
var sysSecondVer = await GetConfigValue<bool>(ConfigConst.SysSecondVer);
|
||||||
|
var sysCaptcha = await GetConfigValue<bool>(ConfigConst.SysCaptcha);
|
||||||
|
|
||||||
return new
|
return new
|
||||||
{
|
{
|
||||||
@ -255,7 +257,9 @@ public class SysConfigService : IDynamicApiController, ITransient
|
|||||||
SysWatermark = sysWatermark,
|
SysWatermark = sysWatermark,
|
||||||
SysCopyright = sysCopyright,
|
SysCopyright = sysCopyright,
|
||||||
SysIcp = sysIcp,
|
SysIcp = sysIcp,
|
||||||
SysIcpUrl = sysIcpUrl
|
SysIcpUrl = sysIcpUrl,
|
||||||
|
SysSecondVer = sysSecondVer,
|
||||||
|
SysCaptcha = sysCaptcha
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,5 +312,7 @@ public class SysConfigService : IDynamicApiController, ITransient
|
|||||||
await UpdateConfigValue(ConfigConst.SysWebCopyright, input.SysCopyright);
|
await UpdateConfigValue(ConfigConst.SysWebCopyright, input.SysCopyright);
|
||||||
await UpdateConfigValue(ConfigConst.SysWebIcp, input.SysIcp);
|
await UpdateConfigValue(ConfigConst.SysWebIcp, input.SysIcp);
|
||||||
await UpdateConfigValue(ConfigConst.SysWebIcpUrl, input.SysIcpUrl);
|
await UpdateConfigValue(ConfigConst.SysWebIcpUrl, input.SysIcpUrl);
|
||||||
|
await UpdateConfigValue(ConfigConst.SysSecondVer, (input.SysSecondVer ?? false).ToString());
|
||||||
|
await UpdateConfigValue(ConfigConst.SysCaptcha, (input.SysCaptcha ?? true).ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -133,6 +133,9 @@ const loadSysInfo = () => {
|
|||||||
themeConfig.value.watermarkText = data.sysWatermark;
|
themeConfig.value.watermarkText = data.sysWatermark;
|
||||||
// 版权说明
|
// 版权说明
|
||||||
themeConfig.value.copyright = data.sysCopyright;
|
themeConfig.value.copyright = data.sysCopyright;
|
||||||
|
// 登录验证
|
||||||
|
themeConfig.value.secondVer = data.sysSecondVer;
|
||||||
|
themeConfig.value.captcha = data.sysCaptcha;
|
||||||
|
|
||||||
// 更新 favicon
|
// 更新 favicon
|
||||||
updateFavicon(data.sysLogo);
|
updateFavicon(data.sysLogo);
|
||||||
|
|||||||
@ -173,49 +173,6 @@ export const SysAuthApiAxiosParamCreator = function (configuration?: Configurati
|
|||||||
options: localVarRequestOptions,
|
options: localVarRequestOptions,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 获取登录配置 🔖
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
*/
|
|
||||||
apiSysAuthLoginConfigGet: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
||||||
const localVarPath = `/api/sysAuth/loginConfig`;
|
|
||||||
// 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,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 手机号登录 🔖
|
* @summary 手机号登录 🔖
|
||||||
@ -556,19 +513,6 @@ export const SysAuthApiFp = function(configuration?: Configuration) {
|
|||||||
return axios.request(axiosRequestArgs);
|
return axios.request(axiosRequestArgs);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 获取登录配置 🔖
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
*/
|
|
||||||
async apiSysAuthLoginConfigGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultObject>>> {
|
|
||||||
const localVarAxiosArgs = await SysAuthApiAxiosParamCreator(configuration).apiSysAuthLoginConfigGet(options);
|
|
||||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
||||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
||||||
return axios.request(axiosRequestArgs);
|
|
||||||
};
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 手机号登录 🔖
|
* @summary 手机号登录 🔖
|
||||||
@ -689,15 +633,6 @@ export const SysAuthApiFactory = function (configuration?: Configuration, basePa
|
|||||||
async apiSysAuthCaptchaGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> {
|
async apiSysAuthCaptchaGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> {
|
||||||
return SysAuthApiFp(configuration).apiSysAuthCaptchaGet(options).then((request) => request(axios, basePath));
|
return SysAuthApiFp(configuration).apiSysAuthCaptchaGet(options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 获取登录配置 🔖
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
*/
|
|
||||||
async apiSysAuthLoginConfigGet(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> {
|
|
||||||
return SysAuthApiFp(configuration).apiSysAuthLoginConfigGet(options).then((request) => request(axios, basePath));
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 手机号登录 🔖
|
* @summary 手机号登录 🔖
|
||||||
@ -798,16 +733,6 @@ export class SysAuthApi extends BaseAPI {
|
|||||||
public async apiSysAuthCaptchaGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> {
|
public async apiSysAuthCaptchaGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> {
|
||||||
return SysAuthApiFp(this.configuration).apiSysAuthCaptchaGet(options).then((request) => request(this.axios, this.basePath));
|
return SysAuthApiFp(this.configuration).apiSysAuthCaptchaGet(options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 获取登录配置 🔖
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
* @memberof SysAuthApi
|
|
||||||
*/
|
|
||||||
public async apiSysAuthLoginConfigGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> {
|
|
||||||
return SysAuthApiFp(this.configuration).apiSysAuthLoginConfigGet(options).then((request) => request(this.axios, this.basePath));
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 手机号登录 🔖
|
* @summary 手机号登录 🔖
|
||||||
|
|||||||
@ -91,4 +91,20 @@ export interface InfoSaveInput {
|
|||||||
* @memberof InfoSaveInput
|
* @memberof InfoSaveInput
|
||||||
*/
|
*/
|
||||||
sysIcpUrl?: string | null;
|
sysIcpUrl?: string | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录二次验证
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof InfoSaveInput
|
||||||
|
*/
|
||||||
|
sysSecondVer?: boolean | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图形验证码
|
||||||
|
*
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof InfoSaveInput
|
||||||
|
*/
|
||||||
|
sysCaptcha?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|||||||
102
Web/src/types/pinia.d.ts
vendored
102
Web/src/types/pinia.d.ts
vendored
@ -45,58 +45,60 @@ declare interface RoutesListState<T = any> {
|
|||||||
// 布局配置
|
// 布局配置
|
||||||
declare interface ThemeConfigState {
|
declare interface ThemeConfigState {
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
isDrawer: boolean;
|
isDrawer: boolean; // 是否开启抽屉配置
|
||||||
primary: string;
|
primary: string; // 主题颜色
|
||||||
topBar: string;
|
topBar: string; // 顶部栏背景
|
||||||
topBarColor: string;
|
topBarColor: string; // 顶部栏背景色
|
||||||
isTopBarColorGradual: boolean;
|
isTopBarColorGradual: boolean; // 是否顶部栏背景渐变
|
||||||
menuBar: string;
|
menuBar: string; // 侧边栏菜单栏背景
|
||||||
menuBarColor: string;
|
menuBarColor: string; // 侧边栏菜单栏背景色
|
||||||
menuBarActiveColor: string;
|
menuBarActiveColor: string; // 侧边栏激活项背景色
|
||||||
isMenuBarColorGradual: boolean;
|
isMenuBarColorGradual: boolean; // 是否侧边栏菜单栏背景渐变
|
||||||
columnsMenuBar: string;
|
columnsMenuBar: string; // 侧边栏菜单栏背景
|
||||||
columnsMenuBarColor: string;
|
columnsMenuBarColor: string; // 侧边栏菜单栏背景
|
||||||
isColumnsMenuBarColorGradual: boolean;
|
isColumnsMenuBarColorGradual: boolean; // 是否侧边栏菜单栏背景渐变
|
||||||
isColumnsMenuHoverPreload: boolean;
|
isColumnsMenuHoverPreload: boolean; // 是否鼠标悬停预加载路由
|
||||||
columnsLogoHeight: number;
|
columnsLogoHeight: number; // 侧边栏logo高度
|
||||||
columnsMenuWidth: number;
|
columnsMenuWidth: number; // 侧边栏宽度
|
||||||
columnsMenuHeight: number;
|
columnsMenuHeight: number; // 侧边栏高度
|
||||||
isCollapse: boolean;
|
isCollapse: boolean; // 是否水平折叠收起菜单(支持手机端)
|
||||||
isUniqueOpened: boolean;
|
isUniqueOpened: boolean; // 是否只保持一个菜单的展开
|
||||||
isFixedHeader: boolean;
|
isFixedHeader: boolean; // 是否固定头部
|
||||||
isFixedHeaderChange: boolean;
|
isFixedHeaderChange: boolean; // 是否固定头部
|
||||||
isClassicSplitMenu: boolean;
|
isClassicSplitMenu: boolean; // 是否分割菜单
|
||||||
isLockScreen: boolean;
|
isLockScreen: boolean; // 是否开启锁屏
|
||||||
lockScreenTime: number;
|
lockScreenTime: number; // 锁屏时间
|
||||||
isShowLogo: boolean;
|
isShowLogo: boolean; // 是否显示logo
|
||||||
isShowLogoChange: boolean;
|
isShowLogoChange: boolean; // 是否显示logo动画
|
||||||
isBreadcrumb: boolean;
|
isBreadcrumb: boolean; // 是否显示面包屑
|
||||||
isTagsview: boolean;
|
isTagsview: boolean; // 是否显示多标签页
|
||||||
isBreadcrumbIcon: boolean;
|
isBreadcrumbIcon: boolean; // 是否显示面包屑图标
|
||||||
isTagsviewIcon: boolean;
|
isTagsviewIcon: boolean; // 是否显示多标签页图标
|
||||||
isCacheTagsView: boolean;
|
isCacheTagsView: boolean; // 是否缓存 TagsView
|
||||||
isSortableTagsView: boolean;
|
isSortableTagsView: boolean; // 是否开启拖拽排序
|
||||||
isShareTagsView: boolean;
|
isShareTagsView: boolean; // 是否开启多标签页缓存
|
||||||
isFooter: boolean;
|
isFooter: boolean; // 是否显示页脚
|
||||||
isGrayscale: boolean;
|
isGrayscale: boolean; // 是否灰度模式
|
||||||
isInvert: boolean;
|
isInvert: boolean; // 是否色弱模式
|
||||||
isIsDark: boolean;
|
isIsDark: boolean; // 是否暗黑模式
|
||||||
isWatermark: boolean;
|
isWatermark: boolean; // 是否开启水印
|
||||||
watermarkText: string;
|
watermarkText: string; // 水印内容
|
||||||
tagsStyle: string;
|
tagsStyle: string; // 标签页主题
|
||||||
animation: string;
|
animation: string; // 动画
|
||||||
columnsAsideStyle: string;
|
columnsAsideStyle: string; // 侧边栏主题
|
||||||
columnsAsideLayout: string;
|
columnsAsideLayout: string; // 侧边栏布局
|
||||||
layout: string;
|
layout: string; // 布局模式
|
||||||
isRequestRoutes: boolean;
|
isRequestRoutes: boolean; // 是否开启路由懒加载
|
||||||
globalTitle: string;
|
globalI18n: string; // 是否开启国际化
|
||||||
globalViceTitle: string;
|
globalComponentSize: string; // 全局组件大小
|
||||||
globalViceTitleMsg: string;
|
globalTitle: string; // 全局标题
|
||||||
copyright: string;
|
globalViceTitle: string; // 全局副标题
|
||||||
globalI18n: string;
|
globalViceTitleMsg: string; // 全局副标题消息
|
||||||
globalComponentSize: string;
|
copyright: string; // 版权信息
|
||||||
logoUrl: string; // 系统 logo 地址
|
logoUrl: string; // 系统 logo 地址
|
||||||
icp: string; // Icp备案号
|
icp: string; // Icp备案号
|
||||||
icpUrl: string; // Icp地址
|
icpUrl: string; // Icp地址
|
||||||
|
secondVer: boolean; // 是否开启二级验证
|
||||||
|
captcha: boolean; // 是否开启验证码
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -133,6 +133,7 @@ const state = reactive({
|
|||||||
capsLockVisible: false,
|
capsLockVisible: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 页面初始化
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
// 若URL带有Token参数(第三方登录)
|
// 若URL带有Token参数(第三方登录)
|
||||||
var accessToken = route.query.token;
|
var accessToken = route.query.token;
|
||||||
@ -141,9 +142,8 @@ onMounted(async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取登录配置
|
// 获取登录配置
|
||||||
var res1 = await getAPI(SysAuthApi).apiSysAuthLoginConfigGet();
|
state.secondVerEnabled = themeConfig.value.secondVer ?? true;
|
||||||
state.secondVerEnabled = res1.data.result.secondVerEnabled ?? true;
|
state.captchaEnabled = themeConfig.value.captcha ?? true;
|
||||||
state.captchaEnabled = res1.data.result.captchaEnabled ?? true;
|
|
||||||
|
|
||||||
// 获取验证码
|
// 获取验证码
|
||||||
getCaptcha();
|
getCaptcha();
|
||||||
@ -152,7 +152,7 @@ onMounted(async () => {
|
|||||||
document.addEventListener('keyup', handleKeyPress);
|
document.addEventListener('keyup', handleKeyPress);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 页面初始化
|
// 页面卸载
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
document.removeEventListener('keyup', handleKeyPress);
|
document.removeEventListener('keyup', handleKeyPress);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -37,6 +37,19 @@
|
|||||||
<el-descriptions-item label="ICP地址">
|
<el-descriptions-item label="ICP地址">
|
||||||
<el-input v-model="state.formData.sysIcpUrl" />
|
<el-input v-model="state.formData.sysIcpUrl" />
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="登录二次验证">
|
||||||
|
<el-radio-group v-model="state.formData.sysSecondVer">
|
||||||
|
<el-radio :value="true">启用</el-radio>
|
||||||
|
<el-radio :value="false">禁用</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="图形验证码">
|
||||||
|
<el-radio-group v-model="state.formData.sysCaptcha">
|
||||||
|
<el-radio :value="true">启用</el-radio>
|
||||||
|
<el-radio :value="false">禁用</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<el-button type="primary" icon="ele-SuccessFilled" @click="onSave">保存</el-button>
|
<el-button type="primary" icon="ele-SuccessFilled" @click="onSave">保存</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -68,6 +81,8 @@ const state = reactive({
|
|||||||
sysCopyright: '',
|
sysCopyright: '',
|
||||||
sysIcp: '',
|
sysIcp: '',
|
||||||
sysIcpUrl: '',
|
sysIcpUrl: '',
|
||||||
|
sysSecondVer: undefined,
|
||||||
|
sysCaptcha: undefined,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -101,6 +116,8 @@ const onSave = async () => {
|
|||||||
sysCopyright: state.formData.sysCopyright,
|
sysCopyright: state.formData.sysCopyright,
|
||||||
sysIcp: state.formData.sysIcp,
|
sysIcp: state.formData.sysIcp,
|
||||||
sysIcpUrl: state.formData.sysIcpUrl,
|
sysIcpUrl: state.formData.sysIcpUrl,
|
||||||
|
sysSecondVer: state.formData.sysSecondVer,
|
||||||
|
sysCaptcha: state.formData.sysCaptcha,
|
||||||
});
|
});
|
||||||
if (res.data!.type !== 'success') return;
|
if (res.data!.type !== 'success') return;
|
||||||
|
|
||||||
@ -134,6 +151,8 @@ const loadData = async () => {
|
|||||||
sysCopyright: result.sysCopyright,
|
sysCopyright: result.sysCopyright,
|
||||||
sysIcp: result.sysIcp,
|
sysIcp: result.sysIcp,
|
||||||
sysIcpUrl: result.sysIcpUrl,
|
sysIcpUrl: result.sysIcpUrl,
|
||||||
|
sysSecondVer: result.sysSecondVer,
|
||||||
|
sysCaptcha: result.sysCaptcha,
|
||||||
};
|
};
|
||||||
} finally {
|
} finally {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user