diff --git a/src/pages/src/common/auth.ts b/src/pages/src/common/auth.ts index 4b2cecffb..74bba5426 100644 --- a/src/pages/src/common/auth.ts +++ b/src/pages/src/common/auth.ts @@ -15,5 +15,5 @@ export const getLoginUrl = (isOpener = true) => { // 退出登录 export const logout = () => { - location.href = getLoginUrl(); + location.href = getLoginUrl(false); }; diff --git a/src/pages/src/hooks/useCustomPlugin.ts b/src/pages/src/hooks/useCustomPlugin.ts index 6ff527449..f069059fc 100644 --- a/src/pages/src/hooks/useCustomPlugin.ts +++ b/src/pages/src/hooks/useCustomPlugin.ts @@ -1,11 +1,8 @@ -import { InfoBox, Message } from 'bkui-vue'; -import { h, ref } from 'vue'; +import { ref } from 'vue'; -import { postIdps, putIdps } from '@/http'; import { t } from '@/language/index'; -import { copy } from '@/utils'; -export const useCustomPlugin = (formData, dataSourceList, builtinFields, customFields, btnLoading, formRef, type) => { +export const useCustomPlugin = (formData, dataSourceList, builtinFields, customFields) => { const changeDataSourceId = (val, oldVal) => { dataSourceList.value.forEach((item) => { if (item.key === val) { @@ -98,60 +95,6 @@ export const useCustomPlugin = (formData, dataSourceList, builtinFields, customF window.changeInput = true; }; - const handleSubmit = async () => { - try { - await formRef.value.validate(); - btnLoading.value = true; - const data = formData.value; - data.data_source_match_rules.forEach((item) => { - delete item.targetFields; - }); - - if (type === 'add') { - const res = await postIdps(data); - - InfoBox({ - title: t('认证源创建成功'), - extCls: 'info-wrapper', - subTitle: h('div', { - class: 'details-url', - style: { - display: res.data?.callback_uri ? 'block' : 'none', - }, - }, [ - h('p', { - class: 'title', - }, t('请将一下回调地址填写到企业微信配置内:')), - h('div', { - class: 'content', - }, [ - h('p', {}, res.data?.callback_uri), - h('i', { - class: 'user-icon icon-copy', - onClick: () => copy(res.data?.callback_uri), - }), - ]), - ]), - dialogType: 'confirm', - confirmText: t('确定'), - infoType: 'success', - quickClose: false, - onConfirm() { - window.changeInput = false; - }, - }); - } else { - await putIdps(data); - Message({ theme: 'success', message: t('认证源更新成功') }); - window.changeInput = false; - } - } catch (e) { - console.warn(e); - } finally { - btnLoading.value = false; - } - }; - return { changeDataSourceId, changeSourceField, @@ -163,7 +106,6 @@ export const useCustomPlugin = (formData, dataSourceList, builtinFields, customF mouseenter, mouseleave, handleChange, - handleSubmit, hoverItem, }; }; diff --git a/src/pages/src/http/authSourceFiles.ts b/src/pages/src/http/authSourceFiles.ts index 9316371f1..d8e6f2893 100644 --- a/src/pages/src/http/authSourceFiles.ts +++ b/src/pages/src/http/authSourceFiles.ts @@ -1,6 +1,7 @@ import http from './fetch'; import type { NewIdpsParams, + NewLocalIdpsParams, PatchIdpsParams, PutIdpsParams, } from './types/authSourceFiles'; @@ -39,3 +40,18 @@ export const putIdps = (params: PutIdpsParams) => http.put(`/api/v1/web/idps/${p * 认证源插件默认配置 */ export const getIdpsPluginsConfig = (id: string) => http.get(`/api/v1/web/idps/plugins/${id}/config-meta/`); + +/** + * 新建本地账密认证源 + */ +export const postLocalIdps = (params: NewLocalIdpsParams) => http.post('/api/v1/web/idps/local/', params); + +/** + * 本地认证源详情 + */ +export const getLocalIdps = (id: string) => http.get(`/api/v1/web/idps/local/${id}/`); + +/** + * 更新本地认证源 + */ +export const putLocalIdps = (params: NewLocalIdpsParams) => http.put(`/api/v1/web/idps/local/${params.id}/`, params); diff --git a/src/pages/src/http/types/authSourceFiles.ts b/src/pages/src/http/types/authSourceFiles.ts index 401a7eb79..b4224f93e 100644 --- a/src/pages/src/http/types/authSourceFiles.ts +++ b/src/pages/src/http/types/authSourceFiles.ts @@ -3,6 +3,7 @@ */ export interface NewIdpsParams { name: string, + status: string, plugin_id: string, plugin_config: {}, data_source_match_rules?: { @@ -28,6 +29,7 @@ export interface PatchIdpsParams { export interface PutIdpsParams { id: string, name: string, + status: string, plugin_config: {}, data_source_match_rules?: { data_source_id: number, @@ -37,3 +39,19 @@ export interface PutIdpsParams { }[], }[], } + +/** + * 新建本地认证源参数 + */ +export interface NewLocalIdpsParams { + id?: string, + name: string, + status: string, + plugin_config: { + enable_password: boolean, + password_rule?: object, + password_initial?: object, + password_expire?: object, + login_limit?: object, + }, +}; diff --git a/src/pages/src/views/auth-source/List.vue b/src/pages/src/views/auth-source/List.vue deleted file mode 100644 index e92c08fb5..000000000 --- a/src/pages/src/views/auth-source/List.vue +++ /dev/null @@ -1,342 +0,0 @@ - - - - - diff --git a/src/pages/src/views/auth-source/ViewDetails.vue b/src/pages/src/views/auth-source/ViewDetails.vue deleted file mode 100644 index db3b2cfc2..000000000 --- a/src/pages/src/views/auth-source/ViewDetails.vue +++ /dev/null @@ -1,406 +0,0 @@ - - - - - diff --git a/src/pages/src/views/auth-source/edit-data/CustomPlugin.vue b/src/pages/src/views/auth-source/edit-data/CustomPlugin.vue deleted file mode 100644 index 3fe031ec3..000000000 --- a/src/pages/src/views/auth-source/edit-data/CustomPlugin.vue +++ /dev/null @@ -1,304 +0,0 @@ - - - - - diff --git a/src/pages/src/views/auth-source/edit-data/Local.vue b/src/pages/src/views/auth-source/edit-data/Local.vue deleted file mode 100644 index be22123cd..000000000 --- a/src/pages/src/views/auth-source/edit-data/Local.vue +++ /dev/null @@ -1,650 +0,0 @@ - - - - - diff --git a/src/pages/src/views/auth-source/edit-data/WeCom.vue b/src/pages/src/views/auth-source/edit-data/WeCom.vue deleted file mode 100644 index 4bb6599dd..000000000 --- a/src/pages/src/views/auth-source/edit-data/WeCom.vue +++ /dev/null @@ -1,312 +0,0 @@ - - - - - diff --git a/src/pages/src/views/auth-source/edit-data/index.vue b/src/pages/src/views/auth-source/edit-data/index.vue deleted file mode 100644 index a71d1d568..000000000 --- a/src/pages/src/views/auth-source/edit-data/index.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - - - diff --git a/src/pages/src/views/auth-source/index.vue b/src/pages/src/views/auth-source/index.vue deleted file mode 100644 index 98393de41..000000000 --- a/src/pages/src/views/auth-source/index.vue +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/src/pages/src/views/auth-source/new-data/CustomPlugin.vue b/src/pages/src/views/auth-source/new-data/CustomPlugin.vue deleted file mode 100644 index 1829a964d..000000000 --- a/src/pages/src/views/auth-source/new-data/CustomPlugin.vue +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - diff --git a/src/pages/src/views/auth-source/new-data/WeCom.less b/src/pages/src/views/auth-source/new-data/WeCom.less deleted file mode 100644 index 65200dbda..000000000 --- a/src/pages/src/views/auth-source/new-data/WeCom.less +++ /dev/null @@ -1,316 +0,0 @@ -.details-wrapper { - width: 1000px; - margin: 0 auto; - - .details-type { - display: flex; - padding: 10px 16px; - margin: 16px 0; - background: #FFF; - border-radius: 2px; - align-items: center; - - .title { - font-size: 14px; - color: #313238; - } - - .subtitle { - font-size: 12px; - color: #979BA5; - } - } - - .auth-source-form { - .content-item { - margin-bottom: 16px; - background: #fff; - border-radius: 2px; - box-shadow: 0 2px 4px 0 #1919290d; - - .item-title { - padding: 16px 0 16px 24px; - font-size: 14px; - font-weight: 700; - } - - ::v-deep .bk-form-item { - padding-bottom: 24px; - margin-bottom: 0; - margin-left: 64px; - font-size: 14px; - - &:last-child { - margin-bottom: 16px; - } - - .bk-radio-button { - .bk-radio-button-label { - font-size: 14px !important; - } - } - - .bk-radio-label { - font-size: 14px !important; - } - - .error-text { - font-size: 12px; - line-height: 1; - color: #ea3636; - animation: form-error-appear-animation .15s; - } - } - - .data-source-matching { - width: 622px; - margin-left: 59px; - border-radius: 2px; - - .hover-item { - cursor: pointer; - } - - .matching-item { - position: relative; - padding: 16px 16px 16px 24px; - margin-bottom: 16px; - background: #F5F7FA; - - .bk-sq-icon { - position: absolute; - top: -6px; - right: -6px; - font-size: 20px; - color: #EA3636; - } - - .or { - position: absolute; - top: -16px; - left: -22px; - display: inline-block; - width: 19px; - height: 16px; - line-height: 16px; - color: #FE9C00; - text-align: center; - background: #FFF3E1; - border-radius: 2px; - - &::before { - position: absolute; - top: -27px; - left: 10px; - width: 12px; - height: 27px; - border: 1px solid #DCDEE5; - border-right: transparent; - border-bottom: transparent; - border-top-left-radius: 2px; - content: ''; - } - - &::after { - position: absolute; - top: 16px; - left: 10px; - width: 12px; - height: 27px; - border: 1px solid #DCDEE5; - border-top: transparent; - border-right: transparent; - border-bottom-left-radius: 2px; - content: ''; - } - } - - ::v-deep .bk-form-item { - padding-bottom: 24px; - margin-bottom: 0; - margin-left: 0; - font-size: 14px; - - &:last-child { - margin-bottom: 0; - } - } - - .item-flex-header { - display: flex; - align-items: center; - - ::v-deep .bk-form-item { - padding-bottom: 0; - margin-bottom: 0; - margin-left: 0; - font-size: 14px; - - &:last-child { - margin-left: 16px; - } - } - } - - .item-flex { - position: relative; - display: flex; - padding-bottom: 8px; - align-items: center; - - ::v-deep .bk-form-item { - padding-bottom: 0; - margin-bottom: 0; - margin-left: 0; - font-size: 14px; - } - - .auth-source-fields { - margin-left: 16px; - } - - .user-icon { - font-size: 16px; - color: #dcdee5; - - &:hover { - color: #c4c6cc; - } - - &.forbid { - color: #EAEBF0; - } - } - - .icon-plus-fill { - position: absolute; - top: 9px; - right: 35px; - } - - .icon-minus-fill { - position: absolute; - top: 9px; - right: 5px; - } - - .and { - position: absolute; - top: -12px; - left: -24px; - display: inline-block; - width: 24px; - height: 16px; - line-height: 16px; - color: #14A568; - text-align: center; - background: #E4FAF0; - border-radius: 2px; - - &::before { - position: absolute; - top: -12px; - left: 12px; - width: 12px; - height: 12px; - border: 1px solid #DCDEE5; - border-right: transparent; - border-bottom: transparent; - border-top-left-radius: 2px; - content: ''; - } - - &::after { - position: absolute; - top: 16px; - left: 12px; - width: 12px; - height: 12px; - border: 1px solid #DCDEE5; - border-top: transparent; - border-right: transparent; - border-bottom-left-radius: 2px; - content: ''; - } - } - } - } - } - - .add-data-source { - display: flex; - width: 622px; - height: 32px; - margin-left: 59px; - font-size: 14px; - color: #3A84FF; - cursor: pointer; - background: #F0F5FF; - border: 1px dashed #A3C5FD; - border-radius: 2px; - align-items: center; - justify-content: center; - - span { - margin-left: 5px; - } - } - - .forbid-data-source { - color: #fff; - cursor: not-allowed; - background-color: #dcdee5; - border: 1px dashed #dcdee5; - } - - ::v-deep .bk-schema-form { - .bk-form-item { - width: 600px; - padding-bottom: 0; - font-size: 14px; - - &:last-child { - padding-bottom: 24px; - } - } - } - } - } - - .footer-wrapper { - position: absolute; - - .bk-button { - min-width: 88px; - margin-right: 8px; - } - } - - .fixed { - position: fixed; - bottom: 0; - left: 0; - z-index: 9; - width: 100%; - height: 48px; - margin-bottom: 0; - line-height: 48px; - background: #FAFBFD; - box-shadow: 0 -1px 0 0 #DCDEE5; - - .footer-div { - width: 1000px; - margin: 0 auto; - } - } -} - -.option-select { - display: flex !important; - justify-content: space-between; - - .name { - display: inline-block; - max-width: 160px; - } -} \ No newline at end of file diff --git a/src/pages/src/views/auth-source/new-data/WeCom.vue b/src/pages/src/views/auth-source/new-data/WeCom.vue deleted file mode 100644 index 6c3f2c2c1..000000000 --- a/src/pages/src/views/auth-source/new-data/WeCom.vue +++ /dev/null @@ -1,332 +0,0 @@ - - - - - - diff --git a/src/pages/src/views/auth-source/new-data/config.vue b/src/pages/src/views/auth-source/new-data/config.vue deleted file mode 100644 index 00fd5a6da..000000000 --- a/src/pages/src/views/auth-source/new-data/config.vue +++ /dev/null @@ -1,198 +0,0 @@ - - - - - diff --git a/src/pages/src/views/auth-source/new-data/index.vue b/src/pages/src/views/auth-source/new-data/index.vue deleted file mode 100644 index abb90a992..000000000 --- a/src/pages/src/views/auth-source/new-data/index.vue +++ /dev/null @@ -1,117 +0,0 @@ - - - - - diff --git a/src/pages/src/views/data-source/LocalCompany.vue b/src/pages/src/views/data-source/LocalCompany.vue deleted file mode 100644 index e4c519585..000000000 --- a/src/pages/src/views/data-source/LocalCompany.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - - - diff --git a/src/pages/src/views/data-source/LocalDataSource.vue b/src/pages/src/views/data-source/LocalDataSource.vue deleted file mode 100644 index 538d35617..000000000 --- a/src/pages/src/views/data-source/LocalDataSource.vue +++ /dev/null @@ -1,344 +0,0 @@ - - - - - - - diff --git a/src/pages/src/views/data-source/OtherDataSource.vue b/src/pages/src/views/data-source/OtherDataSource.vue deleted file mode 100644 index bded0e488..000000000 --- a/src/pages/src/views/data-source/OtherDataSource.vue +++ /dev/null @@ -1,568 +0,0 @@ - - - - - - - diff --git a/src/pages/src/views/data-source/collaborative-data/OperationDetails.vue b/src/pages/src/views/data-source/collaborative-data/OperationDetails.vue deleted file mode 100644 index 7586a607d..000000000 --- a/src/pages/src/views/data-source/collaborative-data/OperationDetails.vue +++ /dev/null @@ -1,344 +0,0 @@ - - - - - diff --git a/src/pages/src/views/data-source/index.vue b/src/pages/src/views/data-source/index.vue deleted file mode 100644 index a3c39ad38..000000000 --- a/src/pages/src/views/data-source/index.vue +++ /dev/null @@ -1,60 +0,0 @@ - - - - - diff --git a/src/pages/src/views/data-source/local-details/ConfigInfo.vue b/src/pages/src/views/data-source/local-details/ConfigInfo.vue deleted file mode 100644 index 1a20f09b0..000000000 --- a/src/pages/src/views/data-source/local-details/ConfigInfo.vue +++ /dev/null @@ -1,250 +0,0 @@ - - - - - diff --git a/src/pages/src/views/data-source/local-details/EditUser.vue b/src/pages/src/views/data-source/local-details/EditUser.vue deleted file mode 100644 index ce2e2aa5e..000000000 --- a/src/pages/src/views/data-source/local-details/EditUser.vue +++ /dev/null @@ -1,425 +0,0 @@ - - - - - diff --git a/src/pages/src/views/data-source/local-details/PswInfo.vue b/src/pages/src/views/data-source/local-details/PswInfo.vue deleted file mode 100644 index c053f1066..000000000 --- a/src/pages/src/views/data-source/local-details/PswInfo.vue +++ /dev/null @@ -1,151 +0,0 @@ - - - - - diff --git a/src/pages/src/views/data-source/local-details/UserInfo.vue b/src/pages/src/views/data-source/local-details/UserInfo.vue deleted file mode 100644 index 43beacc4e..000000000 --- a/src/pages/src/views/data-source/local-details/UserInfo.vue +++ /dev/null @@ -1,790 +0,0 @@ - - - - - diff --git a/src/pages/src/views/data-source/local-details/ViewUser.vue b/src/pages/src/views/data-source/local-details/ViewUser.vue deleted file mode 100644 index 0b21a6a4b..000000000 --- a/src/pages/src/views/data-source/local-details/ViewUser.vue +++ /dev/null @@ -1,62 +0,0 @@ - - - - - diff --git a/src/pages/src/views/data-source/local-details/index.vue b/src/pages/src/views/data-source/local-details/index.vue deleted file mode 100644 index da52be903..000000000 --- a/src/pages/src/views/data-source/local-details/index.vue +++ /dev/null @@ -1,165 +0,0 @@ - - - - - diff --git a/src/pages/src/views/data-source/new-data/Http.vue b/src/pages/src/views/data-source/new-data/Http.vue deleted file mode 100644 index 66cb33500..000000000 --- a/src/pages/src/views/data-source/new-data/Http.vue +++ /dev/null @@ -1,655 +0,0 @@ - - - - - diff --git a/src/pages/src/views/data-source/new-data/Local.vue b/src/pages/src/views/data-source/new-data/Local.vue deleted file mode 100644 index 67183d161..000000000 --- a/src/pages/src/views/data-source/new-data/Local.vue +++ /dev/null @@ -1,531 +0,0 @@ - - - - - diff --git a/src/pages/src/views/data-source/new-data/index.less b/src/pages/src/views/data-source/new-data/index.less deleted file mode 100644 index 6d87ef857..000000000 --- a/src/pages/src/views/data-source/new-data/index.less +++ /dev/null @@ -1,108 +0,0 @@ -.data-source-content { - height: calc(100vh - 104px); - padding: 24px; - - .content-item { - background: #fff; - border-radius: 2px; - box-shadow: 0 2px 4px 0 #1919290d; - - .item-title { - padding: 16px 0 16px 24px; - font-size: 14px; - font-weight: 700; - } - - .div-flex { - display: flex; - align-items: center; - } - - ::v-deep .bk-form-item { - padding-bottom: 24px; - margin-bottom: 0; - margin-left: 64px; - font-size: 14px; - - &:last-child { - margin-bottom: 24px; - } - - .bk-form-content { - line-height: 22px; - } - - .bk-radio-button { - min-width: 80px; - - .bk-radio-button-label { - font-size: 14px !important; - } - } - - .bk-radio-label { - font-size: 14px !important; - } - - .error-text { - font-size: 12px; - line-height: 1; - color: #ea3636; - animation: form-error-appear-animation .15s; - } - } - - .form-item-flex { - ::v-deep .bk-form-content { - display: flex; - - .input-password { - width: 240px; - margin-left: 28px; - } - } - } - - ::v-deep .api-url-style { - display: flex; - align-items: center; - - .bk-button { - margin-left: 24px; - - .bk-button-text { - font-size: 12px; - } - - .icon-canshu { - margin-right: 5px; - font-size: 14px; - } - } - } - } - - .btn { - position: relative; - - button { - min-width: 88px; - } - - .connection-alert { - position: absolute; - top: -41px; - width: 100%; - } - - .icon-close-fill { - font-size: 14px; - color: #EA3636; - } - - .icon-duihao-2 { - font-size: 14px; - color: #2DCB56; - } - } -} diff --git a/src/pages/src/views/data-source/new-data/index.vue b/src/pages/src/views/data-source/new-data/index.vue deleted file mode 100644 index 0e7288fd8..000000000 --- a/src/pages/src/views/data-source/new-data/index.vue +++ /dev/null @@ -1,185 +0,0 @@ - - - - - diff --git a/src/pages/src/views/data-source/new-data/query-params/QueryParams.vue b/src/pages/src/views/data-source/new-data/query-params/QueryParams.vue deleted file mode 100644 index fc6baab68..000000000 --- a/src/pages/src/views/data-source/new-data/query-params/QueryParams.vue +++ /dev/null @@ -1,206 +0,0 @@ - - - - - diff --git a/src/pages/src/views/setting/BasicsSetting.vue b/src/pages/src/views/setting/BasicsSetting.vue index 90bc71f2b..ced9afe21 100644 --- a/src/pages/src/views/setting/BasicsSetting.vue +++ b/src/pages/src/views/setting/BasicsSetting.vue @@ -13,7 +13,7 @@ - + diff --git a/src/pages/src/views/setting/LoginSetting.vue b/src/pages/src/views/setting/LoginSetting.vue index cc5f92e73..4f1998ccd 100644 --- a/src/pages/src/views/setting/LoginSetting.vue +++ b/src/pages/src/views/setting/LoginSetting.vue @@ -1,6 +1,6 @@