Skip to content

快速入门

文档目录

bash

├── build // 构建相关
├── bin // 执行脚本
├── public // 公共文件
 ├── favicon.ico // favicon图标
 └── index.html // html模板
├── src // 源代码
 ├── api // 所有请求
 ├── assets // 主题 字体等静态资源
 ├── components // 全局公用组件
 ├── directive // 全局指令
 ├── layout // 布局
 ├── router // 路由
 ├── store // 全局 store管理
 ├── utils // 全局公用方法
 ├── views // view
 ├── App.vue // 入口页面
 ├── main.js // 入口 加载组件 初始化等
 ├── permission.js // 权限管理
 └── settings.js // 系统配置
├── .editorconfig // 编码格式
├── .env.development // 开发环境配置
├── .env.production // 生产环境配置
├── .env.staging // 测试环境配置
├── .eslintignore // 忽略语法检查
├── .eslintrc.js // eslint 配置项
├── .gitignore // git 忽略项
├── babel.config.js // babel.config.js
├── package.json // package.json
└── vue.config.js // vue.config.js

安装依赖

bash
pnpm install

修改下 api 接口地址

  • 找到 vite.config.js 文件,修改下 api 接口地址
js

    server: {
      port: 80,
      host: true,
      open: true,
      proxy: {
        // https://cn.vitejs.dev/config/#server-proxy
        "/dev-api": {
          target: "https://vue.ruoyi.vip/prod-api",
          changeOrigin: true,
          rewrite: (p) => p.replace(/^\/dev-api/, ""),
        },
      },
    },

启动项目

bash
npm run dev