Browse Source

fix: 修复插件配置下拉选项没有加载

runphp 1 tháng trước cách đây
mục cha
commit
19bc031748

+ 6 - 0
frontend/admin/views/PluginConfigForm.vue

@@ -56,11 +56,17 @@ const configOptions = ref({
     } finally {
     } finally {
       loading.value = false
       loading.value = false
     }
     }
+  },
+  beforeFetch: (options) => {
+    options.headers = {
+      Authorization: `Bearer ${userStore.token}`
+    };
   }
   }
 })
 })
 
 
 const loadConfig = async () => {
 const loadConfig = async () => {
   formCreate.setData('API_TOKEN', userStore.token)
   formCreate.setData('API_TOKEN', userStore.token)
+  formCreate.setData('API_BASE_URL', import.meta.env.VITE_API_BASE_URL)
   try {
   try {
     let { data } = await getPluginConfigApi(props.pluginId)
     let { data } = await getPluginConfigApi(props.pluginId)