| @@ -52,7 +52,7 @@ type IframePageProps = { | |||||
| }; | }; | ||||
| /** 系统内嵌 iframe,目前系统有数据标注、应用开发、开发环境、GitLink 四个子系统,使用时可以添加其他子系统 */ | /** 系统内嵌 iframe,目前系统有数据标注、应用开发、开发环境、GitLink 四个子系统,使用时可以添加其他子系统 */ | ||||
| function IframePage({ type, openInTab = true, className, style }: IframePageProps) { | |||||
| function IframePage({ type, openInTab = false, className, style }: IframePageProps) { | |||||
| const [iframeUrl, setIframeUrl] = useState(''); | const [iframeUrl, setIframeUrl] = useState(''); | ||||
| const [loading, setLoading] = useState(false); | const [loading, setLoading] = useState(false); | ||||
| @@ -286,8 +286,6 @@ function Experiment() { | |||||
| message.success('运行成功'); | message.success('运行成功'); | ||||
| refreshExperimentList(); | refreshExperimentList(); | ||||
| refreshExperimentIns(id); | refreshExperimentIns(id); | ||||
| } else { | |||||
| message.error('运行失败'); | |||||
| } | } | ||||
| }; | }; | ||||
| @@ -17,6 +17,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => { | |||||
| const [form] = Form.useForm(); | const [form] = Form.useForm(); | ||||
| const loginPassword = Form.useWatch('password', form); | const loginPassword = Form.useWatch('password', form); | ||||
| const userId = props.values.userId; | const userId = props.values.userId; | ||||
| const originPassword = props.values.originPassword; | |||||
| const intl = useIntl(); | const intl = useIntl(); | ||||
| const handleOk = () => { | const handleOk = () => { | ||||
| @@ -26,7 +27,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => { | |||||
| props.onCancel(); | props.onCancel(); | ||||
| }; | }; | ||||
| const handleFinish = async (values: Record<string, any>) => { | const handleFinish = async (values: Record<string, any>) => { | ||||
| props.onSubmit({ ...values, userId } as FormValueType); | |||||
| props.onSubmit({ password: values.password, userId, originPassword } as FormValueType); | |||||
| }; | }; | ||||
| const checkPassword = (rule: any, value: string) => { | const checkPassword = (rule: any, value: string) => { | ||||
| @@ -80,6 +80,7 @@ const UserForm: React.FC<UserFormProps> = (props) => { | |||||
| const params = { | const params = { | ||||
| ...values, | ...values, | ||||
| userId: props.values.userId, | userId: props.values.userId, | ||||
| originPassword: props.values.originPassword, | |||||
| }; | }; | ||||
| props.onSubmit(params as UserFormData); | props.onSubmit(params as UserFormData); | ||||
| }; | }; | ||||
| @@ -194,7 +195,7 @@ const UserForm: React.FC<UserFormProps> = (props) => { | |||||
| id: 'system.user.user_name', | id: 'system.user.user_name', | ||||
| defaultMessage: '用户账号', | defaultMessage: '用户账号', | ||||
| })} | })} | ||||
| hidden={userId} | |||||
| disabled={!!props.values.userId} | |||||
| placeholder="请输入用户账号" | placeholder="请输入用户账号" | ||||
| colProps={{ md: 12, xl: 12 }} | colProps={{ md: 12, xl: 12 }} | ||||
| rules={[ | rules={[ | ||||
| @@ -214,7 +215,6 @@ const UserForm: React.FC<UserFormProps> = (props) => { | |||||
| id: 'system.user.password', | id: 'system.user.password', | ||||
| defaultMessage: '密码', | defaultMessage: '密码', | ||||
| })} | })} | ||||
| hidden={userId} | |||||
| placeholder="请输入密码" | placeholder="请输入密码" | ||||
| colProps={{ md: 12, xl: 12 }} | colProps={{ md: 12, xl: 12 }} | ||||
| fieldProps={{ | fieldProps={{ | ||||
| @@ -560,7 +560,7 @@ const UserTableList: React.FC = () => { | |||||
| /> | /> | ||||
| <ResetPwd | <ResetPwd | ||||
| onSubmit={async (values: any) => { | onSubmit={async (values: any) => { | ||||
| const success = await resetUserPwd(values.userId, values.password); | |||||
| const success = await resetUserPwd(values); | |||||
| if (success) { | if (success) { | ||||
| setResetPwdModalVisible(false); | setResetPwdModalVisible(false); | ||||
| setSelectedRows([]); | setSelectedRows([]); | ||||
| @@ -94,11 +94,7 @@ export function updateUserProfile(data: API.CurrentUser) { | |||||
| } | } | ||||
| // 用户密码重置 | // 用户密码重置 | ||||
| export function resetUserPwd(userId: number, password: string) { | |||||
| const data = { | |||||
| userId, | |||||
| password, | |||||
| }; | |||||
| export function resetUserPwd(data: any) { | |||||
| return request<API.Result>('/api/system/user/resetPwd', { | return request<API.Result>('/api/system/user/resetPwd', { | ||||
| method: 'put', | method: 'put', | ||||
| data: data, | data: data, | ||||
| @@ -22,6 +22,7 @@ declare namespace API.System { | |||||
| gitLinkUsername?: string; | gitLinkUsername?: string; | ||||
| gitLinkPassword?: string; | gitLinkPassword?: string; | ||||
| credit?: number; | credit?: number; | ||||
| originPassword?: string; | |||||
| } | } | ||||
| export interface UserListParams { | export interface UserListParams { | ||||