change url
This commit is contained in:
parent
06380e48c5
commit
0771b43f56
1 changed files with 17 additions and 19 deletions
|
@ -50,32 +50,30 @@ export const useSettingStore = defineStore("setting", {
|
||||||
return res;
|
return res;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async uploadImage(data: { key: SettingString; value?: File }[]): Promise<AxiosResponse<any, any>> {
|
async updateSetting<K extends SettingString>(
|
||||||
const formData = new FormData();
|
key: K,
|
||||||
for (let entry of data) {
|
value: SettingValueMapping[K]
|
||||||
if (entry.value) formData.append(entry.key, entry.value);
|
): Promise<AxiosResponse<any, any>> {
|
||||||
}
|
return await http.put("/admin/setting", {
|
||||||
return await http.put("/admin/setting/img", formData, {
|
setting: key,
|
||||||
headers: {
|
value: value,
|
||||||
"Content-Type": "multipart/form-data",
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async updateSettings<K extends SettingString>(
|
async updateSettings<K extends SettingString>(
|
||||||
data: { key: K; value: SettingValueMapping[K] }[]
|
data: { key: K; value: SettingValueMapping[K] }[]
|
||||||
): Promise<AxiosResponse<any, any>> {
|
): Promise<AxiosResponse<any, any>> {
|
||||||
return await http.put("/admin/setting", data);
|
return await http.put("/admin/setting/multi", data);
|
||||||
},
|
},
|
||||||
async updateSetting<K extends SettingString>(
|
async uploadImage(data: { key: SettingString; value?: File }[]): Promise<AxiosResponse<any, any>> {
|
||||||
key: K,
|
const formData = new FormData();
|
||||||
value: SettingValueMapping[K]
|
for (let entry of data) {
|
||||||
): Promise<AxiosResponse<any, any>> {
|
if (entry.value) formData.append(entry.key, entry.value);
|
||||||
return await http.put("/admin/setting", [
|
}
|
||||||
{
|
return await http.put("/admin/setting/images", formData, {
|
||||||
setting: key,
|
headers: {
|
||||||
value: value,
|
"Content-Type": "multipart/form-data",
|
||||||
},
|
},
|
||||||
]);
|
});
|
||||||
},
|
},
|
||||||
async resetSetting(key: SettingString): Promise<AxiosResponse<any, any>> {
|
async resetSetting(key: SettingString): Promise<AxiosResponse<any, any>> {
|
||||||
return await http.delete(`/admin/setting/${key}`);
|
return await http.delete(`/admin/setting/${key}`);
|
||||||
|
|
Loading…
Add table
Reference in a new issue