Browse Source

fix: 修复插件配置组件无法打开

runphp 1 month ago
parent
commit
4da8283228
1 changed files with 2 additions and 5 deletions
  1. 2 5
      frontend/admin/views/PluginConfigForm.vue

+ 2 - 5
frontend/admin/views/PluginConfigForm.vue

@@ -22,6 +22,7 @@ import { ref, watch } from 'vue'
 import { ElMessage } from 'element-plus'
 import { getPluginConfigApi, savePluginConfigApi } from '@/api/plugin'
 import {useUserStore} from "@/store/user.js";
+import formCreate from '@form-create/element-ui'
 
 const userStore = useUserStore()
 const props = defineProps({
@@ -55,15 +56,11 @@ const configOptions = ref({
     } finally {
       loading.value = false
     }
-  },
-  beforeFetch: (options) => {
-    options.headers = {
-      Authorization: `Bearer ${userStore.token}`
-    };
   }
 })
 
 const loadConfig = async () => {
+  formCreate.setData('API_TOKEN', userStore.token)
   try {
     let { data } = await getPluginConfigApi(props.pluginId)