diff --git a/core/core-backend/src/main/java/io/dataease/system/manage/SysParameterManage.java b/core/core-backend/src/main/java/io/dataease/system/manage/SysParameterManage.java index c2a197b20c..f370cfcb7d 100644 --- a/core/core-backend/src/main/java/io/dataease/system/manage/SysParameterManage.java +++ b/core/core-backend/src/main/java/io/dataease/system/manage/SysParameterManage.java @@ -105,6 +105,11 @@ public class SysParameterManage { return result; } + @XpackInteract(value = "perSetting", replace = true) + public Integer defaultLogin() { + return 0; + } + private Map buildSettingItem(String pkey, Object pval) { Map item = new HashMap<>(); item.put("pkey", pkey); diff --git a/core/core-backend/src/main/java/io/dataease/system/server/SysParameterServer.java b/core/core-backend/src/main/java/io/dataease/system/server/SysParameterServer.java index 599160ffbe..14d5b17476 100644 --- a/core/core-backend/src/main/java/io/dataease/system/server/SysParameterServer.java +++ b/core/core-backend/src/main/java/io/dataease/system/server/SysParameterServer.java @@ -65,4 +65,9 @@ public class SysParameterServer implements SysParameterApi { public List ui() { return sysParameterManage.getUiList(); } + + @Override + public Integer defaultLogin() { + return sysParameterManage.defaultLogin(); + } } diff --git a/core/core-frontend/src/api/login.ts b/core/core-frontend/src/api/login.ts index 9348d2fb2c..71dd2a9039 100644 --- a/core/core-frontend/src/api/login.ts +++ b/core/core-frontend/src/api/login.ts @@ -13,3 +13,5 @@ export const logoutApi = () => request.get({ url: '/logout' }) export const refreshApi = () => request.get({ url: '/login/refresh' }) export const uiLoadApi = () => request.get({ url: '/sysParameter/ui' }) + +export const loginCategoryApi = () => request.get({ url: '/sysParameter/defaultLogin' }) diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index 5b9330505d..c1e0b56671 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -2305,7 +2305,8 @@ export default { platformRid: '第三方平台用户角色', pwdStrategy: '开启密码策略', dip: '禁用初始密码', - pvp: '密码有效期' + pvp: '密码有效期', + defaultLogin: '默认登录方式' }, setting_email: { title: '邮件设置', diff --git a/core/core-frontend/src/views/login/index.vue b/core/core-frontend/src/views/login/index.vue index 59082c2bb7..1590f1f3ea 100644 --- a/core/core-frontend/src/views/login/index.vue +++ b/core/core-frontend/src/views/login/index.vue @@ -3,7 +3,7 @@ import { ref, reactive, onMounted, computed, nextTick } from 'vue' import { useI18n } from '@/hooks/web/useI18n' import { FormRules, FormInstance } from 'element-plus-secondary' import { Icon } from '@/components/icon-custom' -import { loginApi, queryDekey } from '@/api/login' +import { loginApi, queryDekey, loginCategoryApi } from '@/api/login' import { useCache } from '@/hooks/web/useCache' import { useAppStoreWithOut } from '@/store/modules/app' import { CustomPassword } from '@/components/custom-password' @@ -151,7 +151,7 @@ const xpackLoaded = info => { tablePaneList.value.push(info) } const xpackLoadFail = ref(false) - +const loadingText = ref('登录中...') const loginContainer = ref() const loginContainerWidth = ref(0) const showLoginImage = computed(() => { @@ -225,10 +225,27 @@ const loadArrearance = () => { } } } -onMounted(() => { +onMounted(async () => { loadArrearance() if (!checkPlatform()) { - preheat.value = false + const res = await loginCategoryApi() + if (res.data) { + debugger + loadingText.value = '加载中...' + document.getElementsByClassName('ed-loading-text')?.length && + (document.getElementsByClassName('ed-loading-text')[0]['innerText'] = loadingText.value) + nextTick(() => { + const param = { methodName: 'ssoLogin', args: res.data } + const timer = setInterval(() => { + if (xpackLoginHandler?.value.invokeMethod) { + xpackLoginHandler?.value.invokeMethod(param) + clearInterval(timer) + } + }, 1000) + }) + } else { + preheat.value = false + } } if (localStorage.getItem('DE-GATEWAY-FLAG')) { const msg = localStorage.getItem('DE-GATEWAY-FLAG') @@ -257,7 +274,7 @@ onMounted(() => { ref="loginContainer" class="preheat-container" v-loading="true" - element-loading-text="登录中..." + :element-loading-text="loadingText" element-loading-background="#F5F6F7" /> +
+ + + {{ item.label }} + + +
diff --git a/core/core-frontend/src/views/system/parameter/basic/BasicInfo.vue b/core/core-frontend/src/views/system/parameter/basic/BasicInfo.vue index 2af5de4c18..a291a33e37 100644 --- a/core/core-frontend/src/views/system/parameter/basic/BasicInfo.vue +++ b/core/core-frontend/src/views/system/parameter/basic/BasicInfo.vue @@ -29,6 +29,12 @@ const pvpOptions = [ { value: '3', label: '三个月' }, { value: '4', label: '一个月' } ] +const loginOptions = [ + { value: '0', label: '普通登录' }, + { value: '1', label: 'LDAP' }, + { value: '2', label: 'OIDC' }, + { value: '3', label: 'CAS' } +] const tooltips = [ { key: 'setting_basic.frontTimeOut', @@ -104,6 +110,8 @@ const search = cb => { } else if (item.pkey === 'basic.pvp') { selectedPvp.value = item.pval || '0' item.pval = pvpOptions.filter(cur => cur.value === selectedPvp.value)[0].label + } else if (item.pkey === 'basic.defaultLogin') { + item.pval = item.pval ? loginOptions[parseInt(item.pval)].label : loginOptions[0].label } else { item.pval = item.pval } diff --git a/de-xpack b/de-xpack index 84536fc57e..6e7664b9ff 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 84536fc57e2a3a3f19bf4645c10e72fbda491c1e +Subproject commit 6e7664b9ff1dde971b833369f6d8fa590e0fa432 diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/system/SysParameterApi.java b/sdk/api/api-base/src/main/java/io/dataease/api/system/SysParameterApi.java index a5099c5733..564b102ce9 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/system/SysParameterApi.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/system/SysParameterApi.java @@ -48,4 +48,8 @@ public interface SysParameterApi { @GetMapping("/ui") List ui(); + @Hidden + @GetMapping("/defaultLogin") + Integer defaultLogin(); + } diff --git a/sdk/common/src/main/java/io/dataease/constant/XpackSettingConstants.java b/sdk/common/src/main/java/io/dataease/constant/XpackSettingConstants.java index f47ac333e2..96ba429de2 100644 --- a/sdk/common/src/main/java/io/dataease/constant/XpackSettingConstants.java +++ b/sdk/common/src/main/java/io/dataease/constant/XpackSettingConstants.java @@ -9,4 +9,5 @@ public class XpackSettingConstants { public static final String PLATFORM_RID = "basic.platformRid"; public static final String DIP = "basic.dip"; public static final String PVP = "basic.pvp"; + public static final String DEFAULT_LOGIN = "basic.defaultLogin"; } diff --git a/sdk/common/src/main/java/io/dataease/utils/SystemSettingUtils.java b/sdk/common/src/main/java/io/dataease/utils/SystemSettingUtils.java index 0f9ee25c7d..230fc508f8 100644 --- a/sdk/common/src/main/java/io/dataease/utils/SystemSettingUtils.java +++ b/sdk/common/src/main/java/io/dataease/utils/SystemSettingUtils.java @@ -13,7 +13,8 @@ public class SystemSettingUtils { XpackSettingConstants.PLATFORM_OID, XpackSettingConstants.DIP, XpackSettingConstants.PVP, - XpackSettingConstants.PLATFORM_RID); + XpackSettingConstants.PLATFORM_RID, + XpackSettingConstants.DEFAULT_LOGIN); return xpackSettingList.contains(pkey); } } diff --git a/sdk/common/src/main/java/io/dataease/utils/WhitelistUtils.java b/sdk/common/src/main/java/io/dataease/utils/WhitelistUtils.java index 7dcdbb68b5..0a132228a1 100644 --- a/sdk/common/src/main/java/io/dataease/utils/WhitelistUtils.java +++ b/sdk/common/src/main/java/io/dataease/utils/WhitelistUtils.java @@ -42,6 +42,7 @@ public class WhitelistUtils { "/sysParameter/requestTimeOut", "/setting/authentication/status", "/sysParameter/ui", + "/sysParameter/defaultLogin", "/embedded/initIframe", "/");