fix(client): 添加put方法并修复publish接口调用

This commit is contained in:
2026-03-13 22:28:08 +08:00
parent c850623a48
commit 253bc4aed2
2 changed files with 8 additions and 4 deletions

View File

@@ -5,7 +5,7 @@
// ============================================
// 环境配置(切换这里即可)
// ============================================
const ENV = 'cloud'; // 'local' = 本地后端, 'cloud' = 微信云托管
const ENV = 'local'; // 'local' = 本地后端, 'cloud' = 微信云托管
const CONFIG = {
local: {
@@ -117,6 +117,10 @@ export function del(url, data) {
return request({ url, method: 'DELETE', data });
}
export function put(url, data) {
return request({ url, method: 'PUT', data });
}
/**
* 获取静态资源完整URL图片等
* @param {string} path - 相对路径,如 /uploads/stories/1/characters/1.jpg
@@ -177,4 +181,4 @@ export function getDraftNodeBackground(storyId, draftId, nodeKey) {
return getStaticUrl(`/uploads/stories/${storyId}/drafts/${draftId}/${nodeKey}/background.jpg`);
}
export default { request, get, post, del, getStaticUrl, getCharacterAvatar, getStoryCover, getNodeBackground, getNodeCharacter, getDraftNodeBackground };
export default { request, get, post, put, del, getStaticUrl, getCharacterAvatar, getStoryCover, getNodeBackground, getNodeCharacter, getDraftNodeBackground };