Skip to content

Commit

Permalink
feat:前端统一配置状态码,修改README.md,将Nacos分支设置为主分支
Browse files Browse the repository at this point in the history
  • Loading branch information
moxi624 committed Aug 18, 2020
1 parent c72ab42 commit 44c809d
Show file tree
Hide file tree
Showing 60 changed files with 354 additions and 190 deletions.
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,18 @@
- **Redis**:密码:mogu2018
- **远程SSH初始密码**:用户:root,密码:mogu2018
- **RabbitMQ管理页面:** 用户:guest,密码:guest
- **Eureka管理页面:** 用户:user,密码:password123
- **Nacos管理页面:** 用户:nacos,密码:nacos
- **Sentinel管理页面:** 用户:sentinel,密码:sentinel
- **蘑菇博客监控页面**:用户:user,密码:password123
- **Druid初始密码:** 用户:admin,密码:123456

## 运行配置

蘑菇博客使用了一些监控的Spring Cloud组件,但是并不一定都需要部署,必须启动的服务包含

`mogu-eureka``mogu-sms``mogu-picture``mogu-web`, `mogu-admin`
`nacos``nginx``redis``mysql``mogu-sms``mogu-picture``mogu-web`, `mogu-admin`

其它的jar都可以不启动,也不影正常使用
其它的服务都可以不启动,也不影正常使用,可以根据自身服务器配置来启动

最低配置:1核2G `需要开启虚拟内存`

Expand Down Expand Up @@ -139,7 +140,7 @@
- mogu_sms:消息服务,用于更新ElasticSearch、Solr索引、邮件和短信发送
- mogu_monitor:监控服务,集成SpringBootAdmin用于管理和监控SpringBoot应用程序
- mogu_spider:爬虫服务`(目前还未完善)`
- mogu_spider:网关服务`(目前还未完善)`
- mogu_gateway:网关服务`(目前还未完善)`
- mogu_zipkin:链路追踪服务,`目前使用java -jar的方式启动`
- mogu_search:搜索服务,ElasticSearch和Solr作为全文检索工具,[支持可插拔配置](http://moguit.cn/#/info?blogUid=4042b4f4088e4e37e95d9fc75d97298b),默认使用SQL搜索
- mogu_commons:公共模块,主要用于存放Entity实体类、Feign远程调用接口、以及公共config配置
Expand Down Expand Up @@ -219,7 +220,7 @@

### Docker搭建蘑菇博客

参考 [使用Docker快速搭建蘑菇博客](http://www.moguit.cn/#/info?blogUid=ab8377106a0d4b9f8d66131e4312c69e)能够快速在服务器中,搭建好博客系统
参考 [使用Docker快速搭建蘑菇博客](http://www.moguit.cn/#/info?blogUid=ab8377106a0d4b9f8d66131e4312c69e)能够快速在Linux服务器中,搭建好博客系统

### 蘑菇博客部署到云服务器

Expand All @@ -241,6 +242,18 @@

参考[使用Zipkin搭建蘑菇博客链路追踪](http://moguit.cn/#/info?blogUid=35bd93cabc08611c7f74ce4564753ef9),通过聚合各业务系统调用延迟数据,达到链路调用监控跟踪,快速定位其中延迟高的服务

### 使用Sentinel搭建蘑菇博客流量控制

参考[蘑菇博客Nacos部署指南](http://www.moguit.cn/#/info?blogUid=8dc52bd61e36fa56cfc7699815375572),搭建蘑菇博客的服务注册和配置中心

### 使用Sentinel搭建蘑菇博客流量控制

参考[蘑菇博客Sentinel安装指南](http://www.moguit.cn/#/info?blogUid=7135efc7f536769efd0d0483c687ba07),Sentinel被称为分布式系统的流量防卫兵,相当于Hystrix

### 蘑菇博客小程序发布

参考[蘑菇博客QQ小程序发布指南](http://www.moguit.cn/#/info?blogUid=80d3eae77c16cea10e119b9f1a1da4c8),完成蘑菇博客uniapp移动端的启动和发布

### 蘑菇博客扩展新的功能和页面

参考[蘑菇博客如何扩展新的功能和页面](http://moguit.cn/#/info?blogUid=4eb7694c58cf8205885b1e8565b1a94e),在蘑菇博客现有架构基础上,开发自己需要的页面。
Expand Down Expand Up @@ -317,7 +330,7 @@
- [x] 资源管理页面集成网盘管理
- [x] 新建Nacos分支,用于替换Eureka作为服务发现组件和配置中心
- [x] 使用Sentinel做服务限流和熔断
- [x] 增加 蘑菇博客小程序项目 uniapp_mogu_web,基于[ColorUI](https://github.com/weilanwl/ColorUI)[Uniapp](https://uniapp.dcloud.io/)
- [x] 增加蘑菇博客小程序项目 uniapp_mogu_web,基于[ColorUI](https://github.com/weilanwl/ColorUI)[Uniapp](https://uniapp.dcloud.io/)
- [ ] 完善网盘管理
- [ ] 增加更新记录
- [ ] 完善爬虫模块
Expand Down
Binary file modified doc/images/gitee/server.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 5 additions & 8 deletions uniapp_mogu_web/config/config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
export const appConfig = {
wx: {
appid: 'wx1492e33a9a6b64a3'
},


tokenKey: 'Authorization',

// 开发环境
// WEB_API: 'http://localhost:8603',
// PICTURE_API: 'http://localhost:8602',
WEB_API: 'http://localhost:8603',
PICTURE_API: 'http://localhost:8602',

// 演示环境
// WEB_API: 'http://120.78.126.96:8603',
// PICTURE_API: 'http://120.78.126.96:8602',

// 正式环境
WEB_API: 'https://apiweb.moguit.cn',
PICTURE_API: 'https://apipicture.moguit.cn',
//WEB_API: 'https://apiweb.moguit.cn',
//PICTURE_API: 'https://apipicture.moguit.cn',
}
1 change: 1 addition & 0 deletions vue_mogu_admin/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import './directive'
// 添加粒子特效
import VueParticles from 'vue-particles'

// 因引入CDN加速,无需再次引入
// Vue.use(ElementUI, { locale })

import xss from 'xss'
Expand Down
10 changes: 5 additions & 5 deletions vue_mogu_admin/src/utils/commonUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { Message } from 'element-ui'

/** **********************************************************/
/**
* 全局常量
* 全局状态码
*/
const STATIC = {
const ECode = {
// 默认页大小
DEFAULT_PAGE_SIZE: 10,
SUCCESS: "success",
// 默认页码
DEFAULT_CURRENT_PAGE: 1,
ERROR: "error",
}

/** **********************************************************/
Expand Down Expand Up @@ -134,6 +134,6 @@ const FUNCTIONS = {
}

export default {
STATIC,
ECode,
FUNCTIONS
}
1 change: 1 addition & 0 deletions vue_mogu_admin/src/utils/prototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ import commonUtil from './commonUtil'
export default {
install(Vue, options) {
Vue.prototype.$commonUtil = commonUtil.FUNCTIONS
Vue.prototype.$ECode = commonUtil.ECode
}
}
6 changes: 0 additions & 6 deletions vue_mogu_admin/src/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ service.interceptors.response.use(
// /**
// * code为非20000是抛错 可结合自己业务进行修改
// */

const res = response.data
if (res.code === 'success' || res.code === 'error' || res.success) {
return response.data
Expand Down Expand Up @@ -62,27 +61,22 @@ service.interceptors.response.use(
})
return Promise.reject('error')
} else {

console.log("错误信息", res)

Message({
message: res.message,
type: 'error',
duration: 5 * 1000
})

return Promise.reject('error')
}
},
error => {
console.log('错误码', error) // for debug

Message({
message: error.message,
type: 'error',
duration: 5 * 1000
})

return Promise.reject(error)
}
)
Expand Down
12 changes: 6 additions & 6 deletions vue_mogu_admin/src/views/authority/admin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export default {
params.currentPage = this.currentPage
params.pageSize = this.pageSize
getAdminList(params).then(response => {
if(response.code == "success") {
if(response.code == this.$ECode.SUCCESS) {
this.tableData = response.data.records;
this.currentPage = response.data.current;
this.pageSize = response.data.size;
Expand All @@ -291,7 +291,7 @@ export default {
var params = {};
params.dictType = 'sys_user_sex';
getListByDictType(params).then(response => {
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
this.genderDictList = response.data.list;
// 设置默认值
if(response.data.defaultValue) {
Expand Down Expand Up @@ -375,7 +375,7 @@ export default {
let params = {}
params.uid = row.uid
restPwdAdmin(params).then(response => {
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
that.$message({
type: "success",
message: response.data
Expand Down Expand Up @@ -408,7 +408,7 @@ export default {
adminUids.push(row.uid);
params.append("adminUids", adminUids);
deleteAdmin(params).then(response => {
if(response.code == "success") {
if(response.code == this.$ECode.SUCCESS) {
this.$message({
type: "success",
message: response.data
Expand Down Expand Up @@ -442,7 +442,7 @@ export default {
if (this.isEditForm) {
editAdmin(this.form).then(response => {
console.log(response);
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
this.$message({
type: "success",
message: response.data
Expand All @@ -458,7 +458,7 @@ export default {
});
} else {
addAdmin(this.form).then(response => {
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
this.$message({
type: "success",
message: response.data
Expand Down
4 changes: 2 additions & 2 deletions vue_mogu_admin/src/views/authority/authority.vue
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export default {
if (this.isEditForm) {
editAdminRole(this.form).then(response => {
console.log(response);
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
this.$message({
type: "success",
message: response.data
Expand All @@ -317,7 +317,7 @@ export default {
} else {
addAdminRole(this.form).then(response => {
console.log(response);
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
this.$message({
type: "success",
message: response.data
Expand Down
14 changes: 7 additions & 7 deletions vue_mogu_admin/src/views/authority/button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export default {
methods: {
menuList: function() {
getAllMenu().then(response => {
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
let tableData = response.data;
let options = []
for(let a=0; a<tableData.length; a++) {
Expand Down Expand Up @@ -358,7 +358,7 @@ export default {
}
getButtonAll(params).then(response => {
console.log("getAllMenu", response);
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
this.tableData = response.data;
}
});
Expand All @@ -369,7 +369,7 @@ export default {
getDictList: function () {
var dictTypeList = ['sys_menu_level', 'sys_yes_no', 'sys_menu_type']
getListByDictTypeList(dictTypeList).then(response => {
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
var dictMap = response.data;
Expand Down Expand Up @@ -435,7 +435,7 @@ export default {
let params = {}
params.uid = row.uid
stickMenu(params).then(response => {
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
this.buttonList();
this.$message({
type: "success",
Expand Down Expand Up @@ -467,7 +467,7 @@ export default {
let params = {}
params.uid = row.uid
deleteMenu(params).then(response => {
if(response.code == "success") {
if(response.code == this.$ECode.SUCCESS) {
this.$message({
type: "success",
message: response.data
Expand Down Expand Up @@ -516,7 +516,7 @@ export default {
if (this.isEditForm) {
editMenu(this.form).then(response => {
console.log(response);
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
this.$message({
type: "success",
message: response.data
Expand All @@ -532,7 +532,7 @@ export default {
});
} else {
addMenu(this.form).then(response => {
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
this.$message({
type: "success",
message: response.data
Expand Down
14 changes: 7 additions & 7 deletions vue_mogu_admin/src/views/authority/categoryMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export default {
menuList: function() {
getAllMenu().then(response => {
console.log("getAllMenu", response);
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
this.tableData = response.data;
this.menuOptions = response.data;
}
Expand All @@ -333,7 +333,7 @@ export default {
getDictList: function () {
var dictTypeList = ['sys_menu_level', 'sys_yes_no', 'sys_jump_external']
getListByDictTypeList(dictTypeList).then(response => {
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
var dictMap = response.data;
this.menuLevelDictList = dictMap.sys_menu_level.list
this.yesNoDictList = dictMap.sys_yes_no.list
Expand Down Expand Up @@ -388,7 +388,7 @@ export default {
let params = {}
params.uid = row.uid
stickMenu(params).then(response => {
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
this.menuList();
this.$message({
type: "success",
Expand Down Expand Up @@ -420,7 +420,7 @@ export default {
let params = {}
params.uid = row.uid
deleteMenu(params).then(response => {
if(response.code == "success") {
if(response.code == this.$ECode.SUCCESS) {
this.$message({
type: "success",
message: response.data
Expand Down Expand Up @@ -451,7 +451,7 @@ export default {
params.append("pageSize", 100);
getMenuList(params).then(response => {
console.log(response);
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
this.menuOptions = response.data.data.records;
}
});
Expand All @@ -468,7 +468,7 @@ export default {
if (this.isEditForm) {
editMenu(this.form).then(response => {
console.log(response);
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
this.$message({
type: "success",
message: response.data
Expand All @@ -485,7 +485,7 @@ export default {
} else {
addMenu(this.form).then(response => {
console.log(response);
if (response.code == "success") {
if (response.code == this.$ECode.SUCCESS) {
this.$message({
type: "success",
message: response.data
Expand Down
Loading

0 comments on commit 44c809d

Please sign in to comment.