2
0

fix:添加portal参数配置

This commit is contained in:
zhongzm
2025-02-27 16:12:55 +08:00
parent 21f372c9b5
commit 11e1e4bcea

View File

@@ -175,11 +175,11 @@
</a-input-group>
</a-form-item>
<!-- <a-form-item name="noAuth" :label="t('page.portal.dailyLimit')">-->
<!-- <a-checkbox v-model:checked="addForm.noAuth.dailyLimitEnable">-->
<!-- {{ t('page.portal.enableDailyLimit') }}-->
<!-- </a-checkbox>-->
<!-- </a-form-item>-->
<!-- <a-form-item name="noAuth" :label="t('page.portal.dailyLimit')">-->
<!-- <a-checkbox v-model:checked="addForm.noAuth.dailyLimitEnable">-->
<!-- {{ t('page.portal.enableDailyLimit') }}-->
<!-- </a-checkbox>-->
<!-- </a-form-item>-->
<a-form-item name="httpsRedirectEnable" :label="t('page.portal.httpsRedirect')">
<a-checkbox v-model:checked="addForm.httpsRedirectEnable">
@@ -427,26 +427,69 @@ const URL_PATTERN = new RegExp(
const addForm = ref({
name: '',
enable: true,
enable: true, // 默认启用
ssidList: [],
authType: 4, // 固定为外部 Portal 认证
authTimeout: {
customTimeout: 8,
customTimeoutUnit: 2
customTimeout: 8, // 默认超时时间
customTimeoutUnit: 2 // 默认单位为小时
},
noAuth: {
dailyLimitEnable: false
dailyLimitEnable: false // 默认不启用每日限额
},
httpsRedirectEnable: false,
landingPage: 1,
pageType: 2,
httpsRedirectEnable: false, // 默认不启用 HTTPS 重定向
landingPage: 1, // 默认登录页面
pageType: 2, // 默认页面类型
importedPortalPage: {
id: 'test'
id: 'test' // 默认导入的门户页面 ID
},
externalPortal: {
hostType: 2,
serverUrl: '',
serverUrlScheme: 'http'
hostType: 2, // 默认外部 Portal 服务器类型
serverUrl: '', // 默认服务器 URL
serverUrlScheme: 'http' // 默认协议
},
portalCustomize: { // 新增的默认参数
defaultLanguage: 1,
backgroundPictureId: '',
logoPictureId: '',
logoDisplay: true,
inputBoxColor: '',
inputBoxOpacity: 0,
inputTextColor: '',
inputTextOpacity: 0,
buttonColor: '',
buttonOpacity: 0,
buttonTextColor: '',
buttonTextOpacity: 0,
buttonText: '',
// formAuthButtonText: '',
welcomeEnable: true,
// welcomeInformation: '',
// welcomeTextColor: '',
welcomeTextOpacity: 0,
welcomeTextFontSize: 0,
termsOfServiceEnable: true,
termsOfServiceText: '',
termsOfServiceFontSize: 0,
termsOfServiceUrlTexts: [
{
content: '',
text: ''
}
],
copyrightEnable: false,
copyright: '',
// copyrightTextColor: '',
// copyrightTextOpacity: 0,
copyrightTextFontSize: 12,
redirectionCountDownEnable: true,
advertisement: {
enable: false,
pictureIds: [],
// totalDuration: 0,
// pictureInterval: 0,
// skipEnable: true
}
}
});
@@ -534,17 +577,71 @@ const handleAddConfirm = async () => {
const hide = message.loading(t('common.loading'), 0);
// 创建一个新对象来存储要提交的数据
const submitData = { ...addForm.value };
// 设置默认参数
submitData.authTimeout = {
customTimeout: 8,
customTimeoutUnit: 2
};
submitData.externalPortal = {
hostType: 2,
serverUrl: submitData.externalPortal.serverUrl,
serverUrlScheme: submitData.externalPortal.serverUrlScheme
const submitData = {
...addForm.value,
// 这里可以直接使用默认值
authType: 4, // 固定为外部 Portal 认证
authTimeout: {
customTimeout: 8,
customTimeoutUnit: 2
},
noAuth: {
dailyLimitEnable: false
},
httpsRedirectEnable: false,
landingPage: 1,
pageType: 2,
importedPortalPage: {
id: 'test'
},
externalPortal: {
hostType: 2,
serverUrl: addForm.value.externalPortal.serverUrl, // 确保从 addForm 中获取 serverUrl
serverUrlScheme: addForm.value.externalPortal.serverUrlScheme
},
portalCustomize: { // 新增的默认参数
defaultLanguage: 1,
backgroundPictureId: '',
logoPictureId: '',
logoDisplay: true,
inputBoxColor: "#ffffff",
inputBoxOpacity: 100,
inputTextColor: "#2B2B2B",
inputTextOpacity: 100,
buttonColor: "#00778C",
buttonOpacity: 100,
buttonTextColor: "#FFFFFF",
buttonTextOpacity: 100,
buttonText: "Log In",
// formAuthButtonText: '',
welcomeEnable: false,
// welcomeInformation: '',
// welcomeTextColor: '',
welcomeTextOpacity: 100,
welcomeTextFontSize: 12,
termsOfServiceEnable: false,
termsOfServiceText: "I agree to Terms of Service",
termsOfServiceFontSize: 12,
termsOfServiceUrlTexts: [
{
content: "By accepting this agreement and accessing the wireless network, you acknowledge that you are of legal age, you have read and understood, and agree to be bound by this agreement.",
text: "Terms of Service"
}
],
copyrightEnable: false,
copyright: '',
// copyrightTextColor: '',
// copyrightTextOpacity: 0,
copyrightTextFontSize: 12,
redirectionCountDownEnable: true,
advertisement: {
enable: false,
pictureIds: [],
// totalDuration: 0,
// pictureInterval: 0,
// skipEnable: true
}
}
};
const { error } = await addPortal(selectedSiteId.value, submitData);
@@ -563,23 +660,66 @@ const editVisible = ref(false);
const editFormRef = ref();
const editForm = ref({
name: '',
enable: true,
enable: true, // 默认启用
ssidList: [],
authType: 4, // 固定为外部 Portal 认证
authTimeout: {
customTimeout: 8,
customTimeoutUnit: 2
customTimeout: 8, // 默认超时时间
customTimeoutUnit: 2 // 默认单位为小时
},
httpsRedirectEnable: false,
landingPage: 1,
pageType: 2,
httpsRedirectEnable: false, // 默认不启用 HTTPS 重定向
landingPage: 1, // 默认登录页面
pageType: 2, // 默认页面类型
importedPortalPage: {
id: 'test'
id: 'test' // 默认导入的门户页面 ID
},
externalPortal: {
hostType: 2,
serverUrl: '',
serverUrlScheme: 'http'
hostType: 2, // 默认外部 Portal 服务器类型
serverUrl: '', // 默认服务器 URL
serverUrlScheme: 'http' // 默认协议
},
portalCustomize: { // 新增的默认参数
defaultLanguage: 1,
backgroundPictureId: '',
logoPictureId: '',
logoDisplay: true,
inputBoxColor: "#ffffff",
inputBoxOpacity: 100,
inputTextColor: "#2B2B2B",
inputTextOpacity: 100,
buttonColor: "#00778C",
buttonOpacity: 100,
buttonTextColor: "#FFFFFF",
buttonTextOpacity: 100,
buttonText: "Log In",
// formAuthButtonText: '',
welcomeEnable: false,
// welcomeInformation: '',
// welcomeTextColor: '',
welcomeTextOpacity: 100,
welcomeTextFontSize: 12,
termsOfServiceEnable: false,
termsOfServiceText: "I agree to Terms of Service",
termsOfServiceFontSize: 12,
termsOfServiceUrlTexts: [
{
content: "By accepting this agreement and accessing the wireless network, you acknowledge that you are of legal age, you have read and understood, and agree to be bound by this agreement.",
text: "Terms of Service"
}
],
copyrightEnable: false,
copyright: '',
// copyrightTextColor: '',
// copyrightTextOpacity: 0,
copyrightTextFontSize: 12,
redirectionCountDownEnable: true,
advertisement: {
enable: false,
pictureIds: [],
// totalDuration: 0,
// pictureInterval: 0,
// skipEnable: true
}
}
});
@@ -628,6 +768,49 @@ const handleEditConfirm = async () => {
hostType: 2,
serverUrl: editForm.value.externalPortal.serverUrl,
serverUrlScheme: editForm.value.externalPortal.serverUrlScheme
},
portalCustomize: { // 新增的默认参数
defaultLanguage: 1,
backgroundPictureId: '',
logoPictureId: '',
logoDisplay: true,
inputBoxColor: "#ffffff",
inputBoxOpacity: 100,
inputTextColor: "#2B2B2B",
inputTextOpacity: 100,
buttonColor: "#00778C",
buttonOpacity: 100,
buttonTextColor: "#FFFFFF",
buttonTextOpacity: 100,
buttonText: "Log In",
// formAuthButtonText: '',
welcomeEnable: false,
// welcomeInformation: '',
// welcomeTextColor: '',
welcomeTextOpacity: 100,
welcomeTextFontSize: 12,
termsOfServiceEnable: false,
termsOfServiceText: "I agree to Terms of Service",
termsOfServiceFontSize: 12,
termsOfServiceUrlTexts: [
{
content: "By accepting this agreement and accessing the wireless network, you acknowledge that you are of legal age, you have read and understood, and agree to be bound by this agreement.",
text: "Terms of Service"
}
],
copyrightEnable: false,
copyright: '',
// copyrightTextColor: '',
// copyrightTextOpacity: 0,
copyrightTextFontSize: 12,
redirectionCountDownEnable: true,
advertisement: {
enable: false,
pictureIds: [],
// totalDuration: 0,
// pictureInterval: 0,
// skipEnable: true
}
}
};