Skip to content

Commit

Permalink
feat: 认证源列表 & 本地账密详情接口联调
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri0528 committed Nov 20, 2023
1 parent 1407a29 commit a227777
Show file tree
Hide file tree
Showing 17 changed files with 1,993 additions and 537 deletions.
9 changes: 5 additions & 4 deletions src/pages/src/components/layouts/MainBreadcrumbsDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
</template>

<script setup lang="ts">
import { computed, defineProps } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { computed, defineEmits, defineProps } from 'vue';
import { useRoute } from 'vue-router';
import { useMainViewStore } from '@/store/mainView';
Expand All @@ -33,9 +33,10 @@ defineProps({
},
});
const emit = defineEmits(['toBack']);
const store = useMainViewStore();
const route = useRoute();
const router = useRouter();
store.customBreadcrumbs = true;
/**
* 当前面包屑展示文案
Expand All @@ -45,7 +46,7 @@ const current = computed(() => store.breadCrumbsTitle || route.meta.navName);
* back control
*/
const handleBack = () => {
router.push({ name: 'dataSource' });
emit('toBack');
};
</script>

Expand Down
24 changes: 24 additions & 0 deletions src/pages/src/http/authSourceFiles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import http from './fetch';
import type {
NewIdpsParams,
} from './types/authSourceFiles';

/**
* 认证源列表
*/
export const getIdps = (keyword: string) => http.get(`/api/v1/web/idps/?keyword=${keyword}`);

/**
* 认证源插件列表
*/
export const getIdpsPlugins = () => http.get('/api/v1/web/idps/plugins/');

/**
* 新建认证源
*/
export const postIdps = (params: NewIdpsParams) => http.post('/api/v1/web/idps/plugins/', params);

/**
* 认证源详情
*/
export const getIdpsDetails = (id: string) => http.get(`/api/v1/web/idps/${id}/`);
15 changes: 15 additions & 0 deletions src/pages/src/http/types/authSourceFiles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* 新建认证源参数
*/
export interface NewIdpsParams {
name: string,
plugin_id: string,
plugin_config: {},
data_source_match_rules?: {
data_source_id: number,
field_compare_rules: {
source_field: string,
target_field: string,
}[],
}[],
}
1 change: 1 addition & 0 deletions src/pages/src/images/wecom.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 32 additions & 7 deletions src/pages/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,40 @@ export default createRouter({
{
path: '/auth-source',
name: 'authSource',
component: () => import('@/views/auth-source/index.vue'),
},
{
path: '/auth-source/new',
name: 'newAuthSource',
meta: {
navName: '新建认证源',
navName: '认证源管理',
},
component: () => import('@/views/auth-source/new-data/NewConfig.vue'),
component: () => import('@/views/auth-source/index.vue'),
children: [
{
path: '',
name: 'authSourceList',
meta: {
routeParentName: 'authSource',
navName: '认证源管理',
},
component: () => import('@/views/auth-source/List.vue'),
},
{
path: 'new',
name: 'newAuthSource',
meta: {
routeParentName: 'authSource',
navName: '新建认证源',
},
component: () => import('@/views/auth-source/new-data/index.vue'),
},
{
path: 'edit/:id',
name: 'editAuthSource',
meta: {
routeParentName: 'authSource',
navName: '编辑本地认证源',
showBack: true,
},
component: () => import('@/views/auth-source/edit-data/index.vue'),
},
],
},
{
path: '/audit',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/src/views/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const headerNav = reactive([
},
{
name: '认证源管理',
path: 'authSource',
path: 'authSourceList',
},
{
name: '租户管理',
Expand Down
Loading

0 comments on commit a227777

Please sign in to comment.