Skip to content

Commit

Permalink
Merge pull request #592 from actiontech/feature/sqle-issue-2917
Browse files Browse the repository at this point in the history
[feature](base/system、login) support disabling local login
  • Loading branch information
Rain-1214 authored Feb 21, 2025
2 parents 4b89a1f + cd193be commit 1afe040
Show file tree
Hide file tree
Showing 34 changed files with 1,155 additions and 152 deletions.
3 changes: 2 additions & 1 deletion packages/base/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { DMS_REDIRECT_KEY_PARAMS_NAME } from '@actiontech/shared/lib/data/routeP
import { SystemRole } from '@actiontech/shared/lib/enum';
import { AuthRouterConfig } from './router/router';
import { cloneDeep } from 'lodash';

import dmsSystem from './testUtils/mockApi/system';
jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useNavigate: jest.fn()
Expand Down Expand Up @@ -68,6 +68,7 @@ describe('App', () => {
requestGetBasicInfo = mockDMSGlobalApi.getBasicInfo();
getUserBySessionSpy = mockDMSGlobalApi.getUserBySession();
getSystemModuleRedDotsSpy = baseSystem.getSystemModuleRedDots();
dmsSystem.getLoginTips();
jest.useFakeTimers();
(useNavigate as jest.Mock).mockImplementation(() => navigateSpy);

Expand Down
2 changes: 1 addition & 1 deletion packages/base/src/__snapshots__/App.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2508,7 +2508,7 @@ exports[`App render App when token is not existed 1`] = `
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down
2 changes: 1 addition & 1 deletion packages/base/src/locale/zh-CN/dmsLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
export default {
login: '登录',
otherMethod: '其他登录方式',

loginButtonDisabledTips: '当前已禁用账密登录',
userAgreementTips: '已阅读并同意',
userAgreement: '用户协议',

Expand Down
18 changes: 15 additions & 3 deletions packages/base/src/locale/zh-CN/dmsSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default {
tabPaneTitle: {
pushNotification: '消息推送',
processConnection: '流程对接',
loginConnection: '登录对接',
loginConnection: '登录配置',
globalConfiguration: '全局配置',
license: '许可证',
personalize: '个性化设置'
Expand Down Expand Up @@ -133,9 +133,9 @@ export default {
userWechatTagNameTips:
'sqle会尝试使用此路径,从第三方平台获取用户信息的响应中解析出用户微信ID',

loginButtonText: '登录按钮文字',
loginButtonTextTips: 'login页面OAuth2.0登录按钮文字',
loginButtonTextValidateMessage: '最多输入28个字符',
oauth2ButtonText: 'OAuth2.0 跳转按钮文字',
oauth2ButtonTextTips: 'login页面OAuth2.0登录按钮文字',

autoCreateUser: '自动创建并绑定用户',
autoCreateUserTips:
Expand All @@ -151,6 +151,18 @@ export default {
'系统自动创建的新用户将使用此密码作为初始登录密码,请妥善保存。此外,为保证账户安全,建议用户首次登录后及时修改密码。如果之前配置过该项,更新时不填写该项代表不更新密钥。'
},

loginBasic: {
passwordLoginDisabled: '是否禁用账密登录',
passwordLoginDisabledTips: '禁止除管理员外的普通用户通过账号和密码登录',
loginButtonText: '登录按钮文字',
loginButtonTextTips: 'login页面登录按钮文字',
enableOAuthFirst: '需先启用OAuth2.0登录',
confirmDisable: '是否确认关闭当前配置?',
confirmEnableWithLDAP:
'LDAP服务基于账密登录,会同时被禁用,是否确认开启禁用?',
confirmEnable: '是否确认开启当前配置?'
},

dingTalk: {
titleTips: '审批信息将根据审核人的手机号发送到相应的钉钉账号',
enable: '启用钉钉审批',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`page/BindUser-ce render bind user form item render form item error when
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down Expand Up @@ -250,7 +250,7 @@ exports[`page/BindUser-ce render bind user form item render oauth2_token params
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down Expand Up @@ -454,7 +454,7 @@ exports[`page/BindUser-ce render bind user ui snap 1`] = `
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`page/BindUser-ee render bind user form item render form item error when
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down Expand Up @@ -250,7 +250,7 @@ exports[`page/BindUser-ee render bind user form item render oauth2_token params
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down Expand Up @@ -454,7 +454,7 @@ exports[`page/BindUser-ee render bind user ui snap 1`] = `
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`page/Login-ce render login page snap 1`] = `
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down Expand Up @@ -220,7 +220,7 @@ exports[`page/Login-ce render login when api return fail 1`] = `
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down Expand Up @@ -443,7 +443,7 @@ exports[`page/Login-ce render login when api return success 1`] = `
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down Expand Up @@ -666,7 +666,7 @@ exports[`page/Login-ce render login when api return success 2`] = `
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down
12 changes: 6 additions & 6 deletions packages/base/src/page/Login/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`page/Login-ee render login snap 1`] = `
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down Expand Up @@ -249,7 +249,7 @@ exports[`page/Login-ee render login snap 1`] = `
type="submit"
>
<span>
登 录
Login
</span>
</button>
<a
Expand Down Expand Up @@ -288,7 +288,7 @@ exports[`page/Login-ee render login success when has location search val render
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down Expand Up @@ -580,7 +580,7 @@ exports[`page/Login-ee render login success when has location search val render
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down Expand Up @@ -872,7 +872,7 @@ exports[`page/Login-ee render login success when has location search val render
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down Expand Up @@ -1164,7 +1164,7 @@ exports[`page/Login-ee render login when return no auth 1`] = `
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`page/Login/LoginLayout render ui snap 1`] = `
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down Expand Up @@ -71,7 +71,7 @@ exports[`page/Login/LoginLayout render ui snap redux has data 1`] = `
</div>
</div>
<div
class="css-1pqzecc"
class="css-zhd3kf"
>
<div
class="login-page-right-content"
Expand Down
Loading

0 comments on commit 1afe040

Please sign in to comment.