客栈管理后台

ccf dbf1c08819 ugc任务菜单 4 meses atrás
api 19259f539e fix 6 anos atrás
assets 34c1796d1a 视频上传调整 4 anos atrás
components 6efd73b8e5 dd 4 meses atrás
dist dbf1c08819 ugc任务菜单 4 meses atrás
layouts 31297ce6ab 默认图像 1 ano atrás
middleware b72488bfe4 测试环境跳转问题 2 anos atrás
pages dbf1c08819 ugc任务菜单 4 meses atrás
plugins 73bb9c7e2f up 5 anos atrás
static 23ae4cdd03 云端工作重构中 7 anos atrás
store 31297ce6ab 默认图像 1 ano atrás
styles 2e6a5c87ac 动态管理 4 anos atrás
utils 66b1601d6f 添加表格导出 4 anos atrás
.DS_Store c6dc89e830 https 5 anos atrás
.browserslistrc edbdc7332b 初始化迁移 7 anos atrás
.editorconfig 78e45ac445 pre ssr 7 anos atrás
.gitignore 8df9908b6e add new ignore 5 anos atrás
.npmrc 454d61442c build new 6 anos atrás
README.md 5fda2201c0 test auto update 5 anos atrás
nuxt.config.js 5a18b44909 测试环境分支 3 anos atrás
package-lock.json cc298a2083 发票 1 ano atrás
package.json cc298a2083 发票 1 ano atrás
permission.js 07f6a09820 update: add new theme & add user manage 6 anos atrás
settings.js 9e740e2aad bug fixs 6 anos atrás
vue.config.js e57992a7d8 添加技术圈的修改 6 anos atrás
yarn.lock cc298a2083 发票 1 ano atrás

README.md

程序员客栈--Boss后台项目

基于Nuxtjs,Element UI,该项目包括客栈主站和技术圈。自动化部署,但是需要手动build并generate才能正常部署,dev分支自动更新到dev环境,master分支自动更新到线上环境

Build Setup 建议用yarn保证版本稳定运行

# install dependencies
$ yarn

# serve with hot reload at localhost:20201, local.proginn.com:20201
yarn dev

# build
$ yarn run build

目录结构

.
├── LICENSE
├── README.md
├── app.html                # app html template
├── assets                  # static img css
│   ├── README.md
│   ├── css
│   └── img
├── components              # components
│   ├── README.md
│   ├── ver_code.vue
│   ├── ws
│   └── wx_header.vue
├── dist                    # useless
│   ├── 200.html
│   ├── README.md
│   ├── _nuxt
│   ├── cert
│   ├── favicon.ico
│   ├── index.html
│   └── type
├── layouts                 # layout
│   ├── README.md
│   ├── default.vue
│   └── opacity_header.vue
├── middleware              # middelware useless now
│   ├── README.md
│   └── authenticated.js
├── mixins                  # mixins
│   ├── getDeviceType.js    # deviceType
│   ├── group.js
│   └── wx.js
├── nuxt.config.js          # nuxt config
├── package.json            # package.json
├── pages                   # pages(static router)
│   ├── README.md
├── plugins
│   ├── README.md
│   ├── axios.js            # useless
│   ├── common.js           # common methods
│   ├── element.js          # element ui inject
│   ├── http.js             # useless
│   └── nuxtAxios.js        # nuxt axios config
├── static
│   ├── README.md
│   └── favicon.ico         # favicon
├── store
│   ├── README.md
│   └── index.js            # create store
└── yarn.lock               # 勿删

开发注意

  • 由于测试环境和线上环境cookie键值相同,所以尽量在隐身模式下测试开发环境避免不必要的麻烦
  • API交互格式统一application/x-www-form-urlencoded,否者无法访问成功
  • 调用API尽量只能使用Nuxtjs本身集成的Axios,使用方式 js async asyncData({ $axios, params, req }) { let id = params.id; let headers = req && req.headers; let res = await $axios.$get( `/api/user/getUserInfo?id=${id}&page=1&size=10`, { headers } ); return { title: `${res.data.info.nickname}的技术圈主页-程序员客栈` }; }, methods: { async getDetail() { let res = await this.$axios.$get( `/api/user/getUserInfo?id=${this.$route.params.id}&page=1&size=10` ); // console.log(res.data) document.title = `${res.data.info.nickname}的技术圈主页-程序员客栈`; if (res) { this.idInfo = res.data; } }, }
  • layout有两个一个主题的一个空白的的
  • vuex 的store中可以存放一些全局变量,例如手机号正则、email正则,当然也可以独立成constants
  • 静态文件放在assets中,通过@/assets/访问,css中用~@/assets
  • 后台界面基本就是element ui模板,请求数据使用plugins下的http.js
  • 使用了一个后台模板vue-admin的theme,不过store中大部分都没用
  • 编辑器使用了vue quill *