Leo 2 yıl önce
ebeveyn
işleme
e5407e534d

+ 5 - 4
src/module/datasource/component/DatasourceEdit.jsx

@@ -81,11 +81,11 @@ export default function DatasourceAdd({ ds_id, ds_info, setDsModalVisible }) {
       params['use_ssl'] = useSSL ? 1 : 0
       params['kerberos'] = kerbsValid ? 1 : 0
       if (kerbsValid) {
-        if (!keytabFile.length) {
+        if (keytabFile && keytabFile.length) {
           const keytab = await uploadKerbFile(keytabFile)
           params['keytab'] = keytab
         }
-        if (!krd5File.length) {
+        if (krd5File && krd5File.length) {
           const krb5config = await uploadKerbFile(krd5File)
           params['krb5config'] = krb5config
         }
@@ -128,11 +128,12 @@ export default function DatasourceAdd({ ds_id, ds_info, setDsModalVisible }) {
         params['use_ssl'] = useSSL ? 1 : 0
         params['kerberos'] = kerbsValid ? 1 : 0
         if (kerbsValid) {
-          if (keytabFile && !keytabFile.length) {
+          console.log(keytabFile, krd5File)
+          if (keytabFile && keytabFile.length) {
             const keytab = await uploadKerbFile(keytabFile)
             params['keytab'] = keytab
           }
-          if (krd5File && !krd5File.length) {
+          if (krd5File && krd5File.length) {
             const krb5config = await uploadKerbFile(krd5File)
             params['krb5config'] = krb5config
           }