fix: 收口管理端页面权限与工作流运行授权
- 页面选项接口改用所属页面权限并返回最小数据视图 - 统一校验工作流引用、租户、状态与定时任务执行主体 - 补充聊天记录权限迁移和权限隔离回归测试
This commit is contained in:
@@ -28,18 +28,6 @@ interface ProviderOption {
|
||||
value: string;
|
||||
}
|
||||
|
||||
interface ModelProvider {
|
||||
key: string;
|
||||
options?: ProviderOptionExtra;
|
||||
title: string;
|
||||
}
|
||||
|
||||
interface LlmOption {
|
||||
extra: Map<string, string | undefined>;
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
interface SettingsEntity {
|
||||
chatgpt_api_key: string;
|
||||
chatgpt_chatPath: string;
|
||||
@@ -50,18 +38,6 @@ interface SettingsEntity {
|
||||
}
|
||||
|
||||
const providerOptions = ref<ProviderOption[]>(providerList as ProviderOption[]);
|
||||
const brands = ref<ModelProvider[]>([]);
|
||||
const llmOptions = ref<LlmOption[]>([]);
|
||||
|
||||
// 获取品牌接口数据
|
||||
function getBrands() {
|
||||
api.get('/api/v1/modelProvider/list').then((res) => {
|
||||
if (res.errorCode === 0) {
|
||||
brands.value = (res.data ?? []) as ModelProvider[];
|
||||
llmOptions.value = formatLlmList(brands.value);
|
||||
}
|
||||
});
|
||||
}
|
||||
function getOptions() {
|
||||
api
|
||||
.get(
|
||||
@@ -78,7 +54,6 @@ function getOptions() {
|
||||
}
|
||||
onMounted(() => {
|
||||
getOptions();
|
||||
getBrands();
|
||||
});
|
||||
|
||||
const entity = ref<SettingsEntity>({
|
||||
@@ -90,19 +65,6 @@ const entity = ref<SettingsEntity>({
|
||||
chat_publish_base_url: '',
|
||||
});
|
||||
|
||||
function formatLlmList(data: ModelProvider[]): LlmOption[] {
|
||||
return data.map((item) => {
|
||||
const extra = new Map([
|
||||
['chatPath', item.options?.chatPath],
|
||||
['llmEndpoint', item.options?.llmEndpoint],
|
||||
]);
|
||||
return {
|
||||
label: item.title,
|
||||
value: item.key,
|
||||
extra,
|
||||
};
|
||||
});
|
||||
}
|
||||
function handleChangeModel(value: string) {
|
||||
const extra = providerList.find((item) => item.value === value);
|
||||
entity.value.chatgpt_chatPath = extra?.options?.chatPath ?? '';
|
||||
|
||||
Reference in New Issue
Block a user