1 后端啟動說明
- 1 在application.yml中修改redis和myql配置
redis:
database: 2
host: ${REDIS_HOST:localhost}
password:
port: ${REDIS_PORT:6379}
pool:
max-active: 20
datasource:
# name: test
url: jdbc:mysql://${MYSQL_HOST:localhost}:${MYSQL_PORT:3306}/loop_admin_v1?useUnicode=true&characterEncoding=UTF8
# url: jdbc:mysql://${MYSQL_HOST:120.79.250.60}:${MYSQL_PORT:3306}/loop_admin?useUnicode=true&characterEncoding=UTF8
username: root
password: 123456
#阿里巴巴數(shù)據(jù)庫連接池
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
filters: stat
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
- 2 項目端口扫尖,jwt 配置(默認就行) url配置(不需要登錄就可以訪問的url)
server:
port: 9002
jwt:
token-header: Authorization
expire: 14400 #四個小時
rsa-secret: xx1WET12^%3^(WE45
#不需要登錄驗證的地址
url:
ignore:
startWith: /jwt #書寫規(guī)則 (鏈接之間用,隔開) /url1,/url2,/url3
- 3 用idea導入項目换怖,配置好以上選項,啟動項目即可
2 前端啟動說明
前端項目端口 和地址:config/index.js中
1 準備工作
- node.js環(huán)境(npm包管理器)
- vue-cli 腳手架構(gòu)建工具
- cnpm npm的淘寶鏡像
2 開發(fā)運行
# 安裝依賴
npm install
//or # 建議不要用cnpm 安裝有各種詭異的bug 可以通過如下操作解決npm速度慢的問題
npm install --registry=https://registry.npm.taobao.org
# 本地開發(fā) 開啟服務(wù)
npm run dev
3 目錄結(jié)構(gòu)
├── build // 構(gòu)建相關(guān)
├── config // 配置相關(guān)
├── src // 源代碼
│ ├── api // 所有請求
│ ├── assets // 主題 字體等靜態(tài)資源
│ ├── components // 全局公用組件
│ ├── directive // 全局指令
│ ├── filtres // 全局filter
│ ├── mock // mock數(shù)據(jù)
│ ├── router // 路由
│ ├── store // 全局store管理
│ ├── styles // 全局樣式
│ ├── utils // 全局公用方法
│ ├── view // view
│ ├── App.vue // 入口頁面
│ └── main.js // 入口 加載組件 初始化等
├── static // 第三方不打包資源
│ ├── jquery
│ └── Tinymce // 富文本
├── .babelrc // babel-loader 配置
├── eslintrc.js // eslint 配置項
├── .gitignore // git 忽略項
├── favicon.ico // favicon圖標
├── index.html // html模板
└── package.json // package.json
4 狀態(tài)管理
后臺只有user和app配置相關(guān)狀態(tài)使用vuex存在全局悦污,其它數(shù)據(jù)都由每個業(yè)務(wù)頁面自己管理钉蒲。
License
Apache License Version 2.0