File tree Expand file tree Collapse file tree
frontend/packages/cozeloop/prompt-pages/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -538,7 +538,7 @@ export function PromptHeader() {
538538 onCacnel = { deleteModal . close }
539539 onOk = { ( ) => {
540540 deleteModal . close ( ) ;
541- navigate ( ' pe/prompts' ) ;
541+ navigate ( ` ${ baseURL } / pe/prompts` ) ;
542542 } }
543543 />
544544 </ div >
Original file line number Diff line number Diff line change @@ -134,9 +134,17 @@ export const usePrompt = ({
134134 } ;
135135 } ) ;
136136 setHistoricMessage ( historicMessage ) ;
137- const mockVariables =
138- mockRes . debug_context ?. debug_core ?. mock_variables || [ ] ;
139- setMockVariables ( mockVariables ) ;
137+ setMockVariables ( array =>
138+ array . map ( it => {
139+ const mock = (
140+ mockRes . debug_context ?. debug_core ?. mock_variables || [ ]
141+ ) . find ( v => v . key === it . key ) ;
142+ return {
143+ ...it ,
144+ value : mock ?. value ,
145+ } ;
146+ } ) ,
147+ ) ;
140148 const mockTools =
141149 mockRes . debug_context ?. debug_core ?. mock_tools || [ ] ;
142150 setMockTools ( mockTools ) ;
Original file line number Diff line number Diff line change 11// Copyright (c) 2025 coze-dev Authors
22// SPDX-License-Identifier: Apache-2.0
3+ /* eslint-disable arrow-body-style */
34/* eslint-disable security/detect-object-injection */
45/* eslint-disable @typescript-eslint/no-explicit-any */
56import { uniqueId } from 'lodash-es' ;
@@ -114,10 +115,6 @@ export const getMockVariables = (
114115 variables : VariableDef [ ] ,
115116 mockVariables : VariableVal [ ] ,
116117) => {
117- const map = new Map ( ) ;
118- variables . forEach ( ( item , index ) => {
119- map . set ( item . key , index ) ;
120- } ) ;
121118 return variables . map ( item => {
122119 const mockVariable = mockVariables . find ( it => it . key === item . key ) ;
123120 return {
You can’t perform that action at this time.
0 commit comments