zoukankan      html  css  js  c++  java
  • vue-src-api-单独的请求api详情

    vue-src-api-单独的请求api详情

    /**
     * 文章请求模块
     */
    import request from '@/utils/request'
    // 获取频道新闻推荐_V1.1
    export const newTuijian = params => {
      return request({
        method: 'GET',
        url: '/app/v1_1/articles',
        params
      })
    }
    export const getAriticle = articleId => {
      return request({
        method: 'GET',
        url: `/app/v1_0/articles/${articleId}`
      })
    }
    // 关注
    export const getattention = target => {
      return request({
        method: 'POST',
        url: '/app/v1_0/user/followings',
        data: {
          target
        }
      })
    }
    // 取消关注
    export const deleteFollow = target => {
      return request({
        method: 'DELETE',
        url: `/app/v1_0/user/followings/${target}`
      })
    }
    // 收藏
    export const getCollent = target => {
      return request({
        method: 'POST',
        url: '/app/v1_0/article/collections',
        data: {
          target
        }
      })
    }
    // 取消收藏
    export const DeleteCollent = target => {
      return request({
        method: 'DELETE',
        url: `/app/v1_0/article/collections/${target}`
      })
    }
    // 评论列表
    export const getCommentList = params => {
      return request({
        method: 'GET',
        url: '/app/v1_0/comments',
        params
      })
    }
    // 点赞
    export const articleLike = target => {
      return request({
        method: 'POST',
        url: '/app/v1_0/article/likings',
        data: {
          target
        }
      })
    }
    // 取消点赞
    export const DeletearticleLike = target => {
      return request({
        method: 'DELETE',
        url: `/app/v1_0/article/likings/${target}`
      })
    }
    // 文章内容发布
    export const postarticle = data => {
      return request({
        method: 'POST',
        url: '/app/v1_0/comments',
        data
      })
    }
    // 对评论或评论回复点赞
    export const addcommentLike = target => {
      return request({
        method: 'POST',
        url: '/app/v1_0/comment/likings',
        data: {
          target
        }
      })
    }
    // 取消对评论或评论回复点赞
    export const deleteCommentLike = target => {
      return request({
        method: 'DELETE',
        url: `/app/v1_0/comment/likings/${target}`
      })
    }
  • 相关阅读:
    服务器磁盘脱机无法挂载
    go 字符串操作相关
    golang 系列:atomic 原子操作
    UUID简介及 Golang实现
    go 图片base64转二进制
    golang go 中字符串和各种int类型之间的相互转换方式
    Go 获取当前时间 时间格式的转换 秒、毫秒、纳秒时间戳输出
    Go语言中调用C语言类型转换篇
    Supervisor 部署go gin服务 或在Linux下面独立部署
    Go语言对字符串进行SHA1 哈希运算的方法
  • 原文地址:https://www.cnblogs.com/wsm777/p/13991706.html
Copyright © 2011-2022 走看看