Skip to content
.NET 开发者指北.NET 开发者指北
CMS
.NET指北
FreeKit
Docker
关于
博客
github icon
    • Lin CMS By .NET
      • 后端准备
        • 后端快速上手
          • 相关技术
            • 前端准备
              • 开源地址
                • 博客模块线上地址
                  • 快速上手
                    • deploy 发布
                      • 步骤
                        • nginx 配置
                          • 配置项
                          • 开源介绍
                            • 功能模块的设计
                              • 产品设计
                                • GitHub Actions
                                  • LinCms如何切换成SQL server

                                  前端准备

                                  calendar icon2020年2月28日timer icon大约 2 分钟word icon约 463 字

                                  此页内容
                                  • 开源地址
                                  • 博客模块线上地址
                                  • 快速上手
                                  • deploy 发布
                                  • 步骤
                                  • nginx 配置
                                  • 配置项

                                  # 前端准备

                                  # 开源地址

                                  • 管理端 UI https://github.com/luoyunchong/lin-cms-vueopen in new window
                                  • 用户端 UI https://github.com/luoyunchong/lin-cms-vvlogopen in new window

                                  # 博客模块线上地址

                                  • 本项目 swagger 地址 https://api.igeekfan.cn/swagger/index.htmlopen in new window
                                  • 用户端 lin-cms-vvlog https://vvlog.igeekfan.cnopen in new window
                                    • 普通用户:710277267@qq.com
                                    • 密码:123qwe
                                  • 管理员 lin-cms-vue https://cms.igeekfan.cn/open in new window
                                    • 管理员: admin
                                    • 密码:123qwe

                                  # 快速上手

                                  开发必备

                                  • Node.js 10+open in new window 版本即可,必须安装 12.7
                                  • yarnopen in new window

                                  如果以下命令有问题,请删除 yarn.lock,node_modules 文件夹后,重新执行 yarn,yarn serve

                                  # clone the project
                                  git clone https://github.com/luoyunchong/lin-cms-vue.git
                                  
                                  # install dependency
                                  yarn
                                  
                                  # develop
                                  yarn serve
                                  
                                  # deploy
                                  yarn deploy
                                  
                                  1
                                  2
                                  3
                                  4
                                  5
                                  6
                                  7
                                  8
                                  9
                                  10
                                  11

                                  # deploy 发布

                                  scp2 方便快速发布,一行命令就能快速发布成功。

                                  必备条件:(参数)

                                  • 一台 linux 的服务器,ip
                                  • 用户名
                                  • 密码
                                  • 端口:默认是 22
                                  • 发布的地址。这里放到/var/www/lin-cms-vue 目录中。

                                  # 步骤

                                  根目录新建 deploy 目录,创建 index.js 文件。

                                  'use strict'
                                  // 引入scp2模块
                                  var client = require('scp2');
                                  const ora = require('ora')
                                  const chalk = require('chalk')
                                  const spinner = ora('正在发布到生产服务器...')
                                  spinner.start()
                                  client.scp('dist/', {
                                      "host": "",
                                      "username": "",
                                      "password": "",
                                      "port": "22",
                                      "path": "/var/www/lin-cms-vue"
                                  }, function (err) {
                                      spinner.stop()
                                      if (!err) {
                                          console.log("npm run build-scp2: scp2工具上传完毕,远端服务路径:/var/www/lin-cms-vue")
                                      } else {
                                          console.log("err", err)
                                      }
                                  })
                                  
                                  1
                                  2
                                  3
                                  4
                                  5
                                  6
                                  7
                                  8
                                  9
                                  10
                                  11
                                  12
                                  13
                                  14
                                  15
                                  16
                                  17
                                  18
                                  19
                                  20
                                  21

                                  快速发布,需要安装 scp2

                                  cnpm install scp2
                                  
                                  1

                                  package.json 中增加

                                    "scripts": {
                                      "deploy": "yarn build:production && node ./deploy",
                                  }
                                  
                                  1
                                  2
                                  3
                                  yarn deploy
                                  
                                  1

                                  # nginx 配置

                                  • vue 使用 history 的配置
                                  server {
                                      listen 8080;
                                      root /var/www/lin-cms-vue;
                                  
                                     charset utf-8;
                                     location / {
                                         try_files $uri $uri/ /index.html;
                                  
                                       }
                                  
                                      error_page   500 502 503 504  /50x.html;
                                      location = /50x.html {
                                          root   html;
                                      }
                                  
                                  }
                                  
                                  1
                                  2
                                  3
                                  4
                                  5
                                  6
                                  7
                                  8
                                  9
                                  10
                                  11
                                  12
                                  13
                                  14
                                  15
                                  16

                                  # 配置项

                                  1. 配置 api 地址: 打开配置文件 src/config/index.js 配置 baseUrl ,本地开发阶段配置本地虚拟域名(https://localhost:5001/),线上部署生产域名。

                                  2. 用户名:admin 密码 123qwe

                                  edit icon在 GitHub 上编辑此页open in new window
                                  上次编辑于: 2022/10/24 14:14:31
                                  贡献者: igeekfan,luoyunchong,IGeekFan
                                  上一页
                                  相关技术
                                  下一页
                                  开源介绍
                                  MIT Licensed | Copyright © 2021-present luoyunchong
                                  苏ICP备16046457号-1

                                  该应用可以安装在你的 PC 或移动设备上。这将使该 Web 应用程序外观和行为与其他应用程序相同。它将在出现在应用程序列表中,并可以固定到主屏幕,开始菜单或任务栏。此 Web 应用程序还将能够与其他应用程序和你的操作系统安全地进行交互。

                                  详情