mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
feat: 修复导入工作流代码时的 JSON 解析问题
This commit is contained in:
@@ -82,9 +82,10 @@ async function updateWorkflow() {
|
|||||||
function saveCodeString(type: string, code: any) {
|
function saveCodeString(type: string, code: any) {
|
||||||
try {
|
try {
|
||||||
if (code) {
|
if (code) {
|
||||||
|
const codeObject = JSON.parse(code.value)
|
||||||
if (type === 'workflow') {
|
if (type === 'workflow') {
|
||||||
nodes.value = code.actions
|
nodes.value = codeObject.actions || []
|
||||||
edges.value = code.flows
|
edges.value = codeObject.flows || []
|
||||||
}
|
}
|
||||||
importCodeDialog.value = false
|
importCodeDialog.value = false
|
||||||
$toast.success('导入成功!')
|
$toast.success('导入成功!')
|
||||||
|
|||||||
Reference in New Issue
Block a user