diff --git a/components/i/library/create.vue b/components/i/library/create.vue index 564c83ea5bcfad6a4233a5e6c7873e0a979a8540..b4de9b44faf38bdaa292bab0717bd02b52e5f5df 100644 --- a/components/i/library/create.vue +++ b/components/i/library/create.vue @@ -53,7 +53,7 @@ diff --git a/composables/useFavorites.js b/composables/useCollectionRequest.js similarity index 75% rename from composables/useFavorites.js rename to composables/useCollectionRequest.js index 57f5810ee4895367bb4fec7bef0def7283afd43d..c00ee5a4396a338c34a7fedb838a26bbf483f16e 100644 --- a/composables/useFavorites.js +++ b/composables/useCollectionRequest.js @@ -1,6 +1,6 @@ export default () => { // 创建及修改收藏夹 - const setOrUpdateFavorites = async (body) => { + const setOrUpdateCollection = async (body) => { /* * id number 非必须 有ID参数是修改,没有ID则为新增 * name string 非必须 @@ -14,8 +14,8 @@ export default () => { }) return { data, error } } - // 收藏夹列表 - const getFavorites = async () => { + // 集合列表 + const getCollection = async () => { const { data, error } = await useRequest('/v1/collection/list', { method: 'get' }) @@ -25,14 +25,14 @@ export default () => { return data.value.data || [] } // 删除收藏夹 - const deleteFavorite = async (collection_id) => { + const deleteCollection = async (collection_id) => { const {data, error} = await useRequest(`/v1/collection/${collection_id}/remove`, { method: 'post' }) return { data, error } } // 将会话添加到收藏夹 - const saveFavorite = async (body) => { + const saveCollection = async (body) => { // collection_id number 收藏夹ID // c_id string 会话ID const {data, error} = await useRequest(`/v1/collection/item/add`, { @@ -42,7 +42,7 @@ export default () => { return { data, error } } // 查询收藏夹会话列表 - const findFavorite = async (collection_id) => { + const findCollection = async (collection_id) => { const {data, error} = await useRequest(`/v1/collection/${collection_id}/items`, { method: 'post', body @@ -50,7 +50,7 @@ export default () => { return { data, error } } // 删除收藏夹会话 - const deleteFavoriteCollection = async (collection_id, c_id) => { + const deleteCollectionRecord = async (collection_id, c_id) => { const {data, error} = await useRequest(`/v1/collection/item/delete`, { method: 'post', body: { collection_id, c_id } @@ -58,19 +58,19 @@ export default () => { return { data, error } } // 查询会话是否被收藏 - const findCollectionFavorites = async (c_id) => { + const findRecordCollection = async (c_id) => { const {data, error} = await useRequest(`/v1/collection/item/check/${c_id}`, { method: 'get' }) return { data, error } } return { - getFavorites, - setOrUpdateFavorites, - deleteFavorite, - saveFavorite, - findFavorite, - deleteFavoriteCollection, - findCollectionFavorites + getCollection, + setOrUpdateCollection, + deleteCollection, + saveCollection, + findCollection, + deleteCollectionRecord, + findRecordCollection } } \ No newline at end of file