Migrated repository
Go to file
2023-08-17 10:01:50 +08:00
.husky feat: 新增 commitlint,修改部分规则 2022-06-15 17:09:40 +08:00
.workflow fix: 补充丢失的flow文件 2022-12-22 19:43:24 +08:00
build Merge branch 'dev' into master-fetch-dev 2022-12-16 12:56:28 +08:00
plop fix: 修改plop模板的错误 2022-05-21 13:43:31 +08:00
public docs: 修改文档路径 2022-05-06 20:23:08 +08:00
readme docs: 修改 readme 图片展示 2022-08-10 16:05:34 +08:00
src Merge branch 'dev' into master-fetch-dev 2023-08-17 09:57:56 +08:00
types Merge branch 'dev' into master-fetch-dev 2023-06-15 19:56:44 +08:00
.commitlintrc.js feat: 新增 commitlint,修改部分规则 2022-06-15 17:09:40 +08:00
.env fix: 修改地址 2022-11-02 21:33:20 +08:00
.eslintignore fix:路由处理,CSS处理,样式处理,全局变量处理 2021-12-14 15:53:30 +08:00
.eslintrc.js feat: 添加图层模式控制选项 2022-09-27 20:14:00 +08:00
.gitignore feat:小组件-数字翻牌-增加精度参数 2022-06-13 05:12:24 +00:00
index.css perf: 去除屏幕大小处理 2022-10-01 17:26:52 +08:00
index.html perf: 去除屏幕大小处理 2022-10-01 17:26:52 +08:00
LICENSE update LICENSE. 2022-08-29 12:19:15 +00:00
Makefile feat: 新增 preview 模式 2022-06-15 17:30:24 +08:00
package.json build: 升级 axios lock错误 2023-07-15 14:13:40 +08:00
pnpm-lock.yaml build: 初始化依赖 2023-08-17 10:01:50 +08:00
prettier.config.js feat: 新增 commitlint,修改部分规则 2022-06-15 17:09:40 +08:00
README.md Merge branch 'dev' into master-fetch-dev 2023-05-28 15:59:08 +08:00
tsconfig.json fix: 解决 TS 类型错误问题 2023-06-27 18:11:37 +08:00
vite.config.ts Merge branch 'dev' of https://gitee.com/MTrun/go-view into master-fetch-dev 2022-11-02 19:06:49 +08:00

总览

logo

master-fetch 分支是带有后端接口请求的分支

后端项目地址:https://gitee.com/MTrun/go-view-serve

接口说明地址:https://docs.apipost.cn/preview/5aa85d10a59d66ce/ddb813732007ad2b?target_id=84dbc5b0-158f-4bcb-8f74-793ac604ada3#3e053622-1e76-43f9-a039-756aee822dbb

使用

所有的接口地址位置:src\api\path\*

接口地址修改:.env

🤯 后端项目

后端项目 gitee 地址:https://gitee.com/MTrun/go-view-serve

接口说明地址:https://docs.apipost.cn/preview/5aa85d10a59d66ce/ddb813732007ad2b?target_id=84dbc5b0-158f-4bcb-8f74-793ac604ada3#3e053622-1e76-43f9-a039-756aee822dbb

# port
VITE_DEV_PORT = '8080'

# development path
VITE_DEV_PATH = 'http://127.0.0.1:8080'

# production path
VITE_PRO_PATH = 'http://127.0.0.1:8080'

公共前缀修改:src\settings\httpSetting.ts

// 请求前缀
export const axiosPre = '/api/goview'

接口封装:src\api\http.ts

import axiosInstance from './axios'
import { RequestHttpEnum, ContentTypeEnum } from '@/enums/httpEnum'

export const get = (url: string, params?: object) => {
  return axiosInstance({
    url: url,
    method: RequestHttpEnum.GET,
    params: params,
  })
}

export const post = (url: string, data?: object, headersType?: string) => {
  return axiosInstance({
    url: url,
    method: RequestHttpEnum.POST,
    data: data,
    headers: {
      'Content-Type': headersType || ContentTypeEnum.JSON
    }
  })
}

export const put = (url: string, data?: object, headersType?: string) => {
  return axiosInstance({
    url: url,
    method: RequestHttpEnum.PUT,
    data: data,
    headers: {
      'Content-Type': headersType || ContentTypeEnum.JSON
    }
  })
}

export const del = (url: string, params?: object) => {
  return axiosInstance({
    url: url,
    method: RequestHttpEnum.DELETE,
    params
  })
}

// 获取请求函数默认get
export const http = (type?: RequestHttpEnum) => {
  switch (type) {
    case RequestHttpEnum.GET:
      return get

    case RequestHttpEnum.POST:
      return post

    case RequestHttpEnum.PUT:
      return put

    case RequestHttpEnum.DELETE:
      return del

    default:
      return get
  }
}

代码提交

  • feat: 新功能
  • fix: 修复 Bug
  • docs: 文档修改
  • perf: 性能优化
  • revert: 版本回退
  • ci: CICD集成相关
  • test: 添加测试代码
  • refactor: 代码重构
  • build: 影响项目构建或依赖修改
  • style: 不影响程序逻辑的代码修改
  • chore: 不属于以上类型的其他类型(日常事务)

交流

QQ 群1030129384

QQ群

渲染海报