Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/api/jyh/index.ts
This commit is contained in:
付民康
2025-03-19 12:35:05 +08:00
13 changed files with 190 additions and 102 deletions

View File

@@ -142,10 +142,36 @@ export const getVulnList = (data): Promise<any> => {
request({
url: `/api/v1/repo/vulnerability/page`,
method: 'post',
data,
data
})
);
};
// 获取SBOM依赖树
export const dependencyTree = (softwareId: any): Promise<any> => {
return reqCatchV2(() =>
request({
url: `/api/v1/repo/dependency/tree`,
method: 'POST',
data: {
softwareId,
current: 1,
size: 99999
}
})
);
};
// 编辑用户信息(包含订阅默认预警方式)
export const userEdit = (data: any): Promise<any> => {
return reqCatchV2(() =>
request({
url: `/api/v1/user/edit`,
method: 'POST',
data
})
);
};
// 获取漏洞数据
export const getVulnDetail = (data): Promise<any> => {
@@ -153,10 +179,10 @@ export const getVulnDetail = (data): Promise<any> => {
request({
url: `/api/v1/repo/vulnerability/info`,
method: 'POST',
data,
data
})
);
}
};
// 迁移批量导入
export function repoImport(data: types.commonRepoReqType) {
@@ -166,8 +192,8 @@ export function repoImport(data: types.commonRepoReqType){
method: 'post',
data,
headers: {
'Content-Type': 'multipart/form-data', // 设置请求头
},
'Content-Type': 'multipart/form-data' // 设置请求头
}
})
);
}
@@ -178,10 +204,10 @@ export const getNoticeList = (data): Promise<any> => {
request({
url: `/api/v1/alert/notice/list`,
method: 'POST',
data,
data
})
);
}
};
// 个人中心-获取组织级预警列表
export const getgroupNoticeList = (data): Promise<any> => {
@@ -189,10 +215,10 @@ export const getgroupNoticeList = (data): Promise<any> => {
request({
url: `/api/v1/alert/group/notice/list`,
method: 'POST',
data,
data
})
);
}
};
// 个人中心-获取订阅列表
export const getSubscribeList = (data): Promise<any> => {

View File

@@ -40,7 +40,7 @@ export function inviteOrganizationMemberApi(params: { groupId: number, username:
export function deleteOrganizationMemberApi(params: { groupId: number, username: string }): Promise<UnitRes<boolean>> {
return request({
url: `/api/v1/group/member/remove`,
method: 'delete',
method: 'post',
data: params,
});
}

View File

@@ -30,9 +30,11 @@
<GIcon name="gt-plane-add" size="16px" color="#9C9DB4" />
<span>新建</span>
</d-button>
<div class="cursor-pointer hidden-m" @click="handleLogin('login')" v-if="inSearch"><span>搜索记录</span></div>
<d-button variant="solid" color="primary" @click="handleLogin('login')"></d-button>
<div class="cursor-pointer hidden-m" @click="handleLogin('login')" v-if="inSearch">
<span>搜索记</span>
</div>
<d-button @click="handleLogin('register')" class="min-w-[64px]">注册</d-button>
<d-button variant="solid" color="primary" @click="handleLogin('login')">Gitcode账号登录</d-button>
</template>
<template v-else>
<!--ai copilot-->
@@ -109,9 +111,7 @@ const { isMobile } = usePageResize();
/* store 用户信息 */
/* @test 后面将清除 */
watchEffect(() => {
});
watchEffect(() => {});
microApp.router.beforeEach({
'micoro-app-homeweb-app': (to, from) => {
if (to.pathname === '/search') {
@@ -150,7 +150,7 @@ $header-bg: #fff;
}
.g-header-copilot {
background: rgba(41, 81, 224, 1);
color: #FFF;
color: #fff;
width: 120px;
border-radius: 48px;
height: 32px;
@@ -159,7 +159,7 @@ $header-bg: #fff;
cursor: pointer;
justify-content: center;
&:hover {
background: rgba(41, 81, 224, .8);
background: rgba(41, 81, 224, 0.8);
}
}
.g-toolbar {
@@ -171,7 +171,7 @@ $header-bg: #fff;
flex-basis: 56px;
overflow: hidden;
padding: 0 24px;
border-bottom: 1px solid #F1F1F8;
border-bottom: 1px solid #f1f1f8;
:deep(.devui-button) {
padding: 6px 16px;
border-radius: $add-radius;
@@ -209,7 +209,7 @@ $header-bg: #fff;
border-bottom-color: transparent !important;
}
&.border-b-show {
border-bottom-color: #F1F1F8 !important;
border-bottom-color: #f1f1f8 !important;
}
}
.g-header-gray {
@@ -261,7 +261,7 @@ $header-bg: #fff;
display: none;
}
.g-header-copilot {
display: none!important;;
display: none !important;
}
}
</style>

View File

@@ -59,7 +59,7 @@
<div class="info-title">
<div class="sub-title">
<img src="@/assets/imgs/home/informIcon@2x.png">
<span>信息公示</span>
<span>预警公告</span>
</div>
<a class="devui-link" @click="checkMore">更多 ></a>
</div>
@@ -89,7 +89,7 @@
</div>
</div>
<d-modal class="warning-modal" v-model="warningModalVisable" title="主题:" style="width: 600px;">
<d-modal class="warning-modal" v-model="warningModalVisable" title="" style="width: 600px;">
<EarlyWarningDetail :warningData="currentWarning" :type="'user'"></EarlyWarningDetail>
</d-modal>
</template>

View File

@@ -1,7 +1,7 @@
<template>
<div class="warning-detail-container">
<div class="warning-title">
<div>{{ warningData.subject }}</div>
<div style="padding-right: 20px;">{{ warningData.subject }}</div>
<div class="sub-title mt-3">
<div>
<span>重要性</span>
@@ -20,7 +20,7 @@
:toolbar-config="toolbarConfig"
></d-editor-md>
</div>
<div :style="{'border-radius': propsData.type === 'user' ? '6px' : 0}" class="warning-from">{{warningData.group}} {{ warningData.pulishTime }}</div>
<div :style="{'border-radius': propsData.type === 'user' ? '6px' : 0}" class="warning-from">{{warningData.group}} {{ warningData.publishTime }}</div>
<div v-if="propsData.type === 'system'" class="warning-operation">
<d-button @click="confirm" variant="solid" class="mr-2">确定</d-button>
<d-button @click="$emit('close')">取消</d-button>
@@ -40,7 +40,8 @@ const toolbarConfig = [
['ul', 'ol', 'checklist', 'code', 'link', 'image', 'table'],
];
const mode = ref('readonly');
warningData.value = JSON.parse(propsData.warningData.alertMsg ?? JSON.stringify({
console.log(propsData.warningData)
warningData.value = propsData.warningData ?? {
subject: '【漏洞排查预警】ApacheIgnite远程代码执行漏洞排查CVE-2024-52577)',
importance: '高',
group: '可信开源代码库运营团队',
@@ -49,7 +50,7 @@ warningData.value = JSON.parse(propsData.warningData.alertMsg ?? JSON.stringify(
近日安全中心发现Apache lgnite远程代码执行漏洞CVE-2024-52577。在 2.6.0<Apache Ignite< 2.17.0版本中由于lgnite未能正确实施类序列化过滤器攻击者能够利用恶意序列化对象绕过安全检查从而在服务器端反序列化时触发任意代码的执行。经可信开源代码库运营团队评审漏洞技术定级2级/3级若不满足利用条件可举证降为6级。请你按要求在XX时间内完成修复。
## 二、修复方案
升级Apache Ignite至安全版本2.17.0`
}));
};
const confirm = () => {
emit('close');
};

View File

@@ -1,6 +1,5 @@
<template>
<Card simple class="jyh-card mt-3">
<div class="card-title">组织预警通知列表</div>
<div class="mb-3">
<d-table v-if="tableData.length>0" class="jyh-table jyh-table-2" :header-bg="true" :data="tableData">
<d-column field="updateTime" header="时间">
@@ -78,7 +77,7 @@ const warningModalVisable = ref(false);
const currentWarning = ref();
const openWarningDetail = (row) => {
warningModalVisable.value = true;
currentWarning.value = row;
currentWarning.value = JSON.parse(row.alertMsg ?? '{}');
};
const colseWarningDetail = () => {
warningModalVisable.value = false;

View File

@@ -1,6 +1,5 @@
<template>
<Card simple class="jyh-card mt-3">
<div class="card-title">个人预警通知列表</div>
<div class="mb-3">
<d-table v-if="tableData.length>0" class="jyh-table jyh-table-2" :header-bg="true" :data="tableData">
<d-column field="updateTime" header="时间"></d-column>
@@ -74,7 +73,7 @@ const warningModalVisable = ref(false);
const currentWarning = ref();
const openWarningDetail = (row) => {
warningModalVisable.value = true;
currentWarning.value = row;
currentWarning.value = JSON.parse(row.alertMsg ?? '{}');
};
const colseWarningDetail = () => {
warningModalVisable.value = false;

View File

@@ -1,8 +1,7 @@
<template>
<div class="invitation-notice-container">
<Card simple class="jyh-card mt-3">
<div class="card-title">邀请通知列表</div>
<div class="mb-3">
<div class="mt-3">
<d-table
class="jyh-table jyh-table-2"
:header-bg="true"
@@ -87,12 +86,13 @@ const handleAccept = async (row, type) => {
});
if (data?.data?.data?.data) {
Message({
type,
type: 'success',
message: '成功接受',
});
queryInviteListData();
} else {
Message({
type,
type: 'error',
message: '接受失败',
});
}

View File

@@ -1,6 +1,5 @@
<template>
<Card simple class="jyh-card mt-3">
<div class="card-title">组织订阅列表</div>
<div class="mb-3">
<d-table v-if="tableData.length>0" class="jyh-table jyh-table-2" :header-bg="true" :data="tableData">
<d-column field="updateTime" header="订阅时间"></d-column>

View File

@@ -1,6 +1,5 @@
<template>
<Card simple class="jyh-card mt-3">
<div class="card-title">个人订阅列表</div>
<div class="mb-3">
<d-table v-if="tableData.length>0" class="jyh-table jyh-table-2" :header-bg="true" :data="tableData">
<d-column field="updateTime" header="订阅时间"></d-column>

View File

@@ -155,7 +155,7 @@ const userInfo = shallowRef<UserInfoType>({
groupDesc: null,
});
const searchOrganizationLoading = ref(false);
const hasOrganization = ref(false);
const hasOrganization = ref(true);
const organizationInfo = shallowRef<OrganizationInfoType>({
groupId: 0,
organizationName: '',
@@ -218,13 +218,14 @@ async function queryUserInfo() {
userInfo.value = res.data?.data.data;
}
if (userInfo.value.groupId) {
hasOrganization.value = true;
organizationInfo.value = {
groupId: userInfo.value.groupId,
organizationName: userInfo.value.groupName as string,
organizationProfile: userInfo.value.groupDesc as string,
};
getMemberList();
} else {
hasOrganization.value = false;
}
} catch (e) {
Message.error('查询用户信息失败');

View File

@@ -4,21 +4,33 @@
<div class="text-[14px] w-full flex items-center justify-between">
<div class="font-bold mb-[16px]">基础信息</div>
</div>
<d-form layout="vertical" class="ml-3 mr-3" :data="forms">
<d-form ref="formRef" layout="vertical" class="ml-3 mr-3" :data="forms">
<d-row :gutter="16">
<d-col span="8">
<d-form-item field="name" label="名称" required>
<d-input v-model="forms.name" />
<d-form-item
field="nickname"
label="名称"
:rules="[{ required: true, message: '请填写名称', trigger: 'blur' }]"
>
<d-input v-model="forms.nickname" />
</d-form-item>
</d-col>
<d-col span="8">
<d-form-item field="email" label="邮件" required>
<d-form-item
field="email"
label="邮件"
:rules="[{ required: true, message: '请填写邮件', trigger: 'blur' }]"
>
<d-input v-model="forms.email" />
</d-form-item>
</d-col>
<d-col span="8">
<d-form-item field="phone" label="电话" required>
<d-input v-model="forms.phone" />
<d-form-item
field="mobile"
label="电话"
:rules="[{ required: true, message: '请填写电话', trigger: 'blur' }]"
>
<d-input v-model="forms.mobile" />
</d-form-item>
</d-col>
</d-row>
@@ -29,29 +41,71 @@
<div class="font-bold mb-[16px]">预警通知设置</div>
</div>
<d-form layout="vertical">
<d-form-item field="radio" label="是否开启邮件通知">
<d-radio-group direction="row" v-model="radio">
<d-radio value="0">开启</d-radio>
<d-radio value="1">关闭</d-radio>
<d-form-item field="radio" label="是否开启预警通知">
<d-radio-group direction="row" v-model="forms.userExt.emailAlertSwitch">
<d-radio :value="true">开启</d-radio>
<d-radio :value="false">关闭</d-radio>
</d-radio-group>
</d-form-item>
</d-form>
</d-card>
<div class="flex">
<d-button variant="solid" class="mr-[8px]">提交</d-button>
<d-button color="secondary" class="mr-[8px]">保存草稿</d-button>
<d-button variant="solid" class="mr-[8px]" @click="save" :loading="loading">保存</d-button>
<!-- <d-button color="secondary" class="mr-[8px]">保存草稿</d-button> -->
</div>
</div>
</template>
<script setup lang="ts">
import { reactive, ref, shallowRef } from 'vue';
const radio = ref('1');
import { userEdit } from '@/api/jyh';
import { getUserInfo } from '@/api/user';
import { onMounted, reactive, ref, shallowRef } from 'vue';
import { Message } from 'vue-devui';
import { useAccountStore } from '@/stores/user';
const loading = ref(false);
const forms = reactive({
name: '',
nickname: '',
mobile: '',
email: '',
phone: ''
userExt: {
emailAlertSwitch: true
}
});
const getInfo = async () => {
const userRes = await getUserInfo();
const user = userRes.data.data.data || {};
forms.nickname = user.nickname;
forms.mobile = user.mobile;
forms.email = user.email;
forms.userExt.emailAlertSwitch = user.userExt?.emailAlertSwitch || false;
if (userRes.data?.data) {
localStorage.setItem('userInfo', JSON.stringify(userRes.data?.data));
useAccountStore().saveAccountInfo({
...userRes.data?.data
});
// }
}
};
const formRef = ref();
const save = () => {
formRef.value.validate(async (isValid, invalidFields) => {
if (isValid) {
loading.value = true;
await userEdit(forms);
loading.value = false;
Message.success('保存成功');
getInfo();
}
});
};
onMounted(() => {
getInfo();
});
</script>

View File

@@ -1,28 +1,22 @@
<template>
<div class="soft-detail-container">
<div class="mt-3">
<d-table class="jyh-table" v-if="tableData.length" :striped="false" :data="tableData" table-layout="auto">
<d-table class="jyh-table" v-if="tableData.length" :striped="false" :data="valLists" table-layout="auto">
<d-column type="index" width="40"></d-column>
<d-column
field="versionName"
header="编码"
filterable
:filter-list="filterList"
@filter-change="handleFilterChange"
>
<d-column field="vulnId" header="编码" filterable :filter-list="filterList" @filter-change="handleFilterChange">
<template #default="scope">
<a @click="openVulnDetail(scope.row)">{{ scope.row.versionName }}</a>
<a @click="openVulnDetail(scope.row)">{{ scope.row.vulnId }}</a>
</template>
</d-column>
<d-column
field="name"
field="cweId"
header="CVE ID"
filterable
:filter-list="filterList"
@filter-change="handleFilterChange"
></d-column>
<d-column
field="code"
field="cvssScore"
header="CVSS 打分"
filterable
:filter-list="filterList"
@@ -40,7 +34,7 @@
</template>
</d-column>
<d-column
field="versionCode"
field="severity"
header="漏洞级别"
sortable
:sort-method="sortNameMethod"
@@ -49,11 +43,11 @@
@filter-change="handleFilterChange"
>
<template #default="scope">
<a>{{ scope.row.versionCode }}</a>
<a>{{ scope.row.severity }}</a>
</template>
</d-column>
<d-column
field="versionCode"
field="fixVersion"
header="补丁版本"
sortable
:sort-method="sortNameMethod"
@@ -62,10 +56,14 @@
@filter-change="handleFilterChange"
>
<template #default="scope">
<a>{{ scope.row.versionCode }}</a>
<a>{{ scope.row.fixVersion }}</a>
</template>
</d-column>
<d-column field="publishDate" header="补丁修复时间" fixed-right="0px">
<template #default="scope">
{{ dayjs(scope.row.publishDate).format('YYYY-MM-DD') }}
</template>
</d-column>
<d-column field="created" header="补丁修复时间" fixed-right="0px"></d-column>
</d-table>
<DataPanel v-else skeleton :card="false" :empty="true"> </DataPanel>
@@ -102,23 +100,25 @@
</GModal>
<!-- 漏洞详情 -->
<d-drawer v-model="vulnDetailVisable" style="width: auto;">
<d-drawer v-model="vulnDetailVisable" style="width: auto">
<VulnerabilityDetail :softwareId="currentVuln.softwareId" :vulnId="currentVuln.id"></VulnerabilityDetail>
</d-drawer>
</div>
</template>
<script setup lang="ts">
import * as dayjs from 'dayjs';
import SettingTitle from '@/components/Setting/SettingTitle/index.vue';
import SettingText from '@/components/Setting/SettingText/index.vue';
import { ref, reactive } from 'vue';
import { ref, reactive, onMounted } from 'vue';
import { getGroupClaList, setGroupClaStatus, deleteGroupCla } from '@/api/cla';
import { useRouter, useRoute } from 'vue-router';
import { GModal } from '@/components/Setting/index';
import { reqCatch } from '@/utils/catch';
import { getOrgInfo } from '@/views/Org/hooks/orgInfo';
import { Message } from 'vue-devui';
import VulnerabilityDetail from '@/views/Jyh/Version/Detail/VulnerabilityDetail.vue'
import VulnerabilityDetail from '@/views/Jyh/Version/Detail/VulnerabilityDetail.vue';
import { getVulnList } from '@/api/jyh';
const { namespace } = getOrgInfo();
const tableData = ref([
@@ -250,9 +250,19 @@ const openVulnDetail = (row) => {
currentVuln.value = {
softwareId: 47,
id: 72
};
}
}
}
};
const valLists = ref([]);
onMounted(async () => {
const data = await getVulnList({
softwareId: 47,
current: 1,
size: 10
});
valLists.value = data?.data?.data?.data?.records || [];
});
</script>
<style scoped lang="scss">