diff --git a/src/api/system/config.js b/src/api/system/config.js
index 7858c69..4daeed9 100644
--- a/src/api/system/config.js
+++ b/src/api/system/config.js
@@ -43,6 +43,15 @@ export function updateConfig(data) {
})
}
+// 修改参数配置
+export function updateConfigByKey(data) {
+ return request({
+ url: '/system/config/byKey',
+ method: 'put',
+ data: data
+ })
+}
+
// 删除参数配置
export function delConfig(configId) {
return request({
diff --git a/src/views/user/developer/index.vue b/src/views/user/developer/index.vue
index 3523bbf..3dad7d0 100644
--- a/src/views/user/developer/index.vue
+++ b/src/views/user/developer/index.vue
@@ -7,32 +7,66 @@
-
-
- Api Server:
-
-
-
-
- Api Key:
-
-
-
-
- Api Server备用:
-
-
+
+
+
+
+
+
+
+
+
+
+
+ 确 定
+
+
+function getConfig () {
+ getConfigKey("api2gpt.server.url").then(response => {
+ form.value.apiServer = response.msg
+ })
+ getConfigKey("api2gpt.server.key").then(response => {
+ form.value.apiKey = response.msg
+ })
+ getConfigKey("api2gpt.server.backup").then(response => {
+ form.value.apiServer2 = response.msg
+ })
+}
+
+function submitForm() {
+ proxy.$refs["configRef"].validate(valid => {
+ if (valid) {
+ updateConfigByKey({
+ "api2gpt.server.url": form.value.apiServer,
+ "api2gpt.server.key": form.value.apiKey,
+ "api2gpt.server.backup": form.value.apiServer2
+ }).then(response => {
+ proxy.$modal.msgSuccess("修改成功");
+ });
+ }
+ })
+}
+
+getConfig()
+