├── micro-juejin-main
├── .env
├── .env.production
├── .browserslistrc
├── src
│ ├── store
│ │ ├── modules
│ │ │ └── people
│ │ │ │ ├── mutations-type.js
│ │ │ │ ├── state.js
│ │ │ │ ├── getters.js
│ │ │ │ ├── mutations.js
│ │ │ │ ├── index.js
│ │ │ │ └── actions.js
│ │ └── index.js
│ ├── assets
│ │ └── logo.png
│ ├── apis
│ │ ├── index.js
│ │ └── people.js
│ ├── filter
│ │ └── index.js
│ ├── services
│ │ ├── README.md
│ │ └── PeopleService.js
│ ├── mixins
│ │ └── peopleMixin.js
│ ├── layouts
│ │ └── BasicLayout
│ │ │ ├── UserAvatar.vue
│ │ │ ├── BellBadge.vue
│ │ │ ├── SearchInput.vue
│ │ │ └── WriteButton.vue
│ ├── views
│ │ ├── People.vue
│ │ └── Home.vue
│ ├── shared
│ │ ├── http.js
│ │ └── registAntd.js
│ ├── main.js
│ ├── router
│ │ └── index.js
│ ├── App.vue
│ └── components
│ │ └── common
│ │ ├── Loading.vue
│ │ └── FLIPWrapper.vue
├── public
│ ├── favicon.ico
│ └── index.html
├── babel.config.js
├── .gitignore
├── .eslintrc.js
├── vue.config.proxy.js
├── README.md
├── package.json
└── nginx.conf
├── micro-juejin-boiling
├── .browserslistrc
├── src
│ ├── store
│ │ ├── modules
│ │ │ ├── people
│ │ │ │ ├── mutations-type.js
│ │ │ │ ├── state.js
│ │ │ │ ├── getters.js
│ │ │ │ ├── mutations.js
│ │ │ │ ├── index.js
│ │ │ │ └── actions.js
│ │ │ └── boiling
│ │ │ │ ├── mutations-type.js
│ │ │ │ ├── state.js
│ │ │ │ ├── getters.js
│ │ │ │ ├── mutations.js
│ │ │ │ ├── index.js
│ │ │ │ └── actions.js
│ │ └── index.js
│ ├── assets
│ │ ├── 404-5.png
│ │ ├── logo.png
│ │ └── loading-4.gif
│ ├── apis
│ │ ├── index.js
│ │ ├── people.js
│ │ └── boiling.js
│ ├── services
│ │ ├── README.md
│ │ ├── PeopleService.js
│ │ └── BoilingService.js
│ ├── mixins
│ │ └── peopleMixin.js
│ ├── public-path.js
│ ├── views
│ │ ├── People.vue
│ │ └── Boiling.vue
│ ├── layouts
│ │ └── BasicLayout.vue
│ ├── shared
│ │ ├── initLazyLoad.js
│ │ ├── http.js
│ │ ├── registAntd.js
│ │ └── util.js
│ ├── filter
│ │ └── index.js
│ ├── App.vue
│ ├── components
│ │ ├── Boiling
│ │ │ ├── BoilingMain
│ │ │ │ ├── index.vue
│ │ │ │ └── BoilingList.vue
│ │ │ ├── BoilingSider
│ │ │ │ ├── index.vue
│ │ │ │ ├── GuideCard.vue
│ │ │ │ └── UserCard.vue
│ │ │ └── NavBar.vue
│ │ ├── common
│ │ │ └── Loading.vue
│ │ └── People
│ │ │ └── PeopleList.vue
│ ├── router
│ │ └── index.js
│ └── main.js
├── public
│ ├── favicon.ico
│ └── index.html
├── babel.config.js
├── .gitignore
├── .eslintrc.js
├── vue.config.proxy.js
├── README.md
├── nginx.conf
└── package.json
├── micro-juejin-home
├── .browserslistrc
├── src
│ ├── store
│ │ ├── modules
│ │ │ ├── home
│ │ │ │ ├── mutations-type.js
│ │ │ │ ├── state.js
│ │ │ │ ├── getters.js
│ │ │ │ ├── mutations.js
│ │ │ │ ├── index.js
│ │ │ │ └── actions.js
│ │ │ └── people
│ │ │ │ ├── mutations-type.js
│ │ │ │ ├── state.js
│ │ │ │ ├── getters.js
│ │ │ │ ├── mutations.js
│ │ │ │ ├── index.js
│ │ │ │ └── actions.js
│ │ └── index.js
│ ├── assets
│ │ ├── 404-5.png
│ │ ├── logo.png
│ │ └── loading-4.gif
│ ├── layouts
│ │ └── BasicLayout.vue
│ ├── apis
│ │ ├── index.js
│ │ ├── people.js
│ │ └── home.js
│ ├── filter
│ │ └── index.js
│ ├── services
│ │ ├── README.md
│ │ ├── PeopleService.js
│ │ └── HomeService.js
│ ├── mixins
│ │ └── peopleMixin.js
│ ├── public-path.js
│ ├── shared
│ │ ├── variables.scss
│ │ ├── initLazyLoad.js
│ │ ├── http.js
│ │ ├── registAntd.js
│ │ └── util.js
│ ├── views
│ │ ├── People.vue
│ │ └── Home.vue
│ ├── components
│ │ ├── Home
│ │ │ ├── HomeSider
│ │ │ │ ├── ADCard.vue
│ │ │ │ ├── DownloadCard.vue
│ │ │ │ ├── LinkList.vue
│ │ │ │ ├── index.vue
│ │ │ │ └── MoreBlock.vue
│ │ │ └── HomeMain
│ │ │ │ ├── index.vue
│ │ │ │ ├── NavTabs.vue
│ │ │ │ └── ArticleList.vue
│ │ ├── common
│ │ │ ├── Loading.vue
│ │ │ └── FLIPWrapper.vue
│ │ └── People
│ │ │ └── PeopleList.vue
│ ├── router
│ │ └── index.js
│ ├── App.vue
│ └── main.js
├── public
│ ├── favicon.ico
│ └── index.html
├── babel.config.js
├── .gitignore
├── vue.config.proxy.js
├── .eslintrc.js
├── README.md
├── nginx.conf
└── package.json
├── micro-juejin-topic
├── .browserslistrc
├── babel.config.js
├── src
│ ├── store
│ │ ├── modules
│ │ │ └── people
│ │ │ │ ├── mutations-type.js
│ │ │ │ ├── state.js
│ │ │ │ ├── getters.js
│ │ │ │ ├── mutations.js
│ │ │ │ ├── index.js
│ │ │ │ └── actions.js
│ │ └── index.js
│ ├── assets
│ │ ├── 404-5.png
│ │ ├── logo.png
│ │ └── loading-4.gif
│ ├── apis
│ │ ├── index.js
│ │ └── topic.js
│ ├── layouts
│ │ └── BasicLayout.vue
│ ├── filter
│ │ └── index.js
│ ├── services
│ │ ├── README.md
│ │ └── PeopleService.js
│ ├── mixins
│ │ └── peopleMixin.js
│ ├── public-path.js
│ ├── shared
│ │ ├── initLazyLoad.js
│ │ ├── http.js
│ │ └── util.js
│ ├── router
│ │ └── index.js
│ ├── views
│ │ └── Topic.vue
│ ├── App.vue
│ ├── components
│ │ ├── Topic
│ │ │ ├── TopicList.vue
│ │ │ └── TopicCard.vue
│ │ └── common
│ │ │ └── Loading.vue
│ └── main.js
├── public
│ ├── favicon.ico
│ └── index.html
├── .gitignore
├── vue.config.proxy.js
├── .eslintrc.js
├── README.md
├── package.json
└── nginx.conf
├── micro-juejin-tryVite
├── .gitignore
├── public
│ └── favicon.ico
├── src
│ ├── assets
│ │ └── logo.png
│ ├── App.vue
│ ├── composables
│ │ └── usePeopleList.js
│ ├── index.css
│ ├── components
│ │ ├── Loading.vue
│ │ └── HelloWorld.vue
│ └── main.js
├── package.json
├── index.html
├── vite.config.js
└── nginx.conf
├── micro-juejin-activity
├── .browserslistrc
├── public
│ ├── favicon.ico
│ └── index.html
├── src
│ ├── assets
│ │ ├── logo.png
│ │ ├── 404-5.png
│ │ └── loading-4.gif
│ ├── layouts
│ │ └── BasicLayout.vue
│ ├── apis
│ │ ├── index.js
│ │ └── activity.js
│ ├── store
│ │ ├── modules
│ │ │ └── activity
│ │ │ │ ├── state.js
│ │ │ │ ├── mutations-type.js
│ │ │ │ ├── getters.js
│ │ │ │ ├── index.js
│ │ │ │ ├── mutations.js
│ │ │ │ └── actions.js
│ │ └── index.js
│ ├── services
│ │ ├── README.md
│ │ └── ActivityService.js
│ ├── mixins
│ │ └── peopleMixin.js
│ ├── public-path.js
│ ├── filter
│ │ └── index.js
│ ├── shared
│ │ ├── initLazyLoad.js
│ │ ├── http.js
│ │ ├── registAntd.js
│ │ └── util.js
│ ├── router
│ │ └── index.js
│ ├── App.vue
│ ├── components
│ │ ├── common
│ │ │ └── Loading.vue
│ │ └── Activity
│ │ │ ├── ActivityList.vue
│ │ │ └── ADCarousel.vue
│ ├── main.js
│ └── views
│ │ └── Activity.vue
├── babel.config.js
├── .gitignore
├── vue.config.proxy.js
├── .eslintrc.js
├── README.md
├── nginx.conf
└── package.json
├── micro-juejin-brochure
├── .browserslistrc
├── babel.config.js
├── src
│ ├── store
│ │ ├── modules
│ │ │ ├── people
│ │ │ │ ├── mutations-type.js
│ │ │ │ ├── state.js
│ │ │ │ ├── getters.js
│ │ │ │ ├── mutations.js
│ │ │ │ ├── index.js
│ │ │ │ └── actions.js
│ │ │ └── brochure
│ │ │ │ ├── mutations-type.js
│ │ │ │ ├── state.js
│ │ │ │ ├── getters.js
│ │ │ │ ├── mutations.js
│ │ │ │ ├── index.js
│ │ │ │ └── actions.js
│ │ └── index.js
│ ├── assets
│ │ ├── logo.png
│ │ ├── 404-5.png
│ │ └── loading-4.gif
│ ├── apis
│ │ ├── index.js
│ │ └── brochure.js
│ ├── layouts
│ │ └── BasicLayout.vue
│ ├── filter
│ │ └── index.js
│ ├── services
│ │ ├── README.md
│ │ └── BrochureService.js
│ ├── mixins
│ │ └── peopleMixin.js
│ ├── public-path.js
│ ├── shared
│ │ ├── initLazyLoad.js
│ │ ├── http.js
│ │ └── util.js
│ ├── router
│ │ └── index.js
│ ├── App.vue
│ ├── components
│ │ ├── common
│ │ │ └── Loading.vue
│ │ └── Brochure
│ │ │ └── BrochureList.vue
│ ├── main.js
│ └── views
│ │ └── Brochure.vue
├── public
│ ├── favicon.ico
│ └── index.html
├── .gitignore
├── vue.config.proxy.js
├── .eslintrc.js
├── README.md
├── package.json
└── nginx.conf
├── yarn.lock
├── micro-juejin-server
├── README.md
├── .gitignore
├── package.json
├── src
│ └── routers
│ │ ├── topic.js
│ │ ├── boiling.js
│ │ ├── index.js
│ │ ├── brochure.js
│ │ ├── people.js
│ │ └── activity.js
└── app.js
├── .gitignore
└── README.md
/micro-juejin-main/.env:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/micro-juejin-main/.env.production:
--------------------------------------------------------------------------------
1 | VUE_APP_BACKEND=www.channing-bbs.club
--------------------------------------------------------------------------------
/micro-juejin-boiling/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 | not dead
4 |
--------------------------------------------------------------------------------
/micro-juejin-home/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 | not dead
4 |
--------------------------------------------------------------------------------
/micro-juejin-main/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 | not dead
4 |
--------------------------------------------------------------------------------
/micro-juejin-topic/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 | not dead
4 |
--------------------------------------------------------------------------------
/micro-juejin-tryVite/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 | dist
4 | *.local
--------------------------------------------------------------------------------
/micro-juejin-activity/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 | not dead
4 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 | not dead
4 |
--------------------------------------------------------------------------------
/micro-juejin-topic/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ["@vue/cli-plugin-babel/preset"]
3 | };
4 |
--------------------------------------------------------------------------------
/yarn.lock:
--------------------------------------------------------------------------------
1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2 | # yarn lockfile v1
3 |
4 |
5 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/store/modules/people/mutations-type.js:
--------------------------------------------------------------------------------
1 | export const SET_PEOPLE_LIST = "SET_PEOPLE_LIST";
2 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ["@vue/cli-plugin-babel/preset"]
3 | };
4 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/store/modules/people/mutations-type.js:
--------------------------------------------------------------------------------
1 | export const SET_PEOPLE_LIST = "SET_PEOPLE_LIST";
2 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/store/modules/home/mutations-type.js:
--------------------------------------------------------------------------------
1 | export const SET_ARTICLE_LIST = "SET_ARTICLE_LIST";
2 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/store/modules/people/mutations-type.js:
--------------------------------------------------------------------------------
1 | export const SET_PEOPLE_LIST = "SET_PEOPLE_LIST";
2 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/store/modules/people/mutations-type.js:
--------------------------------------------------------------------------------
1 | export const SET_PEOPLE_LIST = "SET_PEOPLE_LIST";
2 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/store/modules/people/mutations-type.js:
--------------------------------------------------------------------------------
1 | export const SET_PEOPLE_LIST = "SET_PEOPLE_LIST";
2 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/store/modules/boiling/mutations-type.js:
--------------------------------------------------------------------------------
1 | export const SET_BOILING_LIST = "SET_BOILING_LIST";
2 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/store/modules/brochure/mutations-type.js:
--------------------------------------------------------------------------------
1 | export const SET_BROCHURE_LIST = "SET_BROCHURE_LIST";
2 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/store/modules/people/state.js:
--------------------------------------------------------------------------------
1 | const state = {
2 | peopleList: []
3 | };
4 |
5 | export default state;
6 |
--------------------------------------------------------------------------------
/micro-juejin-home/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-home/public/favicon.ico
--------------------------------------------------------------------------------
/micro-juejin-home/src/store/modules/home/state.js:
--------------------------------------------------------------------------------
1 | const state = {
2 | articleList: []
3 | };
4 |
5 | export default state;
6 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/store/modules/people/state.js:
--------------------------------------------------------------------------------
1 | const state = {
2 | peopleList: []
3 | };
4 |
5 | export default state;
6 |
--------------------------------------------------------------------------------
/micro-juejin-main/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-main/public/favicon.ico
--------------------------------------------------------------------------------
/micro-juejin-main/src/store/modules/people/state.js:
--------------------------------------------------------------------------------
1 | const state = {
2 | peopleList: []
3 | };
4 |
5 | export default state;
6 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/store/modules/people/state.js:
--------------------------------------------------------------------------------
1 | const state = {
2 | peopleList: []
3 | };
4 |
5 | export default state;
6 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-boiling/public/favicon.ico
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/store/modules/boiling/state.js:
--------------------------------------------------------------------------------
1 | const state = {
2 | boilingList: []
3 | };
4 |
5 | export default state;
6 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/store/modules/people/state.js:
--------------------------------------------------------------------------------
1 | const state = {
2 | peopleList: []
3 | };
4 |
5 | export default state;
6 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/assets/404-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-home/src/assets/404-5.png
--------------------------------------------------------------------------------
/micro-juejin-home/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-home/src/assets/logo.png
--------------------------------------------------------------------------------
/micro-juejin-main/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-main/src/assets/logo.png
--------------------------------------------------------------------------------
/micro-juejin-topic/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-topic/public/favicon.ico
--------------------------------------------------------------------------------
/micro-juejin-topic/src/assets/404-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-topic/src/assets/404-5.png
--------------------------------------------------------------------------------
/micro-juejin-topic/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-topic/src/assets/logo.png
--------------------------------------------------------------------------------
/micro-juejin-tryVite/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-tryVite/public/favicon.ico
--------------------------------------------------------------------------------
/micro-juejin-activity/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-activity/public/favicon.ico
--------------------------------------------------------------------------------
/micro-juejin-activity/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-activity/src/assets/logo.png
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/assets/404-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-boiling/src/assets/404-5.png
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-boiling/src/assets/logo.png
--------------------------------------------------------------------------------
/micro-juejin-brochure/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-brochure/public/favicon.ico
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-brochure/src/assets/logo.png
--------------------------------------------------------------------------------
/micro-juejin-main/src/apis/index.js:
--------------------------------------------------------------------------------
1 | import people from "./people";
2 |
3 | const API = {
4 | people
5 | };
6 |
7 | export default API;
8 |
--------------------------------------------------------------------------------
/micro-juejin-tryVite/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-tryVite/src/assets/logo.png
--------------------------------------------------------------------------------
/micro-juejin-activity/src/assets/404-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-activity/src/assets/404-5.png
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/assets/404-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-brochure/src/assets/404-5.png
--------------------------------------------------------------------------------
/micro-juejin-home/src/assets/loading-4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-home/src/assets/loading-4.gif
--------------------------------------------------------------------------------
/micro-juejin-home/src/layouts/BasicLayout.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/apis/index.js:
--------------------------------------------------------------------------------
1 | import topic from "@/apis/topic";
2 |
3 | const API = {
4 | topic
5 | };
6 |
7 | export default API;
8 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/assets/loading-4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-topic/src/assets/loading-4.gif
--------------------------------------------------------------------------------
/micro-juejin-activity/src/assets/loading-4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-activity/src/assets/loading-4.gif
--------------------------------------------------------------------------------
/micro-juejin-activity/src/layouts/BasicLayout.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/assets/loading-4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-boiling/src/assets/loading-4.gif
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/apis/index.js:
--------------------------------------------------------------------------------
1 | import brochure from "./brochure";
2 |
3 | const API = {
4 | brochure
5 | };
6 |
7 | export default API;
8 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/assets/loading-4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ChanningHan/micro-juejin/HEAD/micro-juejin-brochure/src/assets/loading-4.gif
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/layouts/BasicLayout.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/layouts/BasicLayout.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/apis/index.js:
--------------------------------------------------------------------------------
1 | import activity from "@/apis/activity";
2 |
3 | const API = {
4 | activity
5 | };
6 |
7 | export default API;
8 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/store/modules/activity/state.js:
--------------------------------------------------------------------------------
1 | const state = {
2 | bannerList: [],
3 | activityList: []
4 | };
5 |
6 | export default state;
7 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/store/modules/brochure/state.js:
--------------------------------------------------------------------------------
1 | const state = {
2 | brochureList: [],
3 | isOver: false
4 | };
5 |
6 | export default state;
7 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/store/modules/activity/mutations-type.js:
--------------------------------------------------------------------------------
1 | export const SET_ACTIVITY_LIST = "SET_ACTIVITY_LIST";
2 | export const SET_BANNER_LIST = "SET_BANNER_LIST";
3 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/store/modules/home/getters.js:
--------------------------------------------------------------------------------
1 | const getters = {
2 | articleList(state) {
3 | return state.articleList;
4 | }
5 | };
6 |
7 | export default getters;
8 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/store/modules/people/getters.js:
--------------------------------------------------------------------------------
1 | const getters = {
2 | peopleList(state) {
3 | return state.peopleList;
4 | }
5 | };
6 |
7 | export default getters;
8 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/store/modules/people/getters.js:
--------------------------------------------------------------------------------
1 | const getters = {
2 | peopleList(state) {
3 | return state.peopleList;
4 | }
5 | };
6 |
7 | export default getters;
8 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/store/modules/people/getters.js:
--------------------------------------------------------------------------------
1 | const getters = {
2 | peopleList(state) {
3 | return state.peopleList;
4 | }
5 | };
6 |
7 | export default getters;
8 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/store/modules/boiling/getters.js:
--------------------------------------------------------------------------------
1 | const getters = {
2 | boilingList(state) {
3 | return state.boilingList;
4 | }
5 | };
6 |
7 | export default getters;
8 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/store/modules/people/getters.js:
--------------------------------------------------------------------------------
1 | const getters = {
2 | peopleList(state) {
3 | return state.peopleList;
4 | }
5 | };
6 |
7 | export default getters;
8 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/store/modules/people/getters.js:
--------------------------------------------------------------------------------
1 | const getters = {
2 | peopleList(state) {
3 | return state.peopleList;
4 | }
5 | };
6 |
7 | export default getters;
8 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/apis/index.js:
--------------------------------------------------------------------------------
1 | import people from "./people";
2 | import home from "./home";
3 |
4 | const API = {
5 | people,
6 | home
7 | };
8 |
9 | export default API;
10 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/apis/topic.js:
--------------------------------------------------------------------------------
1 | import http from "@/shared/http";
2 |
3 | const topic = {
4 | // 获取话题列表
5 | getTopicList: () => http.get("/topic/list")
6 | };
7 |
8 | export default topic;
9 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/apis/people.js:
--------------------------------------------------------------------------------
1 | import http from "@/shared/http";
2 |
3 | const people = {
4 | // 获取人员列表
5 | getPeopleList: () => http.get("/people/list")
6 | };
7 |
8 | export default people;
9 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/apis/people.js:
--------------------------------------------------------------------------------
1 | import http from "@/shared/http";
2 |
3 | const people = {
4 | // 获取人员列表
5 | getPeopleList: () => http.get("/people/list")
6 | };
7 |
8 | export default people;
9 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/apis/index.js:
--------------------------------------------------------------------------------
1 | import people from "./people";
2 | import boiling from "@/apis/boiling";
3 |
4 | const API = {
5 | people,
6 | boiling
7 | };
8 |
9 | export default API;
10 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/apis/people.js:
--------------------------------------------------------------------------------
1 | import http from "@/shared/http";
2 |
3 | const people = {
4 | // 获取人员列表
5 | getPeopleList: () => http.get("/people/list")
6 | };
7 |
8 | export default people;
9 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/filter/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import moment from "moment";
3 |
4 | Vue.filter("formatDate", (val, formatStr) => {
5 | return val ? moment(val).format(formatStr) : "--";
6 | });
7 |
--------------------------------------------------------------------------------
/micro-juejin-server/README.md:
--------------------------------------------------------------------------------
1 | # mock-server
2 |
3 | ## Project setup
4 | ```
5 | yarn install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | yarn start
11 | ```
12 |
13 |
14 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/filter/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import moment from "moment";
3 |
4 | Vue.filter("formatDate", (val, formatStr) => {
5 | return val ? moment(new Date(val)).format(formatStr) : "--";
6 | });
7 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/filter/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import moment from "moment";
3 |
4 | Vue.filter("formatDate", (val, formatStr) => {
5 | return val ? moment(new Date(val)).format(formatStr) : "--";
6 | });
7 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/filter/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import moment from "moment";
3 |
4 | Vue.filter("formatDate", (val, formatStr) => {
5 | return val ? moment(new Date(val)).format(formatStr) : "--";
6 | });
7 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/store/modules/brochure/getters.js:
--------------------------------------------------------------------------------
1 | const getters = {
2 | brochureList(state) {
3 | return state.brochureList;
4 | },
5 | isOver(state) {
6 | return state.isOver;
7 | }
8 | };
9 |
10 | export default getters;
11 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/services/README.md:
--------------------------------------------------------------------------------
1 | #service
2 |
3 | 之所以有这个文件夹是因为想要将接口数据获取的逻辑处理尽可能抽离出来,而apis目录则更像是对API接口的声明与展示如何调用接口,对接口数据的处理则放至services中进行。
4 |
5 | 在页面组件调用中就像只需要说出要进行什么操作,而具体的数据处理操作应该抽离到services中或store的actions中(包括对页面组件中期望的数据结构进行组合或是重装),组件层面只需要关心页面相关的数据如何调用。
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/services/README.md:
--------------------------------------------------------------------------------
1 | #service
2 |
3 | 之所以有这个文件夹是因为想要将接口数据获取的逻辑处理尽可能抽离出来,而apis目录则更像是对API接口的声明与展示如何调用接口,对接口数据的处理则放至services中进行。
4 |
5 | 在页面组件调用中就像只需要说出要进行什么操作,而具体的数据处理操作应该抽离到services中或store的actions中(包括对页面组件中期望的数据结构进行组合或是重装),组件层面只需要关心页面相关的数据如何调用。
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/services/README.md:
--------------------------------------------------------------------------------
1 | #service
2 |
3 | 之所以有这个文件夹是因为想要将接口数据获取的逻辑处理尽可能抽离出来,而apis目录则更像是对API接口的声明与展示如何调用接口,对接口数据的处理则放至services中进行。
4 |
5 | 在页面组件调用中就像只需要说出要进行什么操作,而具体的数据处理操作应该抽离到services中或store的actions中(包括对页面组件中期望的数据结构进行组合或是重装),组件层面只需要关心页面相关的数据如何调用。
--------------------------------------------------------------------------------
/micro-juejin-home/src/services/README.md:
--------------------------------------------------------------------------------
1 | #service
2 |
3 | 之所以有这个文件夹是因为想要将接口数据获取的逻辑处理尽可能抽离出来,而apis目录则更像是对API接口的声明与展示如何调用接口,对接口数据的处理则放至services中进行。
4 |
5 | 在页面组件调用中就像只需要说出要进行什么操作,而具体的数据处理操作应该抽离到services中或store的actions中(包括对页面组件中期望的数据结构进行组合或是重装),组件层面只需要关心页面相关的数据如何调用。
--------------------------------------------------------------------------------
/micro-juejin-main/src/services/README.md:
--------------------------------------------------------------------------------
1 | #service
2 |
3 | 之所以有这个文件夹是因为想要将接口数据获取的逻辑处理尽可能抽离出来,而apis目录则更像是对API接口的声明与展示如何调用接口,对接口数据的处理则放至services中进行。
4 |
5 | 在页面组件调用中就像只需要说出要进行什么操作,而具体的数据处理操作应该抽离到services中或store的actions中(包括对页面组件中期望的数据结构进行组合或是重装),组件层面只需要关心页面相关的数据如何调用。
--------------------------------------------------------------------------------
/micro-juejin-topic/src/services/README.md:
--------------------------------------------------------------------------------
1 | #service
2 |
3 | 之所以有这个文件夹是因为想要将接口数据获取的逻辑处理尽可能抽离出来,而apis目录则更像是对API接口的声明与展示如何调用接口,对接口数据的处理则放至services中进行。
4 |
5 | 在页面组件调用中就像只需要说出要进行什么操作,而具体的数据处理操作应该抽离到services中或store的actions中(包括对页面组件中期望的数据结构进行组合或是重装),组件层面只需要关心页面相关的数据如何调用。
--------------------------------------------------------------------------------
/micro-juejin-activity/src/store/modules/activity/getters.js:
--------------------------------------------------------------------------------
1 | const getters = {
2 | bannerList(state) {
3 | return state.bannerList;
4 | },
5 | activityList(state) {
6 | return state.activityList;
7 | }
8 | };
9 |
10 | export default getters;
11 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/mixins/peopleMixin.js:
--------------------------------------------------------------------------------
1 | const peopleMixin = {
2 | created() {
3 | this.hello();
4 | },
5 | methods: {
6 | hello() {
7 | console.log("hello from mixin");
8 | }
9 | }
10 | };
11 |
12 | export default peopleMixin;
13 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/mixins/peopleMixin.js:
--------------------------------------------------------------------------------
1 | const peopleMixin = {
2 | created() {
3 | this.hello();
4 | },
5 | methods: {
6 | hello() {
7 | console.log("hello from mixin");
8 | }
9 | }
10 | };
11 |
12 | export default peopleMixin;
13 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/mixins/peopleMixin.js:
--------------------------------------------------------------------------------
1 | const peopleMixin = {
2 | created() {
3 | this.hello();
4 | },
5 | methods: {
6 | hello() {
7 | console.log("hello from mixin");
8 | }
9 | }
10 | };
11 |
12 | export default peopleMixin;
13 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/mixins/peopleMixin.js:
--------------------------------------------------------------------------------
1 | const peopleMixin = {
2 | created() {
3 | this.hello();
4 | },
5 | methods: {
6 | hello() {
7 | console.log("hello from mixin");
8 | }
9 | }
10 | };
11 |
12 | export default peopleMixin;
13 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/mixins/peopleMixin.js:
--------------------------------------------------------------------------------
1 | const peopleMixin = {
2 | created() {
3 | this.hello();
4 | },
5 | methods: {
6 | hello() {
7 | console.log("hello from mixin");
8 | }
9 | }
10 | };
11 |
12 | export default peopleMixin;
13 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/mixins/peopleMixin.js:
--------------------------------------------------------------------------------
1 | const peopleMixin = {
2 | created() {
3 | this.hello();
4 | },
5 | methods: {
6 | hello() {
7 | console.log("hello from mixin");
8 | }
9 | }
10 | };
11 |
12 | export default peopleMixin;
13 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/apis/home.js:
--------------------------------------------------------------------------------
1 | import http from "@/shared/http";
2 |
3 | const home = {
4 | // 获取文章列表
5 | getArticleList: (limit, cursor) =>
6 | http.get(`/home/articleList?limit=${limit || 15}&cursor=${cursor}`)
7 | };
8 |
9 | export default home;
10 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/apis/brochure.js:
--------------------------------------------------------------------------------
1 | import http from "@/shared/http";
2 |
3 | const brochure = {
4 | // 获取小册列表
5 | getBrochureList: (limit, cursor) =>
6 | http.get(`/brochure/list?limit=${limit}&cursor=${cursor}`)
7 | };
8 |
9 | export default brochure;
10 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/apis/boiling.js:
--------------------------------------------------------------------------------
1 | import http from "@/shared/http";
2 |
3 | const boiling = {
4 | // 获取沸点列表
5 | getBoilingList: (limit, cursor) =>
6 | http.get(`/boiling/boilingList?limit=${limit || 15}&cursor=${cursor}`)
7 | };
8 |
9 | export default boiling;
10 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/public-path.js:
--------------------------------------------------------------------------------
1 | if (window.__POWERED_BY_QIANKUN__) {
2 | /*
3 | * __ INJECTED_PUBLIC_PATH_BY_QIANKUN __是由qiankun在主应用中加载微应用时注入的。
4 | *
5 | * */
6 | // eslint-disable-next-line no-undef
7 | __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
8 | }
9 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/shared/variables.scss:
--------------------------------------------------------------------------------
1 | $defaultSize: 12px !default;
2 | @function rem($px){
3 | @return $px / $defaultSize * 1rem;
4 | }
5 |
6 | $primaryColor: #007fff;
7 | $info-color: #70b4f9;
8 | $success-color: #1ed278;
9 | $warn-color: #ffa100;
10 | $danger-color: #ed6114;
11 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/public-path.js:
--------------------------------------------------------------------------------
1 | if (window.__POWERED_BY_QIANKUN__) {
2 | /*
3 | * __ INJECTED_PUBLIC_PATH_BY_QIANKUN __是由qiankun在主应用中加载微应用时注入的。
4 | *
5 | * */
6 | // eslint-disable-next-line no-undef
7 | __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
8 | }
9 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/public-path.js:
--------------------------------------------------------------------------------
1 | if (window.__POWERED_BY_QIANKUN__) {
2 | /*
3 | * __ INJECTED_PUBLIC_PATH_BY_QIANKUN __是由qiankun在主应用中加载微应用时注入的。
4 | *
5 | * */
6 | // eslint-disable-next-line no-undef
7 | __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
8 | }
9 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/public-path.js:
--------------------------------------------------------------------------------
1 | if (window.__POWERED_BY_QIANKUN__) {
2 | /*
3 | * __ INJECTED_PUBLIC_PATH_BY_QIANKUN __是由qiankun在主应用中加载微应用时注入的。
4 | *
5 | * */
6 | // eslint-disable-next-line no-undef
7 | __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
8 | }
9 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/public-path.js:
--------------------------------------------------------------------------------
1 | if (window.__POWERED_BY_QIANKUN__) {
2 | /*
3 | * __ INJECTED_PUBLIC_PATH_BY_QIANKUN __是由qiankun在主应用中加载微应用时注入的。
4 | *
5 | * */
6 | // eslint-disable-next-line no-undef
7 | __webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
8 | }
9 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/store/modules/people/mutations.js:
--------------------------------------------------------------------------------
1 | import { SET_PEOPLE_LIST } from "@/store/modules/people/mutations-type";
2 |
3 | const mutations = {
4 | [SET_PEOPLE_LIST]: (state, peopleList) => {
5 | state.peopleList = peopleList;
6 | }
7 | };
8 |
9 | export default mutations;
10 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/store/modules/people/mutations.js:
--------------------------------------------------------------------------------
1 | import { SET_PEOPLE_LIST } from "@/store/modules/people/mutations-type";
2 |
3 | const mutations = {
4 | [SET_PEOPLE_LIST]: (state, peopleList) => {
5 | state.peopleList = peopleList;
6 | }
7 | };
8 |
9 | export default mutations;
10 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/store/modules/people/mutations.js:
--------------------------------------------------------------------------------
1 | import { SET_PEOPLE_LIST } from "@/store/modules/people/mutations-type";
2 |
3 | const mutations = {
4 | [SET_PEOPLE_LIST]: (state, peopleList) => {
5 | state.peopleList = peopleList;
6 | }
7 | };
8 |
9 | export default mutations;
10 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/store/modules/people/mutations.js:
--------------------------------------------------------------------------------
1 | import { SET_PEOPLE_LIST } from "@/store/modules/people/mutations-type";
2 |
3 | const mutations = {
4 | [SET_PEOPLE_LIST]: (state, peopleList) => {
5 | state.peopleList = peopleList;
6 | }
7 | };
8 |
9 | export default mutations;
10 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/store/modules/people/mutations.js:
--------------------------------------------------------------------------------
1 | import { SET_PEOPLE_LIST } from "@/store/modules/people/mutations-type";
2 |
3 | const mutations = {
4 | [SET_PEOPLE_LIST]: (state, peopleList) => {
5 | state.peopleList = peopleList;
6 | }
7 | };
8 |
9 | export default mutations;
10 |
--------------------------------------------------------------------------------
/micro-juejin-home/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ["@vue/cli-plugin-babel/preset"],
3 | plugins: [
4 | [
5 | "import",
6 | {
7 | libraryName: "ant-design-vue",
8 | libraryDirectory: "es",
9 | style: true
10 | }
11 | ]
12 | ]
13 | };
14 |
--------------------------------------------------------------------------------
/micro-juejin-main/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ["@vue/cli-plugin-babel/preset"],
3 | plugins: [
4 | [
5 | "import",
6 | {
7 | libraryName: "ant-design-vue",
8 | libraryDirectory: "es",
9 | style: true
10 | }
11 | ]
12 | ]
13 | };
14 |
--------------------------------------------------------------------------------
/micro-juejin-activity/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ["@vue/cli-plugin-babel/preset"],
3 | plugins: [
4 | [
5 | "import",
6 | {
7 | libraryName: "ant-design-vue",
8 | libraryDirectory: "es",
9 | style: true
10 | }
11 | ]
12 | ]
13 | };
14 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ["@vue/cli-plugin-babel/preset"],
3 | plugins: [
4 | [
5 | "import",
6 | {
7 | libraryName: "ant-design-vue",
8 | libraryDirectory: "es",
9 | style: true
10 | }
11 | ]
12 | ]
13 | };
14 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/layouts/BasicLayout/UserAvatar.vue:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import Vuex from "vuex";
3 |
4 | import peopleStore from "@/store/modules/people";
5 |
6 | Vue.use(Vuex);
7 |
8 | export default new Vuex.Store({
9 | state: {},
10 | mutations: {},
11 | actions: {},
12 | modules: { people: peopleStore }
13 | });
14 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import Vuex from "vuex";
3 |
4 | import activityStore from "@/store/modules/activity";
5 |
6 | Vue.use(Vuex);
7 |
8 | export default new Vuex.Store({
9 | state: {},
10 | mutations: {},
11 | actions: {},
12 | modules: { activity: activityStore }
13 | });
14 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/store/modules/boiling/mutations.js:
--------------------------------------------------------------------------------
1 | import { SET_BOILING_LIST } from "@/store/modules/boiling/mutations-type";
2 |
3 | const mutations = {
4 | [SET_BOILING_LIST]: (state, boilingList) => {
5 | state.boilingList = state.boilingList.concat(boilingList);
6 | }
7 | };
8 |
9 | export default mutations;
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 |
6 | # local env files
7 | .env.local
8 | .env.*.local
9 |
10 | # Log files
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 | pnpm-debug.log*
15 |
16 | # Editor directories and files
17 | .idea
18 | .vscode
19 | *.suo
20 | *.ntvs*
21 | *.njsproj
22 | *.sln
23 | *.sw?
24 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/views/People.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
This is a people page
4 |
5 |
6 |
7 |
15 |
--------------------------------------------------------------------------------
/micro-juejin-tryVite/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
16 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 |
6 | # local env files
7 | .env.local
8 | .env.*.local
9 |
10 | # Log files
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 | pnpm-debug.log*
15 |
16 | # Editor directories and files
17 | .idea
18 | .vscode
19 | *.suo
20 | *.ntvs*
21 | *.njsproj
22 | *.sln
23 | *.sw?
24 |
--------------------------------------------------------------------------------
/micro-juejin-home/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 |
6 | # local env files
7 | .env.local
8 | .env.*.local
9 |
10 | # Log files
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 | pnpm-debug.log*
15 |
16 | # Editor directories and files
17 | .idea
18 | .vscode
19 | *.suo
20 | *.ntvs*
21 | *.njsproj
22 | *.sln
23 | *.sw?
24 |
--------------------------------------------------------------------------------
/micro-juejin-main/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 |
6 | # local env files
7 | .env.local
8 | .env.*.local
9 |
10 | # Log files
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 | pnpm-debug.log*
15 |
16 | # Editor directories and files
17 | .idea
18 | .vscode
19 | *.suo
20 | *.ntvs*
21 | *.njsproj
22 | *.sln
23 | *.sw?
24 |
--------------------------------------------------------------------------------
/micro-juejin-server/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 | # local env files
6 | .env.local
7 | .env.*.local
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 |
14 | # Editor directories and files
15 | .idea
16 | .vscode
17 | *.suo
18 | *.ntvs*
19 | *.njsproj
20 | *.sln
21 | *.sw?
22 | .history
23 | dump.rdb
24 |
--------------------------------------------------------------------------------
/micro-juejin-topic/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 |
6 | # local env files
7 | .env.local
8 | .env.*.local
9 |
10 | # Log files
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 | pnpm-debug.log*
15 |
16 | # Editor directories and files
17 | .idea
18 | .vscode
19 | *.suo
20 | *.ntvs*
21 | *.njsproj
22 | *.sln
23 | *.sw?
24 |
--------------------------------------------------------------------------------
/micro-juejin-activity/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 |
6 | # local env files
7 | .env.local
8 | .env.*.local
9 |
10 | # Log files
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 | pnpm-debug.log*
15 |
16 | # Editor directories and files
17 | .idea
18 | .vscode
19 | *.suo
20 | *.ntvs*
21 | *.njsproj
22 | *.sln
23 | *.sw?
24 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/filter/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import moment from "moment";
3 | moment.locale("zh_CN");
4 |
5 | Vue.filter("formatDate", (val, formatStr) => {
6 | return val ? moment(new Date(val)).format(formatStr) : "--";
7 | });
8 |
9 | Vue.filter("formatStartDate", val => {
10 | return moment(val * 1000).format("MM-DD ddd");
11 | });
12 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 |
6 | # local env files
7 | .env.local
8 | .env.*.local
9 |
10 | # Log files
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 | pnpm-debug.log*
15 |
16 | # Editor directories and files
17 | .idea
18 | .vscode
19 | *.suo
20 | *.ntvs*
21 | *.njsproj
22 | *.sln
23 | *.sw?
24 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/views/People.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
This is a people page
4 |
5 |
6 |
7 |
15 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import Vuex from "vuex";
3 |
4 | import peopleStore from "@/store/modules/people";
5 | import homeStore from "@/store/modules/home";
6 |
7 | Vue.use(Vuex);
8 |
9 | export default new Vuex.Store({
10 | state: {},
11 | mutations: {},
12 | actions: {},
13 | modules: { home: homeStore, people: peopleStore }
14 | });
15 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/shared/initLazyLoad.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import VueLazyload from "vue-lazyload";
3 |
4 | // eslint-disable-next-line no-unused-vars
5 | import errorPng from "../assets/404-5.png";
6 | import loading from "../assets/loading-4.gif";
7 |
8 | Vue.use(VueLazyload, {
9 | preLoad: 1.3,
10 | error: errorPng,
11 | loading: loading,
12 | attempt: 1
13 | });
14 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/layouts/BasicLayout.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
21 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/shared/initLazyLoad.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import VueLazyload from "vue-lazyload";
3 |
4 | // eslint-disable-next-line no-unused-vars
5 | import errorPng from "../assets/404-5.png";
6 | import loading from "../assets/loading-4.gif";
7 |
8 | Vue.use(VueLazyload, {
9 | preLoad: 1.3,
10 | error: errorPng,
11 | loading: loading,
12 | attempt: 1
13 | });
14 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/shared/initLazyLoad.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import VueLazyload from "vue-lazyload";
3 |
4 | // eslint-disable-next-line no-unused-vars
5 | import errorPng from "../assets/404-5.png";
6 | import loading from "../assets/loading-4.gif";
7 |
8 | Vue.use(VueLazyload, {
9 | preLoad: 1.3,
10 | error: errorPng,
11 | loading: loading,
12 | attempt: 1
13 | });
14 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/shared/initLazyLoad.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import VueLazyload from "vue-lazyload";
3 |
4 | // eslint-disable-next-line no-unused-vars
5 | import errorPng from "../assets/404-5.png";
6 | import loading from "../assets/loading-4.gif";
7 |
8 | Vue.use(VueLazyload, {
9 | preLoad: 1.3,
10 | error: errorPng,
11 | loading: loading,
12 | attempt: 1
13 | });
14 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/store/modules/home/mutations.js:
--------------------------------------------------------------------------------
1 | import { SET_ARTICLE_LIST } from "@/store/modules/home/mutations-type";
2 |
3 | const mutations = {
4 | [SET_ARTICLE_LIST]: (state, articleList) => {
5 | // state.articleList = state.articleList.concat(articleList);
6 | state.articleList = state.articleList.concat(articleList);
7 | }
8 | };
9 |
10 | export default mutations;
11 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/shared/initLazyLoad.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import VueLazyload from "vue-lazyload";
3 |
4 | // eslint-disable-next-line no-unused-vars
5 | import errorPng from "../assets/404-5.png";
6 | import loading from "../assets/loading-4.gif";
7 |
8 | Vue.use(VueLazyload, {
9 | preLoad: 1.3,
10 | error: errorPng,
11 | loading: loading,
12 | attempt: 1
13 | });
14 |
--------------------------------------------------------------------------------
/micro-juejin-tryVite/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "micro-juejin-tryVite",
3 | "version": "0.0.0",
4 | "scripts": {
5 | "dev": "vite",
6 | "build": "vite build"
7 | },
8 | "dependencies": {
9 | "axios": "^0.20.0",
10 | "vue": "^3.0.0-rc.1"
11 | },
12 | "devDependencies": {
13 | "@vue/compiler-sfc": "^3.0.0-rc.1",
14 | "vite": "^1.0.0-rc.1"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import Vuex from "vuex";
3 |
4 | import peopleStore from "@/store/modules/people";
5 | import boilingStore from "@/store/modules/boiling";
6 |
7 | Vue.use(Vuex);
8 |
9 | export default new Vuex.Store({
10 | state: {},
11 | mutations: {},
12 | actions: {},
13 | modules: { people: peopleStore, boiling: boilingStore }
14 | });
15 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import Vuex from "vuex";
3 |
4 | import peopleStore from "@/store/modules/people";
5 | import brochureStore from "@/store/modules/brochure";
6 |
7 | Vue.use(Vuex);
8 |
9 | export default new Vuex.Store({
10 | state: {},
11 | mutations: {},
12 | actions: {},
13 | modules: { people: peopleStore, brochure: brochureStore }
14 | });
15 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/views/People.vue:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
20 |
--------------------------------------------------------------------------------
/micro-juejin-home/vue.config.proxy.js:
--------------------------------------------------------------------------------
1 | const packageName = require("./package.json").name;
2 |
3 | const prefix = "/api/" + packageName;
4 | const prefixRegExp = "^" + prefix;
5 |
6 | const proxy = {
7 | [prefix]: {
8 | target: "http://localhost:3000",
9 | ws: false,
10 | changeOrigin: false,
11 | pathRewrite: {
12 | [prefixRegExp]: "/api"
13 | }
14 | }
15 | };
16 | module.exports = proxy;
17 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/store/modules/home/index.js:
--------------------------------------------------------------------------------
1 | import state from "@/store/modules/home/state";
2 | import mutations from "@/store/modules/home/mutations";
3 | import actions from "@/store/modules/home/actions";
4 | import getters from "@/store/modules/home/getters";
5 |
6 | const homeStore = {
7 | namespaced: true,
8 | state,
9 | getters,
10 | mutations,
11 | actions
12 | };
13 |
14 | export default homeStore;
15 |
--------------------------------------------------------------------------------
/micro-juejin-topic/vue.config.proxy.js:
--------------------------------------------------------------------------------
1 | const packageName = require("./package.json").name;
2 |
3 | const prefix = "/api/" + packageName;
4 | const prefixRegExp = "^" + prefix;
5 |
6 | const proxy = {
7 | [prefix]: {
8 | target: "http://192.168.2.29:3000",
9 | ws: false,
10 | changeOrigin: false,
11 | pathRewrite: {
12 | [prefixRegExp]: "/api"
13 | }
14 | }
15 | };
16 | module.exports = proxy;
17 |
--------------------------------------------------------------------------------
/micro-juejin-activity/vue.config.proxy.js:
--------------------------------------------------------------------------------
1 | const packageName = require("./package.json").name;
2 |
3 | const prefix = "/api/" + packageName;
4 | const prefixRegExp = "^" + prefix;
5 |
6 | const proxy = {
7 | [prefix]: {
8 | target: "http://192.168.2.29:3000",
9 | ws: false,
10 | changeOrigin: false,
11 | pathRewrite: {
12 | [prefixRegExp]: "/api"
13 | }
14 | }
15 | };
16 | module.exports = proxy;
17 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/store/modules/brochure/mutations.js:
--------------------------------------------------------------------------------
1 | import { SET_BROCHURE_LIST } from "@/store/modules/brochure/mutations-type";
2 |
3 | const mutations = {
4 | [SET_BROCHURE_LIST]: (state, brochureList) => {
5 | if (brochureList) {
6 | state.brochureList = state.brochureList.concat(brochureList);
7 | } else {
8 | state.isOver = true;
9 | }
10 | }
11 | };
12 |
13 | export default mutations;
14 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/vue.config.proxy.js:
--------------------------------------------------------------------------------
1 | const packageName = require("./package.json").name;
2 |
3 | const prefix = "/api/" + packageName;
4 | const prefixRegExp = "^" + prefix;
5 |
6 | const proxy = {
7 | [prefix]: {
8 | target: "http://192.168.2.29:3000",
9 | ws: false,
10 | changeOrigin: false,
11 | pathRewrite: {
12 | [prefixRegExp]: "/api"
13 | }
14 | }
15 | };
16 | module.exports = proxy;
17 |
--------------------------------------------------------------------------------
/micro-juejin-home/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | node: true
5 | },
6 | extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
7 | parserOptions: {
8 | parser: "babel-eslint"
9 | },
10 | rules: {
11 | "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
12 | "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
13 | }
14 | };
15 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/store/modules/people/index.js:
--------------------------------------------------------------------------------
1 | import state from "@/store/modules/people/state";
2 | import mutations from "@/store/modules/people/mutations";
3 | import actions from "@/store/modules/people/actions";
4 | import getters from "@/store/modules/people/getters";
5 |
6 | const peopleStore = {
7 | namespaced: true,
8 | state,
9 | getters,
10 | mutations,
11 | actions
12 | };
13 |
14 | export default peopleStore;
15 |
--------------------------------------------------------------------------------
/micro-juejin-main/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | node: true
5 | },
6 | extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
7 | parserOptions: {
8 | parser: "babel-eslint"
9 | },
10 | rules: {
11 | "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
12 | "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
13 | }
14 | };
15 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/store/modules/people/index.js:
--------------------------------------------------------------------------------
1 | import state from "@/store/modules/people/state";
2 | import mutations from "@/store/modules/people/mutations";
3 | import actions from "@/store/modules/people/actions";
4 | import getters from "@/store/modules/people/getters";
5 |
6 | const peopleStore = {
7 | namespaced: true,
8 | state,
9 | getters,
10 | mutations,
11 | actions
12 | };
13 |
14 | export default peopleStore;
15 |
--------------------------------------------------------------------------------
/micro-juejin-topic/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | node: true
5 | },
6 | extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
7 | parserOptions: {
8 | parser: "babel-eslint"
9 | },
10 | rules: {
11 | "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
12 | "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
13 | }
14 | };
15 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/store/modules/people/index.js:
--------------------------------------------------------------------------------
1 | import state from "@/store/modules/people/state";
2 | import mutations from "@/store/modules/people/mutations";
3 | import actions from "@/store/modules/people/actions";
4 | import getters from "@/store/modules/people/getters";
5 |
6 | const peopleStore = {
7 | namespaced: true,
8 | state,
9 | getters,
10 | mutations,
11 | actions
12 | };
13 |
14 | export default peopleStore;
15 |
--------------------------------------------------------------------------------
/micro-juejin-activity/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | node: true
5 | },
6 | extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
7 | parserOptions: {
8 | parser: "babel-eslint"
9 | },
10 | rules: {
11 | "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
12 | "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
13 | }
14 | };
15 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | node: true
5 | },
6 | extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
7 | parserOptions: {
8 | parser: "babel-eslint"
9 | },
10 | rules: {
11 | "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
12 | "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
13 | }
14 | };
15 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/store/modules/people/index.js:
--------------------------------------------------------------------------------
1 | import state from "@/store/modules/people/state";
2 | import mutations from "@/store/modules/people/mutations";
3 | import actions from "@/store/modules/people/actions";
4 | import getters from "@/store/modules/people/getters";
5 |
6 | const peopleStore = {
7 | namespaced: true,
8 | state,
9 | getters,
10 | mutations,
11 | actions
12 | };
13 |
14 | export default peopleStore;
15 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | node: true
5 | },
6 | extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
7 | parserOptions: {
8 | parser: "babel-eslint"
9 | },
10 | rules: {
11 | "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
12 | "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off"
13 | }
14 | };
15 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/store/modules/people/index.js:
--------------------------------------------------------------------------------
1 | import state from "@/store/modules/people/state";
2 | import mutations from "@/store/modules/people/mutations";
3 | import actions from "@/store/modules/people/actions";
4 | import getters from "@/store/modules/people/getters";
5 |
6 | const peopleStore = {
7 | namespaced: true,
8 | state,
9 | getters,
10 | mutations,
11 | actions
12 | };
13 |
14 | export default peopleStore;
15 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/store/modules/boiling/index.js:
--------------------------------------------------------------------------------
1 | import state from "@/store/modules/boiling/state";
2 | import mutations from "@/store/modules/boiling/mutations";
3 | import actions from "@/store/modules/boiling/actions";
4 | import getters from "@/store/modules/boiling/getters";
5 |
6 | const boilingStore = {
7 | namespaced: true,
8 | state,
9 | getters,
10 | mutations,
11 | actions
12 | };
13 |
14 | export default boilingStore;
15 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/vue.config.proxy.js:
--------------------------------------------------------------------------------
1 | const packageName = require("./package.json").name;
2 |
3 | const prefix = "/api/" + packageName;
4 | const prefixRegExp = "^" + prefix;
5 |
6 | const proxy = {
7 | [prefix]: {
8 | target: "http://localhost:3000",
9 | ws: false,
10 | changeOrigin: false,
11 | pathRewrite: {
12 | [prefixRegExp]: "/api"
13 | }
14 | }
15 | };
16 | module.exports = proxy;
--------------------------------------------------------------------------------
/micro-juejin-home/README.md:
--------------------------------------------------------------------------------
1 | # vue-template-default
2 |
3 | ## Project setup
4 | ```
5 | yarn install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | yarn serve
11 | ```
12 |
13 | ### Compiles and minifies for production
14 | ```
15 | yarn build
16 | ```
17 |
18 | ### Lints and fixes files
19 | ```
20 | yarn lint
21 | ```
22 |
23 | ### Customize configuration
24 | See [Configuration Reference](https://cli.vuejs.org/config/).
25 |
--------------------------------------------------------------------------------
/micro-juejin-server/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "axios": "^0.20.0",
4 | "koa": "^2.13.0",
5 | "koa-bodyparser": "^4.3.0",
6 | "koa-router": "^9.4.0",
7 | "koa-static": "^5.0.0",
8 | "koa2-cors": "^2.0.6",
9 | "mockjs": "^1.1.0",
10 | "querystring": "^0.2.0",
11 | "superagent": "^6.1.0"
12 | },
13 | "scripts": {
14 | "start": "nodemon app.js"
15 | },
16 | "name": "micro-juejin-server"
17 | }
18 |
--------------------------------------------------------------------------------
/micro-juejin-topic/README.md:
--------------------------------------------------------------------------------
1 | # vue-template-default
2 |
3 | ## Project setup
4 | ```
5 | yarn install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | yarn serve
11 | ```
12 |
13 | ### Compiles and minifies for production
14 | ```
15 | yarn build
16 | ```
17 |
18 | ### Lints and fixes files
19 | ```
20 | yarn lint
21 | ```
22 |
23 | ### Customize configuration
24 | See [Configuration Reference](https://cli.vuejs.org/config/).
25 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import VueRouter from "vue-router";
3 | import Topic from "@views/Topic.vue";
4 |
5 | Vue.use(VueRouter);
6 |
7 | export const routes = [
8 | {
9 | path: "/",
10 | name: "Topic",
11 | component: Topic
12 | }
13 | ];
14 |
15 | const router = new VueRouter({
16 | mode: "history",
17 | base: process.env.BASE_URL,
18 | routes
19 | });
20 |
21 | export default router;
22 |
--------------------------------------------------------------------------------
/micro-juejin-activity/README.md:
--------------------------------------------------------------------------------
1 | # vue-template-default
2 |
3 | ## Project setup
4 | ```
5 | yarn install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | yarn serve
11 | ```
12 |
13 | ### Compiles and minifies for production
14 | ```
15 | yarn build
16 | ```
17 |
18 | ### Lints and fixes files
19 | ```
20 | yarn lint
21 | ```
22 |
23 | ### Customize configuration
24 | See [Configuration Reference](https://cli.vuejs.org/config/).
25 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/store/modules/activity/index.js:
--------------------------------------------------------------------------------
1 | import state from "@/store/modules/activity/state";
2 | import mutations from "@/store/modules/activity/mutations";
3 | import actions from "@/store/modules/activity/actions";
4 | import getters from "@/store/modules/activity/getters";
5 |
6 | const activityStore = {
7 | namespaced: true,
8 | state,
9 | getters,
10 | mutations,
11 | actions
12 | };
13 |
14 | export default activityStore;
15 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/README.md:
--------------------------------------------------------------------------------
1 | # vue-template-default
2 |
3 | ## Project setup
4 | ```
5 | yarn install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | yarn serve
11 | ```
12 |
13 | ### Compiles and minifies for production
14 | ```
15 | yarn build
16 | ```
17 |
18 | ### Lints and fixes files
19 | ```
20 | yarn lint
21 | ```
22 |
23 | ### Customize configuration
24 | See [Configuration Reference](https://cli.vuejs.org/config/).
25 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/README.md:
--------------------------------------------------------------------------------
1 | # vue-template-default
2 |
3 | ## Project setup
4 | ```
5 | yarn install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | yarn serve
11 | ```
12 |
13 | ### Compiles and minifies for production
14 | ```
15 | yarn build
16 | ```
17 |
18 | ### Lints and fixes files
19 | ```
20 | yarn lint
21 | ```
22 |
23 | ### Customize configuration
24 | See [Configuration Reference](https://cli.vuejs.org/config/).
25 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/store/modules/brochure/index.js:
--------------------------------------------------------------------------------
1 | import state from "@/store/modules/brochure/state";
2 | import mutations from "@/store/modules/brochure/mutations";
3 | import actions from "@/store/modules/brochure/actions";
4 | import getters from "@/store/modules/brochure/getters";
5 |
6 | const brochureStore = {
7 | namespaced: true,
8 | state,
9 | getters,
10 | mutations,
11 | actions
12 | };
13 |
14 | export default brochureStore;
15 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/store/modules/people/actions.js:
--------------------------------------------------------------------------------
1 | import PeopleService from "@/services/PeopleService";
2 | import { SET_PEOPLE_LIST } from "@/store/modules/people/mutations-type";
3 |
4 | const peopleService = PeopleService.getInstance();
5 |
6 | const actions = {
7 | getPeopleList: async ({ commit }) => {
8 | const res = await peopleService.getPeopleList();
9 | commit(SET_PEOPLE_LIST, res);
10 | }
11 | };
12 |
13 | export default actions;
14 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/store/modules/people/actions.js:
--------------------------------------------------------------------------------
1 | import PeopleService from "@/services/PeopleService";
2 | import { SET_PEOPLE_LIST } from "@/store/modules/people/mutations-type";
3 |
4 | const peopleService = PeopleService.getInstance();
5 |
6 | const actions = {
7 | getPeopleList: async ({ commit }) => {
8 | const res = await peopleService.getPeopleList();
9 | commit(SET_PEOPLE_LIST, res);
10 | }
11 | };
12 |
13 | export default actions;
14 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/store/modules/people/actions.js:
--------------------------------------------------------------------------------
1 | import PeopleService from "@/services/PeopleService";
2 | import { SET_PEOPLE_LIST } from "@/store/modules/people/mutations-type";
3 |
4 | const peopleService = PeopleService.getInstance();
5 |
6 | const actions = {
7 | getPeopleList: async ({ commit }) => {
8 | const res = await peopleService.getPeopleList();
9 | commit(SET_PEOPLE_LIST, res);
10 | }
11 | };
12 |
13 | export default actions;
14 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/store/modules/people/actions.js:
--------------------------------------------------------------------------------
1 | import PeopleService from "@/services/PeopleService";
2 | import { SET_PEOPLE_LIST } from "@/store/modules/people/mutations-type";
3 |
4 | const peopleService = PeopleService.getInstance();
5 |
6 | const actions = {
7 | getPeopleList: async ({ commit }) => {
8 | const res = await peopleService.getPeopleList();
9 | commit(SET_PEOPLE_LIST, res);
10 | }
11 | };
12 |
13 | export default actions;
14 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/store/modules/home/actions.js:
--------------------------------------------------------------------------------
1 | import HomeService from "@/services/HomeService";
2 | import { SET_ARTICLE_LIST } from "@/store/modules/home/mutations-type";
3 |
4 | const homeService = HomeService.getInstance();
5 |
6 | const actions = {
7 | getArticleList: async ({ commit }, limit) => {
8 | const res = await homeService.getArticleList(limit);
9 | commit(SET_ARTICLE_LIST, res);
10 | }
11 | };
12 |
13 | export default actions;
14 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import VueRouter from "vue-router";
3 | import Activity from "../views/Activity.vue";
4 |
5 | Vue.use(VueRouter);
6 |
7 | export const routes = [
8 | {
9 | path: "/",
10 | name: "Activity",
11 | component: Activity
12 | }
13 | ];
14 |
15 | const router = new VueRouter({
16 | mode: "history",
17 | base: process.env.BASE_URL,
18 | routes
19 | });
20 |
21 | export default router;
22 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import VueRouter from "vue-router";
3 | import Brochure from "@views/Brochure.vue";
4 |
5 | Vue.use(VueRouter);
6 |
7 | export const routes = [
8 | {
9 | path: "/",
10 | name: "Brochure",
11 | component: Brochure
12 | }
13 | ];
14 |
15 | const router = new VueRouter({
16 | mode: "history",
17 | base: process.env.BASE_URL,
18 | routes
19 | });
20 |
21 | export default router;
22 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/store/modules/people/actions.js:
--------------------------------------------------------------------------------
1 | import BrochureService from "@services/BrochureService";
2 | import { SET_PEOPLE_LIST } from "@/store/modules/people/mutations-type";
3 |
4 | const peopleService = BrochureService.getInstance();
5 |
6 | const actions = {
7 | getPeopleList: async ({ commit }) => {
8 | const res = await peopleService.getPeopleList();
9 | commit(SET_PEOPLE_LIST, res);
10 | }
11 | };
12 |
13 | export default actions;
14 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/filter/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import moment from "moment";
3 |
4 | Vue.filter("formatDate", (val, formatStr) => {
5 | return val ? moment(new Date(val)).format(formatStr) : "--";
6 | });
7 |
8 | Vue.filter('toSmallAvatar', val => {
9 | return val.replace(/\?.*/g, '?imageView2/1/w/100/h/100/q/85/format/webp/interlace/1')
10 | })
11 |
12 |
13 | Vue.filter('pastTime', val => {
14 | return ~~((Date.now() - val * 1000) / 3600000) + '小时前'
15 | })
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/store/modules/brochure/actions.js:
--------------------------------------------------------------------------------
1 | import BrochureService from "@services/BrochureService";
2 | import { SET_BROCHURE_LIST } from "@/store/modules/brochure/mutations-type";
3 |
4 | const brochureService = BrochureService.getInstance();
5 |
6 | const actions = {
7 | getBrochureList: async ({ commit }, limit) => {
8 | const res = await brochureService.getBrochureList(limit);
9 | commit(SET_BROCHURE_LIST, res);
10 | }
11 | };
12 |
13 | export default actions;
14 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/store/modules/boiling/actions.js:
--------------------------------------------------------------------------------
1 | import BoilingService from "@/services/BoilingService";
2 | import { SET_BOILING_LIST } from "@/store/modules/boiling/mutations-type";
3 |
4 | const boilingService = BoilingService.getInstance();
5 |
6 | const actions = {
7 | getBoilingList: async ({ commit }, limit) => {
8 | const res = await boilingService.getBoilingList(limit);
9 | commit(SET_BOILING_LIST, res);
10 | return;
11 | }
12 | };
13 |
14 | export default actions;
15 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import Vuex from "vuex";
3 |
4 | import peopleStore from "@/store/modules/people";
5 |
6 | Vue.use(Vuex);
7 |
8 | export default new Vuex.Store({
9 | state: { isLoading: false },
10 | mutations: {
11 | loadingToggle: (state, loading) => {
12 | state.isLoading = loading;
13 | console.log("loadingToggle~~~~~~~~~~~~~~~~~~",loading);
14 | }
15 | },
16 | actions: {},
17 | modules: { people: peopleStore }
18 | });
19 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/store/modules/activity/mutations.js:
--------------------------------------------------------------------------------
1 | import {
2 | SET_BANNER_LIST,
3 | SET_ACTIVITY_LIST
4 | } from "@/store/modules/activity/mutations-type";
5 |
6 | const mutations = {
7 | [SET_BANNER_LIST]: (state, bannerList) => {
8 | state.bannerList = bannerList;
9 | },
10 | [SET_ACTIVITY_LIST]: (state, activityList) => {
11 | state.activityList =
12 | activityList === null ? [] : state.activityList.concat(activityList);
13 | }
14 | };
15 |
16 | export default mutations;
17 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/services/PeopleService.js:
--------------------------------------------------------------------------------
1 | import API from "@/apis";
2 |
3 | export default class PeopleService {
4 | static instance;
5 |
6 | constructor() {}
7 |
8 | /*单例模式获取该service类的实例*/
9 | static getInstance() {
10 | if (!PeopleService.instance) {
11 | PeopleService.instance = new PeopleService();
12 | }
13 | return PeopleService.instance;
14 | }
15 |
16 | getPeopleList = async () => {
17 | const res = await API.people.getPeopleList();
18 | return res.list;
19 | };
20 | }
21 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/services/PeopleService.js:
--------------------------------------------------------------------------------
1 | import API from "@/apis";
2 |
3 | export default class PeopleService {
4 | static instance;
5 |
6 | constructor() {}
7 |
8 | /*单例模式获取该service类的实例*/
9 | static getInstance() {
10 | if (!PeopleService.instance) {
11 | PeopleService.instance = new PeopleService();
12 | }
13 | return PeopleService.instance;
14 | }
15 |
16 | getPeopleList = async () => {
17 | const res = await API.people.getPeopleList();
18 | return res.list;
19 | };
20 | }
21 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/services/PeopleService.js:
--------------------------------------------------------------------------------
1 | import API from "@/apis";
2 |
3 | export default class PeopleService {
4 | static instance;
5 |
6 | constructor() {}
7 |
8 | /*单例模式获取该service类的实例*/
9 | static getInstance() {
10 | if (!PeopleService.instance) {
11 | PeopleService.instance = new PeopleService();
12 | }
13 | return PeopleService.instance;
14 | }
15 |
16 | getPeopleList = async () => {
17 | const res = await API.people.getPeopleList();
18 | return res.list;
19 | };
20 | }
21 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/services/PeopleService.js:
--------------------------------------------------------------------------------
1 | import API from "@/apis";
2 |
3 | export default class PeopleService {
4 | static instance;
5 |
6 | constructor() {}
7 |
8 | /*单例模式获取该service类的实例*/
9 | static getInstance() {
10 | if (!PeopleService.instance) {
11 | PeopleService.instance = new PeopleService();
12 | }
13 | return PeopleService.instance;
14 | }
15 |
16 | getPeopleList = async () => {
17 | const res = await API.people.getPeopleList();
18 | return res.list;
19 | };
20 | }
21 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/views/Home.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |

4 |
5 |
6 |
7 |
8 |
25 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/apis/activity.js:
--------------------------------------------------------------------------------
1 | import http from "@/shared/http";
2 |
3 | const activity = {
4 | // 获取轮播图列表
5 | getBannerList: () => http.get("/activity/bannerList"),
6 |
7 | // 获取月事件列表
8 | getMonthStat: from_date =>
9 | http.get(`/activity/monthStat?from_date=${from_date}`),
10 |
11 | // 获取活动列表
12 | getActivityList: (limit, cursor, city) => {
13 | return http.get(
14 | `/activity/activityList?limit=${limit}&cursor=${cursor}&city=${city}`
15 | );
16 | }
17 | };
18 |
19 | export default activity;
20 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/shared/http.js:
--------------------------------------------------------------------------------
1 | import Axios from "axios";
2 | import interceptors from "./interceptors";
3 |
4 | const http = Axios.create({
5 | baseURL: "/api",
6 | headers: {
7 | Accept: "application/json",
8 | "X-Requested-With": "Channing-Request",
9 | "Cache-Control": "no-cache",
10 | Pragma: "no-cache",
11 | Expires: "-1"
12 | },
13 | withCredentials: true,
14 | timeout: 60000 // max time of request timeout
15 | });
16 |
17 | interceptors(http);
18 |
19 | export { http };
20 | export default http;
21 |
--------------------------------------------------------------------------------
/micro-juejin-tryVite/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Vite App
8 |
9 |
10 |
11 |
12 | 翻车了
13 | entryjs被import-html-entry替换成了text/javascript类型的script标签
14 | 而vite开发环境下是module类型的,束手无策┓( ´∀` )┏
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/micro-juejin-server/src/routers/topic.js:
--------------------------------------------------------------------------------
1 | const router = require('koa-router')()
2 |
3 | const axios = require('axios')
4 | const querystring = require('querystring')
5 |
6 |
7 |
8 | router.get('/list', async ctx => {
9 | const res = await axios.post('https://apinew.juejin.im/tag_api/v1/query_topic_list', {
10 | "sort_type": 4,
11 | "cursor": "0",
12 | "limit": 50
13 | })
14 | ctx.body = {
15 | code: 0,
16 | data: {
17 | list: res.data.data,
18 | }
19 | }
20 | })
21 |
22 |
23 | module.exports = router
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | ## 掘金文章链接
3 | **[「⚡微前端实战:qiankun+Vue 掘金重构计划 | 🏆 技术专题第四期征文 ...... 」](https://juejin.im/post/6874213637687345159)**
4 |
5 | ## Logs
6 | ### 2020.09.27
7 | * 目前要all in一个产品线,所以暂时这个项目的迭代会放一放
8 | * BTW,希望跟boss争取将新项目采用微前端架构,继续总结更多落地经验,届时有空了分享一波给大家同时也会继续做小掘金的优化
9 |
10 |
11 | ### 2020.09.25
12 | * Vite本地开发接入失败,原因是由于qiankun暂时不支持ESModule类型的包,虽然build后还是可以接入,但这就是两套写法了。
13 | * 战略性放弃Vite在微前端的接入,待qiankun后续支持吧
14 |
15 |
16 | ### 2020.09.23
17 | * 替换了更好的微应用切换loading逻辑
18 | * 调整了Loading组件的定位样式
19 |
20 |
21 | ### 2020.09.22
22 | * 这几天忙着搬砖中....搬完更新一波。
23 | * 尽管提issue,能力范围之内尽量完成
24 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/components/Home/HomeSider/ADCard.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
![]()
5 |
6 |
7 |
8 |
9 |
12 |
13 |
26 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/views/Topic.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
17 |
29 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import App from "./App.vue";
3 | import router from "./router";
4 | import store from "./store";
5 |
6 | // import "viewerjs/dist/viewer.css";
7 | // import Viewer from "v-viewer";
8 | // Vue.use(Viewer);
9 |
10 | import "@/filter";
11 |
12 | // 按需引入Ant Design 组件
13 | import "@/shared/registAntd";
14 |
15 | // 注册微应用相关
16 | import subRegister from "./shared/subRegister";
17 |
18 | Vue.config.productionTip = false;
19 |
20 | const vm = new Vue({
21 | router,
22 | store,
23 | render: h => h(App)
24 | }).$mount("#main_app");
25 |
26 | subRegister(vm);
27 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/services/HomeService.js:
--------------------------------------------------------------------------------
1 | import API from "@/apis";
2 |
3 | export default class HomeService {
4 | static instance;
5 |
6 | constructor() {}
7 |
8 | /*单例模式获取该service类的实例*/
9 | static getInstance() {
10 | if (!HomeService.instance) {
11 | HomeService.instance = new HomeService();
12 | HomeService.instance.cursor = "0";
13 | }
14 | return HomeService.instance;
15 | }
16 |
17 | getArticleList = async num => {
18 | const res = await API.home.getArticleList(num, HomeService.instance.cursor);
19 | HomeService.instance.cursor = res.cursor;
20 | return res.list;
21 | };
22 | }
23 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/layouts/BasicLayout/BellBadge.vue:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
20 |
31 |
--------------------------------------------------------------------------------
/micro-juejin-tryVite/vite.config.js:
--------------------------------------------------------------------------------
1 | const port = 8076
2 |
3 | // const publicPath = '//localhost:3000/'
4 |
5 |
6 | export default {
7 | port,
8 | base: '//www.channing-bbs.club:8076/',
9 | proxy: {
10 | '/api/micro-juejin-tryVite': {
11 | target: 'http://localhost:3000',
12 | changeOrigin: true,
13 | rewrite: path => path.replace(/^\/api\/micro-juejin-tryVite/, '/api')
14 | }
15 | },
16 | configureServer: ctx => {
17 | ctx.app.use(async (ctx,next) => {
18 | ctx.set('Access-Control-Allow-Origin', '*')
19 | await next()
20 | })
21 | }
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/micro-juejin-main/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 掘金(MicroApps)
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/micro-juejin-server/src/routers/boiling.js:
--------------------------------------------------------------------------------
1 | const router = require('koa-router')()
2 |
3 | const axios = require('axios')
4 | const querystring = require('querystring')
5 |
6 |
7 |
8 | router.get('/boilingList', async ctx => {
9 | const res = await axios.post('https://apinew.juejin.im/recommend_api/v1/short_msg/recommend', {
10 | "id_type": 2,
11 | "sort_type": 300,
12 | "cursor": ctx.query.cursor,
13 | "limit": ~~ctx.query.limit || 20
14 | })
15 | ctx.body = {
16 | code: 0,
17 | data: {
18 | cursor: res.data.cursor,
19 | list: res.data.data,
20 | }
21 | }
22 | })
23 |
24 |
25 | module.exports = router
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
18 |
31 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
18 |
31 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/services/BoilingService.js:
--------------------------------------------------------------------------------
1 | import API from "@/apis";
2 |
3 | export default class BoilingService {
4 | static instance;
5 |
6 | constructor() {}
7 |
8 | /*单例模式获取该service类的实例*/
9 | static getInstance() {
10 | if (!BoilingService.instance) {
11 | BoilingService.instance = new BoilingService();
12 | BoilingService.instance.cursor = "0";
13 | }
14 | return BoilingService.instance;
15 | }
16 |
17 | getBoilingList = async num => {
18 | const res = await API.boiling.getBoilingList(
19 | num,
20 | BoilingService.instance.cursor
21 | );
22 | BoilingService.instance.cursor = res.cursor;
23 | return res.list;
24 | };
25 | }
26 |
--------------------------------------------------------------------------------
/micro-juejin-activity/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | <%= htmlWebpackPlugin.options.title %>
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | <%= htmlWebpackPlugin.options.title %>
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | <%= htmlWebpackPlugin.options.title %>
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/micro-juejin-home/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | <%= htmlWebpackPlugin.options.title %>
9 |
10 |
11 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/micro-juejin-server/src/routers/index.js:
--------------------------------------------------------------------------------
1 | const router = require('koa-router')({ prefix: '/api' })
2 |
3 | const people = require('./people')
4 | const home = require('./home')
5 | const boiling = require('./boiling')
6 | const topic = require('./topic')
7 | const brochure = require("./brochure")
8 | const activity = require('./activity')
9 |
10 |
11 | router.get('/', async ctx => { ctx.body = 'api index' })
12 |
13 | router.use('/people', people.routes());
14 | router.use('/home', home.routes());
15 | router.use('/boiling', boiling.routes());
16 | router.use('/topic', topic.routes());
17 | router.use('/brochure', brochure.routes());
18 | router.use('/activity', activity.routes());
19 |
20 | module.exports = router
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
18 |
32 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/components/Boiling/BoilingMain/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
18 |
19 |
29 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
18 |
33 |
--------------------------------------------------------------------------------
/micro-juejin-server/src/routers/brochure.js:
--------------------------------------------------------------------------------
1 | const axios = require('axios')
2 |
3 | const router = require('koa-router')()
4 |
5 |
6 |
7 | router.get('/list', async ctx => {
8 | const res = await axios.post('https://apinew.juejin.im/booklet_api/v1/booklet/listbycategory',{
9 | "category_id": "0",
10 | "cursor": ctx.query.cursor || '0',
11 | "limit": ~~ctx.query.limit || 20
12 | })
13 | ctx.body = {
14 | code: 0,
15 | data: {
16 | brochureList: res.data.data,
17 | has_more: res.data.has_more,
18 | cursor: res.data.cursor,
19 | err_msg: res.data.err_msg,
20 | err_no: res.data.err_no
21 | }
22 | }
23 | })
24 |
25 |
26 |
27 |
28 | module.exports = router
--------------------------------------------------------------------------------
/micro-juejin-topic/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | <%= htmlWebpackPlugin.options.title %>
10 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import VueRouter from "vue-router";
3 | import Home from "../views/Home.vue";
4 |
5 | Vue.use(VueRouter);
6 |
7 | const routes = [
8 | {
9 | path: "/",
10 | name: "Home",
11 | component: Home
12 | },
13 | {
14 | path: "/people",
15 | name: "People",
16 | // route level code-splitting
17 | // this generates a separate chunk (about.[hash].js) for this route
18 | // which is lazy-loaded when the route is visited.
19 | component: () =>
20 | import(/* webpackChunkName: "people" */ "@/views/People.vue")
21 | }
22 | ];
23 |
24 | const router = new VueRouter({
25 | mode: "history",
26 | base: process.env.BASE_URL,
27 | routes
28 | });
29 |
30 | export default router;
31 |
--------------------------------------------------------------------------------
/micro-juejin-tryVite/src/composables/usePeopleList.js:
--------------------------------------------------------------------------------
1 | import {ref,computed} from "vue"
2 |
3 | export default function() {
4 | const loading = ref(false)
5 | const peopleList = ref([])
6 | const isEmpty = computed(()=>peopleList.value.length === 0)
7 | const loadingMsg = computed(()=>isEmpty.value&&!loading.value? 'EMPTY':'LOADING')
8 |
9 | const fetchPeopleList = async () => {
10 | loading.value = true
11 | const res = await fetch('/api/micro-juejin-tryVite/people/list').then(res => res.json())
12 | peopleList.value = res.data.list
13 | loading.value = false
14 | }
15 |
16 | return {
17 | loading,
18 | peopleList,
19 | isEmpty,
20 | loadingMsg,
21 | fetchPeopleList,
22 | }
23 | }
--------------------------------------------------------------------------------
/micro-juejin-home/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import VueRouter from "vue-router";
3 | import Home from "../views/Home.vue";
4 |
5 | Vue.use(VueRouter);
6 |
7 | export const routes = [
8 | {
9 | path: "/",
10 | name: "Home",
11 | component: Home
12 | },
13 | {
14 | path: "/people",
15 | name: "People",
16 | // route level code-splitting
17 | // this generates a separate chunk (about.[hash].js) for this route
18 | // which is lazy-loaded when the route is visited.
19 | component: () =>
20 | import(/* webpackChunkName: "people" */ "../views/People.vue")
21 | }
22 | ];
23 |
24 | const router = new VueRouter({
25 | mode: "history",
26 | base: process.env.BASE_URL,
27 | routes
28 | });
29 |
30 | export default router;
31 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/components/Boiling/BoilingSider/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
21 |
22 |
31 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/store/modules/activity/actions.js:
--------------------------------------------------------------------------------
1 | import ActivityService from "@/services/ActivityService";
2 | import {
3 | SET_BANNER_LIST,
4 | SET_ACTIVITY_LIST
5 | } from "@/store/modules/activity/mutations-type";
6 |
7 | const activityService = ActivityService.getInstance();
8 |
9 | const actions = {
10 | getBannerList: async ({ commit }) => {
11 | const res = await activityService.getBannerList();
12 | commit(SET_BANNER_LIST, res);
13 | },
14 | getActivityList: async ({ commit }, city) => {
15 | if (city) {
16 | commit(SET_ACTIVITY_LIST, null);
17 | }
18 | const res = await activityService.getActivityList(city);
19 | if (res) {
20 | commit(SET_ACTIVITY_LIST, res);
21 | }
22 | return res;
23 | }
24 | };
25 |
26 | export default actions;
27 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/shared/http.js:
--------------------------------------------------------------------------------
1 | import Axios from "axios";
2 | import interceptors from "./interceptors";
3 | const packageName = require("../../package.json").name;
4 |
5 | // 如果作为微应用,应该在加上该应用的标识前缀,以区分其他应用的接口,并且让主应用能够正确代理到微应用中,再从微应用代理到服务器(并且通过pathRewrite去掉该标识前缀)
6 | let baseURL = "/api";
7 | // eslint-disable-next-line no-constant-condition
8 | if (window.__POWERED_BY_QIANKUN__ || true) {
9 | baseURL += `/${packageName}`;
10 | }
11 |
12 | const http = Axios.create({
13 | baseURL,
14 | headers: {
15 | Accept: "application/json",
16 | "X-Requested-With": "Channing-Request",
17 | "Cache-Control": "no-cache",
18 | Pragma: "no-cache",
19 | Expires: "-1"
20 | },
21 | withCredentials: true,
22 | timeout: 60000 // max time of request timeout
23 | });
24 |
25 | interceptors(http);
26 |
27 | export { http };
28 | export default http;
29 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/shared/http.js:
--------------------------------------------------------------------------------
1 | import Axios from "axios";
2 | import interceptors from "./interceptors";
3 | const packageName = require("../../package.json").name;
4 |
5 | // 如果作为微应用,应该在加上该应用的标识前缀,以区分其他应用的接口,并且让主应用能够正确代理到微应用中,再从微应用代理到服务器(并且通过pathRewrite去掉该标识前缀)
6 | let baseURL = "/api";
7 | // eslint-disable-next-line no-constant-condition
8 | if (window.__POWERED_BY_QIANKUN__ || true) {
9 | baseURL += `/${packageName}`;
10 | }
11 |
12 | const http = Axios.create({
13 | baseURL,
14 | headers: {
15 | Accept: "application/json",
16 | "X-Requested-With": "Channing-Request",
17 | "Cache-Control": "no-cache",
18 | Pragma: "no-cache",
19 | Expires: "-1"
20 | },
21 | withCredentials: true,
22 | timeout: 60000 // max time of request timeout
23 | });
24 |
25 | interceptors(http);
26 |
27 | export { http };
28 | export default http;
29 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/shared/http.js:
--------------------------------------------------------------------------------
1 | import Axios from "axios";
2 | import interceptors from "./interceptors";
3 | const packageName = require("../../package.json").name;
4 |
5 | // 如果作为微应用,应该在加上该应用的标识前缀,以区分其他应用的接口,并且让主应用能够正确代理到微应用中,再从微应用代理到服务器(并且通过pathRewrite去掉该标识前缀)
6 | let baseURL = "/api";
7 | // eslint-disable-next-line no-constant-condition
8 | if (window.__POWERED_BY_QIANKUN__ || true) {
9 | baseURL += `/${packageName}`;
10 | }
11 |
12 | const http = Axios.create({
13 | baseURL,
14 | headers: {
15 | Accept: "application/json",
16 | "X-Requested-With": "Channing-Request",
17 | "Cache-Control": "no-cache",
18 | Pragma: "no-cache",
19 | Expires: "-1"
20 | },
21 | withCredentials: true,
22 | timeout: 60000 // max time of request timeout
23 | });
24 |
25 | interceptors(http);
26 |
27 | export { http };
28 | export default http;
29 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/shared/http.js:
--------------------------------------------------------------------------------
1 | import Axios from "axios";
2 | import interceptors from "./interceptors";
3 | const packageName = require("../../package.json").name;
4 |
5 | // 如果作为微应用,应该在加上该应用的标识前缀,以区分其他应用的接口,并且让主应用能够正确代理到微应用中,再从微应用代理到服务器(并且通过pathRewrite去掉该标识前缀)
6 | let baseURL = "/api";
7 | // eslint-disable-next-line no-constant-condition
8 | if (window.__POWERED_BY_QIANKUN__ || true) {
9 | baseURL += `/${packageName}`;
10 | }
11 |
12 | const http = Axios.create({
13 | baseURL,
14 | headers: {
15 | Accept: "application/json",
16 | "X-Requested-With": "Channing-Request",
17 | "Cache-Control": "no-cache",
18 | Pragma: "no-cache",
19 | Expires: "-1"
20 | },
21 | withCredentials: true,
22 | timeout: 60000 // max time of request timeout
23 | });
24 |
25 | interceptors(http);
26 |
27 | export { http };
28 | export default http;
29 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/shared/http.js:
--------------------------------------------------------------------------------
1 | import Axios from "axios";
2 | import interceptors from "./interceptors";
3 | const packageName = require("../../package.json").name;
4 |
5 | // 如果作为微应用,应该在加上该应用的标识前缀,以区分其他应用的接口,并且让主应用能够正确代理到微应用中,再从微应用代理到服务器(并且通过pathRewrite去掉该标识前缀)
6 | let baseURL = "/api";
7 | // eslint-disable-next-line no-constant-condition
8 | if (window.__POWERED_BY_QIANKUN__ || true) {
9 | baseURL += `/${packageName}`;
10 | }
11 |
12 | const http = Axios.create({
13 | baseURL,
14 | headers: {
15 | Accept: "application/json",
16 | "X-Requested-With": "Channing-Request",
17 | "Cache-Control": "no-cache",
18 | Pragma: "no-cache",
19 | Expires: "-1"
20 | },
21 | withCredentials: true,
22 | timeout: 60000 // max time of request timeout
23 | });
24 |
25 | interceptors(http);
26 |
27 | export { http };
28 | export default http;
29 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/shared/registAntd.js:
--------------------------------------------------------------------------------
1 | /*
2 | 使用babel-plugin-import按需引入antd,具体配置在babel.config.js中。
3 | 另外因为是定制主题的方式,还需要在vue.config.js中配置less的相关参数,
4 | 其中javascriptEnabled的值必须为true,否则主题定制的样式无法生效
5 | */
6 |
7 | /*
8 | * 这里是全局按需引入
9 | * 如果想要进一步提升性能
10 | * 可以只在此注册频繁用到的组件
11 | * 一些特定场景下才会用到的大型组件可以在具体业务组件中单独引入注册。
12 | * 例如List组件在运行时接近2M大小,并且只有People页面中使用的话可以不在这里全局注册List组件,而是在People中去单独按需引入List组件
13 | * */
14 |
15 | import Vue from "vue";
16 | // eslint-disable-next-line no-unused-vars
17 | import { Button, Avatar, Menu, Input, Skeleton } from "ant-design-vue";
18 | //
19 |
20 | /*需要注册的组件名字, 注册之前需要确保已经import这个组件*/
21 | const components = [Button, Avatar, Menu, Input, Skeleton];
22 | register(components);
23 |
24 | function register(components) {
25 | components.forEach(comp => {
26 | Vue.use(comp);
27 | });
28 | // Vue.component(Button.name, Button);
29 | }
30 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/views/Home.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
29 |
38 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/components/Home/HomeMain/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
GET_TOKEN
4 |
5 |
6 |
7 |
8 |
9 |
28 |
29 |
35 |
--------------------------------------------------------------------------------
/micro-juejin-tryVite/src/index.css:
--------------------------------------------------------------------------------
1 | #app {
2 | font-family: Avenir, Helvetica, Arial, sans-serif;
3 | -webkit-font-smoothing: antialiased;
4 | -moz-osx-font-smoothing: grayscale;
5 | text-align: center;
6 | color: #2c3e50;
7 | margin-top: 60px;
8 | }
9 |
10 | button {
11 | color: #fff;
12 | background-color: #41b883;
13 | border-radius: 4px;
14 | padding: 8px 16px;
15 | border: none;
16 | cursor: pointer;
17 | box-shadow: 4px 4px 4px rgba(110,110,110,0.25);
18 | position: relative;
19 | transition: all 0.3s ease;
20 | }
21 |
22 |
23 |
24 | button::before {
25 | content:"";
26 | display: block;
27 | position: absolute;
28 | width: 100%;
29 | height: 100%;
30 | left: 0;
31 | top: 0;
32 | transition: all 0.3s ease;
33 | }
34 | button:hover::before {
35 | background-color: rgba(255,255,255,0.2);
36 | }
37 |
38 | button:hover {
39 | box-shadow: 12px 12px 4px rgba(110,110,110,0.15);
40 | transform: scale(1.1);
41 | }
--------------------------------------------------------------------------------
/micro-juejin-tryVite/src/components/Loading.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
🦄 {{ msg }} 😱😱😱😱😱😱😱
4 |
5 |
6 |
16 |
43 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/router/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import VueRouter from "vue-router";
3 | import Boiling from "@views/Boiling";
4 |
5 | Vue.use(VueRouter);
6 |
7 | export const routes = [
8 | {
9 | path: "/",
10 | redirect: "/pins/recommended",
11 | name: "Index"
12 | },
13 | {
14 | path: "/pins/:type",
15 | name: "Boiling",
16 | component: Boiling
17 | },
18 | {
19 | path: "/pins/:topic/:topic_id",
20 | name: "Boiling",
21 | component: Boiling
22 | },
23 | {
24 | path: "/people",
25 | name: "People",
26 | // route level code-splitting
27 | // this generates a separate chunk (about.[hash].js) for this route
28 | // which is lazy-loaded when the route is visited.
29 | component: () =>
30 | import(/* webpackChunkName: "people" */ "../views/People.vue")
31 | }
32 | ];
33 |
34 | const router = new VueRouter({
35 | mode: "history",
36 | base: process.env.BASE_URL,
37 | routes
38 | });
39 |
40 | export default router;
41 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/services/BrochureService.js:
--------------------------------------------------------------------------------
1 | import API from "@/apis";
2 |
3 | export default class BrochureService {
4 | static instance;
5 |
6 | constructor() {}
7 |
8 | /*单例模式获取该service类的实例*/
9 | static getInstance() {
10 | if (!BrochureService.instance) {
11 | BrochureService.instance = new BrochureService();
12 | BrochureService.instance.cursor = "0";
13 | }
14 | return BrochureService.instance;
15 | }
16 |
17 | getBrochureList = async limit => {
18 | console.log("has_more?");
19 | console.log(BrochureService.instance.has_more);
20 | const has_more = BrochureService.instance.has_more;
21 | if (has_more !== undefined && !has_more) {
22 | return false;
23 | }
24 | const res = await API.brochure.getBrochureList(
25 | limit,
26 | BrochureService.instance.cursor
27 | );
28 | BrochureService.instance.cursor = res.cursor;
29 | BrochureService.instance.has_more = res.has_more;
30 | return res.brochureList;
31 | };
32 | }
33 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
18 |
45 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/layouts/BasicLayout/SearchInput.vue:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
45 |
46 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/shared/registAntd.js:
--------------------------------------------------------------------------------
1 | /*
2 | 使用babel-plugin-import按需引入antd,具体配置在babel.config.js中。
3 | 另外因为是定制主题的方式,还需要在vue.config.js中配置less的相关参数,
4 | 其中javascriptEnabled的值必须为true,否则主题定制的样式无法生效
5 | */
6 |
7 | /*
8 | * 这里是全局按需引入
9 | * 如果想要进一步提升性能
10 | * 可以只在此注册频繁用到的组件
11 | * 一些特定场景下才会用到的大型组件可以在具体业务组件中单独引入注册。
12 | * 例如List组件在运行时接近2M大小,并且只有People页面中使用的话可以不在这里全局注册List组件,而是在People中去单独按需引入List组件
13 | * */
14 |
15 | import Vue from "vue";
16 | // eslint-disable-next-line no-unused-vars
17 | import {
18 | Button,
19 | Empty,
20 | notification,
21 | message,
22 | Skeleton,
23 | Icon,
24 | // Modal
25 | } from "ant-design-vue";
26 | //
27 | Vue.prototype.$notification = notification;
28 | Vue.prototype.$message = message;
29 |
30 | /*需要注册的组件名字, 注册之前需要确保已经import这个组件*/
31 | const components = [
32 | Button,
33 | Empty,
34 | notification,
35 | message,
36 | Skeleton,
37 | Icon,
38 | // Modal
39 | ];
40 | register(components);
41 |
42 | function register(components) {
43 | components.forEach(comp => {
44 | Vue.use(comp);
45 | });
46 | // Vue.component(Button.name, Button);
47 | }
48 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/components/Topic/TopicList.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
11 |
12 |
39 |
40 |
46 |
--------------------------------------------------------------------------------
/micro-juejin-main/vue.config.proxy.js:
--------------------------------------------------------------------------------
1 | const apps = require("./src/shared/microApps");
2 |
3 | const proxy = {};
4 |
5 | const baseConfig = {
6 | ws: false,
7 | changeOrigin: true
8 | };
9 |
10 | const proxyConfigs = apps.map(app => {
11 | return {
12 | target: "http:" + app.entry,
13 | ...baseConfig
14 | };
15 | });
16 |
17 | proxyConfigs.forEach((config, index) => {
18 | // if (index === 5) {
19 | // return;
20 | // }
21 | const key = "/api/" + apps[index].name;
22 | proxy[key] = config;
23 | });
24 |
25 | /*主应用的代理*/
26 | // proxy["/api"] = {
27 | // ...baseConfig,
28 | // target: process.env.BACKEND || "http://localhost:3001"
29 | // };
30 |
31 | console.log("proxy");
32 | console.log(proxy);
33 |
34 | module.exports = proxy;
35 | // module.exports = {
36 | // "/api/sub_1": {
37 | // target: "http://192.168.2.29:8061",
38 | // ws: false,
39 | // changeOrigin: true
40 | // },
41 | // "/api": {
42 | // target: process.env.BACKEND || "http://localhost:3001",
43 | // changeOrigin: true,
44 | // ws: false
45 | // // pathRewrite: {
46 | // // "^/api": "/api"
47 | // // }
48 | // }
49 | // };
50 |
--------------------------------------------------------------------------------
/micro-juejin-main/README.md:
--------------------------------------------------------------------------------
1 | # vue-micro-FE-main
2 |
3 |
4 | ## 注册微应用
5 | 在 `src/subRegister.js` 中:
6 | 添加一个或多个微应用的描述对象到变量名为`apps`的列表中
7 | 比如 :
8 | ```
9 | {
10 | name: "micro-sub-3",
11 | entry: "//localhost:8063",
12 | container: "#subApp",
13 | activeRule: "/micro-sub-3",
14 | $meta: {
15 | title: "微应用3"
16 | }
17 | }
18 | ```
19 |
20 | ## (register micro-apps)
21 | in `src/subRegister.js`:
22 |
23 | Append the objects about the micro-apps to the `apps`.
24 | such as :
25 | ```
26 | {
27 | name: "micro-sub-3",
28 | entry: "//localhost:8063",
29 | container: "#subApp",
30 | activeRule: "/micro-sub-3",
31 | $meta: {
32 | title: "微应用3"
33 | }
34 | }
35 | ```
36 |
37 |
38 | ## Project setup
39 | ```
40 | yarn install
41 | ```
42 |
43 | ### Compiles and hot-reloads for development
44 | ```
45 | yarn serve
46 | ```
47 |
48 | ### Compiles and minifies for production
49 | ```
50 | yarn build
51 | ```
52 |
53 | ### Lints and fixes files
54 | ```
55 | yarn lint
56 | ```
57 |
58 | ### Customize configuration
59 | See [Configuration Reference](https://cli.vuejs.org/config/).
60 |
61 |
62 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
18 |
38 |
51 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/shared/registAntd.js:
--------------------------------------------------------------------------------
1 | /*
2 | 使用babel-plugin-import按需引入antd,具体配置在babel.config.js中。
3 | 另外因为是定制主题的方式,还需要在vue.config.js中配置less的相关参数,
4 | 其中javascriptEnabled的值必须为true,否则主题定制的样式无法生效
5 | */
6 |
7 | /*
8 | * 这里是全局按需引入
9 | * 如果想要进一步提升性能
10 | * 可以只在此注册频繁用到的组件
11 | * 一些特定场景下才会用到的大型组件可以在具体业务组件中单独引入注册。
12 | * 例如List组件在运行时接近2M大小,并且只有People页面中使用的话可以不在这里全局注册List组件,而是在People中去单独按需引入List组件
13 | * */
14 |
15 | import Vue from "vue";
16 | // eslint-disable-next-line no-unused-vars
17 | import {
18 | Button,
19 | Empty,
20 | notification,
21 | message,
22 | Avatar,
23 | Icon,
24 | Tooltip,
25 | Layout,
26 | Menu,
27 | Dropdown,
28 | Input
29 | } from "ant-design-vue";
30 | //
31 | Vue.prototype.$notification = notification;
32 | Vue.prototype.$message = message;
33 |
34 | /*需要注册的组件名字, 注册之前需要确保已经import这个组件*/
35 | const components = [
36 | Button,
37 | Empty,
38 | notification,
39 | message,
40 | Avatar,
41 | Icon,
42 | Tooltip,
43 | Layout,
44 | Menu,
45 | Dropdown,
46 | Input
47 | ];
48 | register(components);
49 |
50 | function register(components) {
51 | components.forEach(comp => {
52 | Vue.use(comp);
53 | });
54 | // Vue.component(Button.name, Button);
55 | }
56 |
--------------------------------------------------------------------------------
/micro-juejin-server/app.js:
--------------------------------------------------------------------------------
1 | const Koa = require('koa')
2 | const bodyParser = require('koa-bodyparser')
3 | const cors = require('koa2-cors')
4 | const path = require('path')
5 |
6 | const koaStatic = require('koa-static')
7 |
8 |
9 | const router = require('./src/routers/index')
10 |
11 | const app = new Koa()
12 |
13 |
14 |
15 | // 跨域中间件
16 | app.use(cors({
17 | origin: ctx => {
18 | const localhost = new RegExp(/^(localhost)/)
19 | if (localhost.test(ctx.request.header.host)) {
20 | return '*'
21 | }
22 | //如果你想要拦截跨域可以返回false
23 | // return false
24 | return '*'
25 | },
26 | exposeHeaders: ['WWW-Authenticate', 'Server-Authorization'],
27 | maxAge: 5,
28 | credentials: true,
29 | allowMethods: ['GET', 'POST', 'PUT', 'DELETE'],
30 | allowHeaders: ['Content-Type', 'Authorization', 'Accept'],
31 | }))
32 |
33 | // 配置静态资源中间件
34 | app.use(koaStatic(
35 | path.join(__dirname, 'dist')
36 | ))
37 |
38 | app.use(bodyParser()) //post解析中间件
39 |
40 |
41 | app.use(router.routes()); //作用:启动路由
42 | app.use(router.allowedMethods());
43 | /* 作用: 这是官方文档的推荐用法,我们可以看到router.allowedMethods()用在了路由匹配
44 | router.routes()之后,目的在于:根据ctx.status 设置response 响应头
45 | */
46 |
47 | app.listen(3000)
--------------------------------------------------------------------------------
/micro-juejin-activity/src/shared/registAntd.js:
--------------------------------------------------------------------------------
1 | /*
2 | 使用babel-plugin-import按需引入antd,具体配置在babel.config.js中。
3 | 另外因为是定制主题的方式,还需要在vue.config.js中配置less的相关参数,
4 | 其中javascriptEnabled的值必须为true,否则主题定制的样式无法生效
5 | */
6 |
7 | /*
8 | * 这里是全局按需引入
9 | * 如果想要进一步提升性能
10 | * 可以只在此注册频繁用到的组件
11 | * 一些特定场景下才会用到的大型组件可以在具体业务组件中单独引入注册。
12 | * 例如List组件在运行时接近2M大小,并且只有People页面中使用的话可以不在这里全局注册List组件,而是在People中去单独按需引入List组件
13 | * */
14 |
15 | import Vue from "vue";
16 | // eslint-disable-next-line no-unused-vars
17 | import {
18 | Button,
19 | notification,
20 | message,
21 | Icon,
22 | Tooltip,
23 | Menu,
24 | Dropdown,
25 | Carousel,
26 | Skeleton,
27 | Calendar,
28 | Badge,
29 | Popover
30 | } from "ant-design-vue";
31 | //
32 | Vue.prototype.$notification = notification;
33 | Vue.prototype.$message = message;
34 |
35 | /*需要注册的组件名字, 注册之前需要确保已经import这个组件*/
36 | const components = [
37 | Button,
38 | notification,
39 | message,
40 | Icon,
41 | Tooltip,
42 | Menu,
43 | Dropdown,
44 | Carousel,
45 | Skeleton,
46 | Calendar,
47 | Badge,
48 | Popover
49 | ];
50 | register(components);
51 |
52 | function register(components) {
53 | components.forEach(comp => {
54 | Vue.use(comp);
55 | });
56 | // Vue.component(Button.name, Button);
57 | }
58 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/shared/util.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Check if value is primitive.
3 | */
4 | export function isPrimitive(value) {
5 | return (
6 | typeof value === "string" ||
7 | typeof value === "number" ||
8 | // $flow-disable-line
9 | typeof value === "symbol" ||
10 | typeof value === "boolean"
11 | );
12 | }
13 |
14 | /**
15 | * Quick object check - this is primarily used to tell
16 | * Objects from primitive values when we know the value
17 | * is a JSON-compliant type.
18 | */
19 | export function isObject(obj) {
20 | return obj !== null && typeof obj === "object";
21 | }
22 |
23 | /**
24 | * Quick empty object check
25 | */
26 | export function isEmptyObject(obj) {
27 | for (var key in obj) {
28 | if ({}.hasOwnProperty.call(obj, key)) return false;
29 | }
30 | return true;
31 | }
32 |
33 | /**
34 | * Remove an item from an array.
35 | */
36 | export function remove(arr, item) {
37 | if (arr.length) {
38 | const index = arr.indexOf(item);
39 | if (index > -1) {
40 | return arr.splice(index, 1);
41 | }
42 | }
43 | }
44 |
45 | /**
46 | * Check whether an object has the property.
47 | */
48 | const hasOwnProperty = Object.prototype.hasOwnProperty;
49 | export function hasOwn(obj, key) {
50 | return hasOwnProperty.call(obj, key);
51 | }
52 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/shared/util.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Check if value is primitive.
3 | */
4 | export function isPrimitive(value) {
5 | return (
6 | typeof value === "string" ||
7 | typeof value === "number" ||
8 | // $flow-disable-line
9 | typeof value === "symbol" ||
10 | typeof value === "boolean"
11 | );
12 | }
13 |
14 | /**
15 | * Quick object check - this is primarily used to tell
16 | * Objects from primitive values when we know the value
17 | * is a JSON-compliant type.
18 | */
19 | export function isObject(obj) {
20 | return obj !== null && typeof obj === "object";
21 | }
22 |
23 | /**
24 | * Quick empty object check
25 | */
26 | export function isEmptyObject(obj) {
27 | for (var key in obj) {
28 | if ({}.hasOwnProperty.call(obj, key)) return false;
29 | }
30 | return true;
31 | }
32 |
33 | /**
34 | * Remove an item from an array.
35 | */
36 | export function remove(arr, item) {
37 | if (arr.length) {
38 | const index = arr.indexOf(item);
39 | if (index > -1) {
40 | return arr.splice(index, 1);
41 | }
42 | }
43 | }
44 |
45 | /**
46 | * Check whether an object has the property.
47 | */
48 | const hasOwnProperty = Object.prototype.hasOwnProperty;
49 | export function hasOwn(obj, key) {
50 | return hasOwnProperty.call(obj, key);
51 | }
52 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/shared/util.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Check if value is primitive.
3 | */
4 | export function isPrimitive(value) {
5 | return (
6 | typeof value === "string" ||
7 | typeof value === "number" ||
8 | // $flow-disable-line
9 | typeof value === "symbol" ||
10 | typeof value === "boolean"
11 | );
12 | }
13 |
14 | /**
15 | * Quick object check - this is primarily used to tell
16 | * Objects from primitive values when we know the value
17 | * is a JSON-compliant type.
18 | */
19 | export function isObject(obj) {
20 | return obj !== null && typeof obj === "object";
21 | }
22 |
23 | /**
24 | * Quick empty object check
25 | */
26 | export function isEmptyObject(obj) {
27 | for (var key in obj) {
28 | if ({}.hasOwnProperty.call(obj, key)) return false;
29 | }
30 | return true;
31 | }
32 |
33 | /**
34 | * Remove an item from an array.
35 | */
36 | export function remove(arr, item) {
37 | if (arr.length) {
38 | const index = arr.indexOf(item);
39 | if (index > -1) {
40 | return arr.splice(index, 1);
41 | }
42 | }
43 | }
44 |
45 | /**
46 | * Check whether an object has the property.
47 | */
48 | const hasOwnProperty = Object.prototype.hasOwnProperty;
49 | export function hasOwn(obj, key) {
50 | return hasOwnProperty.call(obj, key);
51 | }
52 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/shared/util.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Check if value is primitive.
3 | */
4 | export function isPrimitive(value) {
5 | return (
6 | typeof value === "string" ||
7 | typeof value === "number" ||
8 | // $flow-disable-line
9 | typeof value === "symbol" ||
10 | typeof value === "boolean"
11 | );
12 | }
13 |
14 | /**
15 | * Quick object check - this is primarily used to tell
16 | * Objects from primitive values when we know the value
17 | * is a JSON-compliant type.
18 | */
19 | export function isObject(obj) {
20 | return obj !== null && typeof obj === "object";
21 | }
22 |
23 | /**
24 | * Quick empty object check
25 | */
26 | export function isEmptyObject(obj) {
27 | for (var key in obj) {
28 | if ({}.hasOwnProperty.call(obj, key)) return false;
29 | }
30 | return true;
31 | }
32 |
33 | /**
34 | * Remove an item from an array.
35 | */
36 | export function remove(arr, item) {
37 | if (arr.length) {
38 | const index = arr.indexOf(item);
39 | if (index > -1) {
40 | return arr.splice(index, 1);
41 | }
42 | }
43 | }
44 |
45 | /**
46 | * Check whether an object has the property.
47 | */
48 | const hasOwnProperty = Object.prototype.hasOwnProperty;
49 | export function hasOwn(obj, key) {
50 | return hasOwnProperty.call(obj, key);
51 | }
52 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/components/Home/HomeSider/DownloadCard.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |

8 |
9 | 下载掘金客户端
10 | 一个帮助开发者成长的社区
11 |
12 |
14 |
15 |
16 |
19 |
20 |
54 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/shared/util.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Check if value is primitive.
3 | */
4 | export function isPrimitive(value) {
5 | return (
6 | typeof value === "string" ||
7 | typeof value === "number" ||
8 | // $flow-disable-line
9 | typeof value === "symbol" ||
10 | typeof value === "boolean"
11 | );
12 | }
13 |
14 | /**
15 | * Quick object check - this is primarily used to tell
16 | * Objects from primitive values when we know the value
17 | * is a JSON-compliant type.
18 | */
19 | export function isObject(obj) {
20 | return obj !== null && typeof obj === "object";
21 | }
22 |
23 | /**
24 | * Quick empty object check
25 | */
26 | export function isEmptyObject(obj) {
27 | for (var key in obj) {
28 | if ({}.hasOwnProperty.call(obj, key)) return false;
29 | }
30 | return true;
31 | }
32 |
33 | /**
34 | * Remove an item from an array.
35 | */
36 | export function remove(arr, item) {
37 | if (arr.length) {
38 | const index = arr.indexOf(item);
39 | if (index > -1) {
40 | return arr.splice(index, 1);
41 | }
42 | }
43 | }
44 |
45 | /**
46 | * Check whether an object has the property.
47 | */
48 | const hasOwnProperty = Object.prototype.hasOwnProperty;
49 | export function hasOwn(obj, key) {
50 | return hasOwnProperty.call(obj, key);
51 | }
52 |
--------------------------------------------------------------------------------
/micro-juejin-tryVite/src/main.js:
--------------------------------------------------------------------------------
1 | import { createApp } from 'vue'
2 | import App from './App.vue'
3 | import "./index.css"
4 |
5 |
6 | // import "./public-path";
7 |
8 |
9 | let vm = null;
10 |
11 |
12 | async function VueRender(props = {}) {
13 | const { container } = props;
14 | vm = await createApp(App).mount(container ? container.querySelector("#app") : "#app")
15 | return Promise.resolve()
16 | }
17 |
18 | /*如果不作为微应用加载则直接调用VueRender*/
19 | if (!window.__POWERED_BY_QIANKUN__) {
20 | VueRender().then(()=>{
21 | console.log('作为非微应用加载')
22 | });
23 | }
24 |
25 |
26 | export let onGlobalStateChange;
27 | export let setGlobalState;
28 |
29 |
30 | (global => {
31 | global['purehtml'] = {
32 | bootstrap: (props) => {
33 |
34 | console.log('Vite App bootstrap');
35 | return Promise.resolve();
36 | },
37 | mount: (props) => {
38 | console.log('Vite App mount');
39 | onGlobalStateChange = props.onGlobalStateChange;
40 | setGlobalState = props.setGlobalState;
41 |
42 |
43 | return VueRender(props);
44 | },
45 | unmount: () => {
46 | console.log('Vite App unmount');
47 |
48 |
49 | return Promise.resolve();
50 | },
51 | };
52 | })(window);
53 |
54 |
--------------------------------------------------------------------------------
/micro-juejin-server/src/routers/people.js:
--------------------------------------------------------------------------------
1 | const { mock } = require('mockjs');
2 |
3 | const router = require('koa-router')()
4 | const Mock = require('mockjs')
5 | const Random = Mock.Random
6 | Random.name()
7 | Random.city(true)
8 | const format = 'yyyy-M-d'
9 | Random.boolean()
10 |
11 | Random.extend({
12 | constellation: function(date) {
13 | var constellations = ['白羊座', '金牛座', '双子座', '巨蟹座', '狮子座', '处女座', '天秤座', '天蝎座', '射手座', '摩羯座', '水瓶座', '双鱼座']
14 | return this.pick(constellations)
15 | }
16 | })
17 | Random.constellation()
18 | // => "水瓶座"
19 | Mock.mock('@CONSTELLATION')
20 | // => "天蝎座"
21 |
22 |
23 |
24 |
25 |
26 | router.get('/', async(ctx) => {
27 | ctx.body = 'people index'
28 | })
29 |
30 | router.get('/list', async(ctx) => {
31 | const data = Mock.mock({
32 | // 随机生成5到10个元素
33 | 'list|5-10': [{
34 | 'id|+1': 1,
35 | name: '@name',
36 | address: '@city(true)',
37 | birth: `@date(${format})`,
38 | constellation: '@CONSTELLATION'
39 | }]
40 | })
41 |
42 | /*阻塞接口数据返回*/
43 | await new Promise(resolve=>{
44 | setTimeout(()=>{
45 | resolve()
46 | },1500)
47 | })
48 |
49 | ctx.body = {
50 | code: 0,
51 | data,
52 | }
53 |
54 | })
55 |
56 |
57 | module.exports = router
--------------------------------------------------------------------------------
/micro-juejin-home/src/components/Home/HomeSider/LinkList.vue:
--------------------------------------------------------------------------------
1 |
2 |
27 |
28 |
29 |
32 |
33 |
52 |
--------------------------------------------------------------------------------
/micro-juejin-topic/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "micro-juejin-topic",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "axios": "^0.20.0",
12 | "compression-webpack-plugin": "^5.0.1",
13 | "core-js": "^3.6.5",
14 | "image-webpack-loader": "^6.0.0",
15 | "mockjs": "^1.1.0",
16 | "moment": "^2.27.0",
17 | "vue": "^2.6.11",
18 | "vue-lazyload": "^1.3.3",
19 | "vue-router": "^3.2.0",
20 | "vuex": "^3.4.0"
21 | },
22 | "devDependencies": {
23 | "@vue/cli-plugin-babel": "~4.5.0",
24 | "@vue/cli-plugin-eslint": "~4.5.0",
25 | "@vue/cli-plugin-router": "~4.5.0",
26 | "@vue/cli-plugin-vuex": "~4.5.0",
27 | "@vue/cli-service": "~4.5.0",
28 | "@vue/eslint-config-prettier": "^6.0.0",
29 | "babel-eslint": "^10.1.0",
30 | "eslint": "^6.7.2",
31 | "eslint-plugin-prettier": "^3.1.3",
32 | "eslint-plugin-vue": "^6.2.2",
33 | "lint-staged": "^9.5.0",
34 | "prettier": "^1.19.1",
35 | "sass": "^1.26.5",
36 | "sass-loader": "^8.0.2",
37 | "vue-template-compiler": "^2.6.11"
38 | },
39 | "gitHooks": {
40 | "pre-commit": "lint-staged"
41 | },
42 | "lint-staged": {
43 | "*.{js,jsx,vue}": [
44 | "vue-cli-service lint",
45 | "git add"
46 | ]
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "micro-juejin-brochure",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "axios": "^0.20.0",
12 | "compression-webpack-plugin": "^5.0.1",
13 | "core-js": "^3.6.5",
14 | "image-webpack-loader": "^6.0.0",
15 | "mockjs": "^1.1.0",
16 | "moment": "^2.27.0",
17 | "vue": "^2.6.11",
18 | "vue-lazyload": "^1.3.3",
19 | "vue-router": "^3.2.0",
20 | "vuex": "^3.4.0"
21 | },
22 | "devDependencies": {
23 | "@vue/cli-plugin-babel": "~4.5.0",
24 | "@vue/cli-plugin-eslint": "~4.5.0",
25 | "@vue/cli-plugin-router": "~4.5.0",
26 | "@vue/cli-plugin-vuex": "~4.5.0",
27 | "@vue/cli-service": "~4.5.0",
28 | "@vue/eslint-config-prettier": "^6.0.0",
29 | "babel-eslint": "^10.1.0",
30 | "eslint": "^6.7.2",
31 | "eslint-plugin-prettier": "^3.1.3",
32 | "eslint-plugin-vue": "^6.2.2",
33 | "lint-staged": "^9.5.0",
34 | "prettier": "^1.19.1",
35 | "sass": "^1.26.5",
36 | "sass-loader": "^8.0.2",
37 | "vue-template-compiler": "^2.6.11"
38 | },
39 | "gitHooks": {
40 | "pre-commit": "lint-staged"
41 | },
42 | "lint-staged": {
43 | "*.{js,jsx,vue}": [
44 | "vue-cli-service lint",
45 | "git add"
46 | ]
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/micro-juejin-tryVite/src/components/HelloWorld.vue:
--------------------------------------------------------------------------------
1 |
2 | {{ msg }}
3 |
4 | Edit components/HelloWorld.vue to test hot module replacement.
5 |
6 | PeopleList
7 | (开发环境还在研究跨域...)
8 |
9 |
10 |
15 |
id: {{ people.id }}
16 |
name: {{ people.name }}
17 |
birth: {{ people.birth}}
18 |
address: {{ people.address }}
19 |
constellation: {{ people.constellation }}
20 |
21 |
22 |
23 |
57 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/services/ActivityService.js:
--------------------------------------------------------------------------------
1 | import API from "@/apis";
2 |
3 | export default class ActivityService {
4 | static instance;
5 |
6 | constructor() {}
7 |
8 | /*单例模式获取该service类的实例*/
9 | static getInstance() {
10 | if (!ActivityService.instance) {
11 | ActivityService.instance = new ActivityService();
12 | ActivityService.instance.cursor = "0";
13 | ActivityService.instance.has_more = true;
14 | ActivityService.instance.city = void 0;
15 | }
16 | return ActivityService.instance;
17 | }
18 |
19 | getMonthStat = async from_date => {
20 | const res = await API.activity.getMonthStat(from_date);
21 | return res.list;
22 | };
23 |
24 | getBannerList = async () => {
25 | const res = await API.activity.getBannerList();
26 | return res.list;
27 | };
28 |
29 | getActivityList = async city => {
30 | if (city) {
31 | city = city === "热门活动" ? void 0 : city;
32 | ActivityService.instance.city = city;
33 | ActivityService.instance.has_more = true;
34 | ActivityService.instance.cursor = "0";
35 | } else if (!ActivityService.instance.has_more) {
36 | return false;
37 | }
38 | const res = await API.activity.getActivityList(
39 | 20,
40 | ActivityService.instance.cursor,
41 | ActivityService.instance.city
42 | );
43 | ActivityService.instance.cursor = res.cursor;
44 | ActivityService.instance.has_more = res.has_more;
45 | return res.list;
46 | };
47 | }
48 |
--------------------------------------------------------------------------------
/micro-juejin-home/nginx.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 8071;
3 | server_name localhost;
4 | gzip on;
5 | #压缩级别,1压缩比最小处理速度最快,9压缩比最大但处理最慢,同时也最消耗CPU,一般设置为3就可以了
6 | gzip_comp_level 3;
7 |
8 | # nginx 做前端代理时启用该选项,表示无论后端服务器的headers头返回什么信息,都无条件启用压缩
9 | gzip_proxied any;
10 |
11 | # 什么类型的页面或文档启用压缩
12 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
13 |
14 | # 最小压缩的页面,如果页面过于小,可能会越压越大,这里规定大于1K的页面才启用压缩
15 | gzip_min_length 1024;
16 |
17 | # 设置系统获取几个单位的缓存用于存储gzip的压缩结果数据流
18 | gzip_buffers 16 8k;
19 | proxy_http_version 1.1;
20 | proxy_set_header Upgrade $http_upgrade;
21 | proxy_set_header Connection 'upgrade';
22 | proxy_set_header Host $host;
23 | proxy_set_header X-Real-IP $remote_addr;
24 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
25 | proxy_set_header X-Forwarded-Proto $scheme;
26 | proxy_cache_bypass $http_upgrade;
27 |
28 | location / {
29 | root /usr/local/nginx/html/home;
30 | try_files $uri $uri/ /index.html;
31 | add_header 'Access-Control-Allow-Origin' '*';
32 | add_header 'Access-Control-Allow-Credentials' 'true';
33 |
34 | }
35 |
36 | location ^~ /api/micro-juejin-home{
37 | rewrite ^/api/micro-juejin-home/(.*) /api/$1 break;
38 | proxy_pass http://localhost:3000;
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/micro-juejin-topic/nginx.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 8073;
3 | server_name localhost;
4 | gzip on;
5 | #压缩级别,1压缩比最小处理速度最快,9压缩比最大但处理最慢,同时也最消耗CPU,一般设置为3就可以了
6 | gzip_comp_level 3;
7 |
8 | # nginx 做前端代理时启用该选项,表示无论后端服务器的headers头返回什么信息,都无条件启用压缩
9 | gzip_proxied any;
10 |
11 | # 什么类型的页面或文档启用压缩
12 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
13 |
14 | # 最小压缩的页面,如果页面过于小,可能会越压越大,这里规定大于1K的页面才启用压缩
15 | gzip_min_length 1024;
16 |
17 | # 设置系统获取几个单位的缓存用于存储gzip的压缩结果数据流
18 | gzip_buffers 16 8k;
19 | proxy_http_version 1.1;
20 | proxy_set_header Upgrade $http_upgrade;
21 | proxy_set_header Connection 'upgrade';
22 | proxy_set_header Host $host;
23 | proxy_set_header X-Real-IP $remote_addr;
24 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
25 | proxy_set_header X-Forwarded-Proto $scheme;
26 | proxy_cache_bypass $http_upgrade;
27 |
28 | location / {
29 | root /usr/local/nginx/html/topic;
30 | try_files $uri $uri/ /index.html;
31 | add_header 'Access-Control-Allow-Origin' '*';
32 | add_header 'Access-Control-Allow-Credentials' 'true';
33 |
34 | }
35 |
36 | location ^~ /api/micro-juejin-topic{
37 | rewrite ^/api/micro-juejin-topic/(.*) /api/$1 break;
38 | proxy_pass http://localhost:3000;
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/nginx.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 8072;
3 | server_name localhost;
4 | gzip on;
5 | #压缩级别,1压缩比最小处理速度最快,9压缩比最大但处理最慢,同时也最消耗CPU,一般设置为3就可以了
6 | gzip_comp_level 3;
7 |
8 | # nginx 做前端代理时启用该选项,表示无论后端服务器的headers头返回什么信息,都无条件启用压缩
9 | gzip_proxied any;
10 |
11 | # 什么类型的页面或文档启用压缩
12 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
13 |
14 | # 最小压缩的页面,如果页面过于小,可能会越压越大,这里规定大于1K的页面才启用压缩
15 | gzip_min_length 1024;
16 |
17 | # 设置系统获取几个单位的缓存用于存储gzip的压缩结果数据流
18 | gzip_buffers 16 8k;
19 | proxy_http_version 1.1;
20 | proxy_set_header Upgrade $http_upgrade;
21 | proxy_set_header Connection 'upgrade';
22 | proxy_set_header Host $host;
23 | proxy_set_header X-Real-IP $remote_addr;
24 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
25 | proxy_set_header X-Forwarded-Proto $scheme;
26 | proxy_cache_bypass $http_upgrade;
27 |
28 | location / {
29 | root /usr/local/nginx/html/boiling;
30 | try_files $uri $uri/ /index.html;
31 | add_header 'Access-Control-Allow-Origin' '*';
32 | add_header 'Access-Control-Allow-Credentials' 'true';
33 |
34 | }
35 |
36 | location ^~ /api/micro-juejin-boiling{
37 | rewrite ^/api/micro-juejin-boiling/(.*) /api/$1 break;
38 | proxy_pass http://localhost:3000;
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/micro-juejin-tryVite/nginx.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 8076;
3 | server_name localhost;
4 | gzip on;
5 | #压缩级别,1压缩比最小处理速度最快,9压缩比最大但处理最慢,同时也最消耗CPU,一般设置为3就可以了
6 | gzip_comp_level 3;
7 |
8 | # nginx 做前端代理时启用该选项,表示无论后端服务器的headers头返回什么信息,都无条件启用压缩
9 | gzip_proxied any;
10 |
11 | # 什么类型的页面或文档启用压缩
12 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
13 |
14 | # 最小压缩的页面,如果页面过于小,可能会越压越大,这里规定大于1K的页面才启用压缩
15 | gzip_min_length 1024;
16 |
17 | # 设置系统获取几个单位的缓存用于存储gzip的压缩结果数据流
18 | gzip_buffers 16 8k;
19 | proxy_http_version 1.1;
20 | proxy_set_header Upgrade $http_upgrade;
21 | proxy_set_header Connection 'upgrade';
22 | proxy_set_header Host $host;
23 | proxy_set_header X-Real-IP $remote_addr;
24 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
25 | proxy_set_header X-Forwarded-Proto $scheme;
26 | proxy_cache_bypass $http_upgrade;
27 |
28 | location / {
29 | root /usr/local/nginx/html/tryVite;
30 | try_files $uri $uri/ /index.html;
31 | add_header 'Access-Control-Allow-Origin' '*';
32 | add_header 'Access-Control-Allow-Credentials' 'true';
33 |
34 | }
35 |
36 | location ^~ /api/micro-juejin-tryVite{
37 | rewrite ^/api/micro-juejin-tryVite/(.*) /api/$1 break;
38 | proxy_pass http://localhost:3000;
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/micro-juejin-activity/nginx.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 8075;
3 | server_name localhost;
4 | gzip on;
5 | #压缩级别,1压缩比最小处理速度最快,9压缩比最大但处理最慢,同时也最消耗CPU,一般设置为3就可以了
6 | gzip_comp_level 3;
7 |
8 | # nginx 做前端代理时启用该选项,表示无论后端服务器的headers头返回什么信息,都无条件启用压缩
9 | gzip_proxied any;
10 |
11 | # 什么类型的页面或文档启用压缩
12 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
13 |
14 | # 最小压缩的页面,如果页面过于小,可能会越压越大,这里规定大于1K的页面才启用压缩
15 | gzip_min_length 1024;
16 |
17 | # 设置系统获取几个单位的缓存用于存储gzip的压缩结果数据流
18 | gzip_buffers 16 8k;
19 | proxy_http_version 1.1;
20 | proxy_set_header Upgrade $http_upgrade;
21 | proxy_set_header Connection 'upgrade';
22 | proxy_set_header Host $host;
23 | proxy_set_header X-Real-IP $remote_addr;
24 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
25 | proxy_set_header X-Forwarded-Proto $scheme;
26 | proxy_cache_bypass $http_upgrade;
27 |
28 | location / {
29 | root /usr/local/nginx/html/activity;
30 | try_files $uri $uri/ /index.html;
31 | add_header 'Access-Control-Allow-Origin' '*';
32 | add_header 'Access-Control-Allow-Credentials' 'true';
33 |
34 | }
35 |
36 | location ^~ /api/micro-juejin-activity{
37 | rewrite ^/api/micro-juejin-activity/(.*) /api/$1 break;
38 | proxy_pass http://localhost:3000;
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/nginx.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 8074;
3 | server_name localhost;
4 | gzip on;
5 | #压缩级别,1压缩比最小处理速度最快,9压缩比最大但处理最慢,同时也最消耗CPU,一般设置为3就可以了
6 | gzip_comp_level 3;
7 |
8 | # nginx 做前端代理时启用该选项,表示无论后端服务器的headers头返回什么信息,都无条件启用压缩
9 | gzip_proxied any;
10 |
11 | # 什么类型的页面或文档启用压缩
12 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
13 |
14 | # 最小压缩的页面,如果页面过于小,可能会越压越大,这里规定大于1K的页面才启用压缩
15 | gzip_min_length 1024;
16 |
17 | # 设置系统获取几个单位的缓存用于存储gzip的压缩结果数据流
18 | gzip_buffers 16 8k;
19 | proxy_http_version 1.1;
20 | proxy_set_header Upgrade $http_upgrade;
21 | proxy_set_header Connection 'upgrade';
22 | proxy_set_header Host $host;
23 | proxy_set_header X-Real-IP $remote_addr;
24 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
25 | proxy_set_header X-Forwarded-Proto $scheme;
26 | proxy_cache_bypass $http_upgrade;
27 |
28 | location / {
29 | root /usr/local/nginx/html/brochure;
30 | try_files $uri $uri/ /index.html;
31 | add_header 'Access-Control-Allow-Origin' '*';
32 | add_header 'Access-Control-Allow-Credentials' 'true';
33 |
34 | }
35 |
36 | location ^~ /api/micro-juejin-brochure{
37 | rewrite ^/api/micro-juejin-brochure/(.*) /api/$1 break;
38 | proxy_pass http://localhost:3000;
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/micro-juejin-main/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "micro-juejin-main",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "ant-design-vue": "^1.6.5",
12 | "axios": "^0.20.0",
13 | "babel-plugin-import": "^1.13.0",
14 | "compression-webpack-plugin": "^5.0.1",
15 | "core-js": "^3.6.5",
16 | "image-webpack-loader": "^6.0.0",
17 | "less": "^3.12.2",
18 | "less-loader": "^7.0.0",
19 | "mockjs": "^1.1.0",
20 | "moment": "^2.27.0",
21 | "qiankun": "^2.0.24",
22 | "vue": "^2.6.11",
23 | "vue-router": "^3.2.0",
24 | "vuex": "^3.4.0"
25 | },
26 | "devDependencies": {
27 | "@vue/cli-plugin-babel": "~4.5.0",
28 | "@vue/cli-plugin-eslint": "~4.5.0",
29 | "@vue/cli-plugin-router": "~4.5.0",
30 | "@vue/cli-plugin-vuex": "~4.5.0",
31 | "@vue/cli-service": "~4.5.0",
32 | "@vue/eslint-config-prettier": "^6.0.0",
33 | "babel-eslint": "^10.1.0",
34 | "eslint": "^6.7.2",
35 | "eslint-plugin-prettier": "^3.1.3",
36 | "eslint-plugin-vue": "^6.2.2",
37 | "lint-staged": "^9.5.0",
38 | "prettier": "^1.19.1",
39 | "sass": "^1.26.5",
40 | "sass-loader": "^8.0.2",
41 | "vue-template-compiler": "^2.6.11"
42 | },
43 | "gitHooks": {
44 | "pre-commit": "lint-staged"
45 | },
46 | "lint-staged": {
47 | "*.{js,jsx,vue}": [
48 | "vue-cli-service lint",
49 | "git add"
50 | ]
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/components/common/Loading.vue:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
22 |
73 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/components/common/Loading.vue:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
22 |
73 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/components/common/Loading.vue:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
22 |
73 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/components/common/Loading.vue:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
22 |
73 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/components/common/Loading.vue:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
22 |
73 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/components/common/Loading.vue:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
22 |
73 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "micro-juejin-boiling",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "ant-design-vue": "^1.6.5",
12 | "axios": "^0.20.0",
13 | "compression-webpack-plugin": "^5.0.1",
14 | "core-js": "^3.6.5",
15 | "image-webpack-loader": "^6.0.0",
16 | "less": "^3.12.2",
17 | "less-loader": "^7.0.1",
18 | "mockjs": "^1.1.0",
19 | "moment": "^2.27.0",
20 | "vue": "^2.6.11",
21 | "vue-lazyload": "^1.3.3",
22 | "vue-router": "^3.2.0",
23 | "vue-virtual-scroller": "^1.0.10",
24 | "vuex": "^3.4.0"
25 | },
26 | "devDependencies": {
27 | "@vue/cli-plugin-babel": "~4.5.0",
28 | "@vue/cli-plugin-eslint": "~4.5.0",
29 | "@vue/cli-plugin-router": "~4.5.0",
30 | "@vue/cli-plugin-vuex": "~4.5.0",
31 | "@vue/cli-service": "~4.5.0",
32 | "@vue/eslint-config-prettier": "^6.0.0",
33 | "babel-eslint": "^10.1.0",
34 | "babel-plugin-import": "^1.13.0",
35 | "eslint": "^6.7.2",
36 | "eslint-plugin-prettier": "^3.1.3",
37 | "eslint-plugin-vue": "^6.2.2",
38 | "lint-staged": "^9.5.0",
39 | "prettier": "^1.19.1",
40 | "sass": "^1.26.5",
41 | "sass-loader": "^8.0.2",
42 | "vue-template-compiler": "^2.6.11"
43 | },
44 | "gitHooks": {
45 | "pre-commit": "lint-staged"
46 | },
47 | "lint-staged": {
48 | "*.{js,jsx,vue}": [
49 | "vue-cli-service lint",
50 | "git add"
51 | ]
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/micro-juejin-activity/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "micro-juejin-activity",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "ant-design-vue": "^1.6.5",
12 | "axios": "^0.20.0",
13 | "babel-plugin-import": "^1.13.0",
14 | "compression-webpack-plugin": "^5.0.1",
15 | "core-js": "^3.6.5",
16 | "image-webpack-loader": "^6.0.0",
17 | "less": "^3.12.2",
18 | "less-loader": "^7.0.1",
19 | "mockjs": "^1.1.0",
20 | "moment": "^2.27.0",
21 | "moment-locales-webpack-plugin": "^1.2.0",
22 | "vue": "^2.6.11",
23 | "vue-lazyload": "^1.3.3",
24 | "vue-router": "^3.2.0",
25 | "vuex": "^3.4.0"
26 | },
27 | "devDependencies": {
28 | "@vue/cli-plugin-babel": "~4.5.0",
29 | "@vue/cli-plugin-eslint": "~4.5.0",
30 | "@vue/cli-plugin-router": "~4.5.0",
31 | "@vue/cli-plugin-vuex": "~4.5.0",
32 | "@vue/cli-service": "~4.5.0",
33 | "@vue/eslint-config-prettier": "^6.0.0",
34 | "babel-eslint": "^10.1.0",
35 | "eslint": "^6.7.2",
36 | "eslint-plugin-prettier": "^3.1.3",
37 | "eslint-plugin-vue": "^6.2.2",
38 | "lint-staged": "^9.5.0",
39 | "prettier": "^1.19.1",
40 | "sass": "^1.26.5",
41 | "sass-loader": "^8.0.2",
42 | "vue-template-compiler": "^2.6.11"
43 | },
44 | "gitHooks": {
45 | "pre-commit": "lint-staged"
46 | },
47 | "lint-staged": {
48 | "*.{js,jsx,vue}": [
49 | "vue-cli-service lint",
50 | "git add"
51 | ]
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/main.js:
--------------------------------------------------------------------------------
1 | import "./public-path";
2 | import Vue from "vue";
3 | import VueRouter from "vue-router";
4 | import App from "./App.vue";
5 | import { routes } from "./router";
6 | import store from "@/store";
7 | import "@/filter";
8 | import "@/shared/registAntd";
9 | import "@/shared/initLazyLoad";
10 |
11 | const packageName = require("../package.json").name;
12 |
13 | Vue.config.productionTip = false;
14 |
15 | let router = null;
16 | let instance = null;
17 |
18 | function VueRender(props = {}) {
19 | const { container } = props;
20 | router = new VueRouter({
21 | base: window.__POWERED_BY_QIANKUN__ ? `/${packageName}` : "",
22 | mode: "history",
23 | routes
24 | });
25 |
26 | instance = new Vue({
27 | router,
28 | store,
29 | render: h => h(App)
30 | }).$mount(container ? container.querySelector("#app") : "#app");
31 | }
32 |
33 | /*如果不作为微应用加载则直接调用VueRender*/
34 | if (!window.__POWERED_BY_QIANKUN__) {
35 | VueRender();
36 | }
37 |
38 | /*
39 | * 微应用必须暴露加载的生命周期hooks
40 | *
41 | * */
42 | export async function bootstrap() {
43 | console.log("[vue] vue app bootstraped");
44 | }
45 |
46 | /*暴露监听全局状态变化的方法,让局部组件得意实现局部监听*/
47 | export let onGlobalStateChange;
48 |
49 | /*暴露修改全局状态的方法,让局部组件可以修改全局状态*/
50 | export let setGlobalState;
51 |
52 | export async function mount(props) {
53 | onGlobalStateChange = props.onGlobalStateChange;
54 | setGlobalState = props.setGlobalState;
55 | console.log("[vue] props from main framework", props);
56 | VueRender(props);
57 |
58 | }
59 |
60 | export async function unmount() {
61 | instance.$destroy();
62 | instance = null;
63 | router = null;
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/main.js:
--------------------------------------------------------------------------------
1 | import "./public-path";
2 | import Vue from "vue";
3 | import VueRouter from "vue-router";
4 | import App from "./App.vue";
5 | import { routes } from "./router";
6 | import store from "@/store";
7 | import "@/filter";
8 | import "@/shared/initLazyLoad";
9 |
10 | import "@/shared/registAntd";
11 |
12 | const packageName = require("../package.json").name;
13 |
14 | Vue.config.productionTip = false;
15 |
16 | let router = null;
17 | let instance = null;
18 |
19 | function VueRender(props = {}) {
20 | const { container } = props;
21 | router = new VueRouter({
22 | base: window.__POWERED_BY_QIANKUN__ ? `/${packageName}` : "",
23 | mode: "history",
24 | routes
25 | });
26 |
27 | instance = new Vue({
28 | router,
29 | store,
30 | render: h => h(App)
31 | }).$mount(container ? container.querySelector("#app") : "#app");
32 | }
33 |
34 | /*如果不作为微应用加载则直接调用VueRender*/
35 | if (!window.__POWERED_BY_QIANKUN__) {
36 | VueRender();
37 | }
38 |
39 | /*
40 | * 微应用必须暴露加载的生命周期hooks
41 | *
42 | * */
43 | export async function bootstrap() {
44 | console.log("[vue] vue app bootstraped");
45 | }
46 |
47 | /*暴露监听全局状态变化的方法,让局部组件得意实现局部监听*/
48 | export let onGlobalStateChange;
49 |
50 | /*暴露修改全局状态的方法,让局部组件可以修改全局状态*/
51 | export let setGlobalState;
52 |
53 | export async function mount(props) {
54 | onGlobalStateChange = props.onGlobalStateChange;
55 | setGlobalState = props.setGlobalState;
56 |
57 | console.log("[vue] props from main framework", props);
58 | VueRender(props);
59 |
60 | }
61 |
62 | export async function unmount() {
63 | instance.$destroy();
64 | instance = null;
65 | router = null;
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/components/Activity/ActivityList.vue:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
56 |
57 |
65 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/components/Boiling/BoilingSider/GuideCard.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 | 如何玩转沸点
11 |
12 |
13 |
14 |
17 |
18 |
31 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/main.js:
--------------------------------------------------------------------------------
1 | import "./public-path";
2 | import Vue from "vue";
3 | import VueRouter from "vue-router";
4 | import App from "./App.vue";
5 | import { routes } from "./router";
6 | import store from "@/store";
7 | import "@/filter";
8 | import "@/shared/initLazyLoad";
9 |
10 | const packageName = require("../package.json").name;
11 |
12 | Vue.config.productionTip = false;
13 |
14 | let router = null;
15 | let instance = null;
16 |
17 | function VueRender(props = {}) {
18 | const { container } = props;
19 | router = new VueRouter({
20 | base: window.__POWERED_BY_QIANKUN__ ? `/${packageName}` : "",
21 | mode: "history",
22 | routes
23 | });
24 |
25 | instance = new Vue({
26 | router,
27 | store,
28 | render: h => h(App)
29 | }).$mount(container ? container.querySelector("#app") : "#app");
30 | }
31 |
32 | /*如果不作为微应用加载则直接调用VueRender*/
33 | if (!window.__POWERED_BY_QIANKUN__) {
34 | VueRender();
35 | }
36 |
37 | /*
38 | * 微应用必须暴露加载的生命周期hooks
39 | *
40 | * */
41 | export async function bootstrap() {
42 | console.log("[vue] vue app bootstraped");
43 | }
44 |
45 | /*暴露监听全局状态变化的方法,让局部组件得意实现局部监听*/
46 | export let onGlobalStateChange;
47 |
48 | /*改变全局状态
49 | * setGlobalState: (state: Record) => boolean, 按一级属性设置全局状态,微应用中只能修改已存在的一级属性
50 | * */
51 | export let setGlobalState;
52 |
53 | export async function mount(props) {
54 | onGlobalStateChange = props.onGlobalStateChange;
55 | setGlobalState = props.setGlobalState;
56 | console.log("[vue] props from main framework", props);
57 | VueRender(props);
58 |
59 | }
60 |
61 | export async function unmount() {
62 | instance.$destroy();
63 | instance = null;
64 | router = null;
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/components/common/FLIPWrapper.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 🦄 EMPTY 😱😱😱😱😱😱😱
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
39 |
40 |
77 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/components/common/FLIPWrapper.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 🦄 EMPTY 😱😱😱😱😱😱😱
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
39 |
40 |
77 |
--------------------------------------------------------------------------------
/micro-juejin-main/src/layouts/BasicLayout/WriteButton.vue:
--------------------------------------------------------------------------------
1 |
2 |
27 |
28 |
47 |
66 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/views/Boiling.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
31 |
32 |
41 |
79 |
--------------------------------------------------------------------------------
/micro-juejin-home/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "micro-juejin-home",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "ant-design-vue": "^1.6.5",
12 | "axios": "^0.20.0",
13 | "babel-plugin-import": "^1.13.0",
14 | "compression-webpack-plugin": "^5.0.1",
15 | "core-js": "^3.6.5",
16 | "image-webpack-loader": "^6.0.0",
17 | "less": "^3.12.2",
18 | "less-loader": "^7.0.1",
19 | "mockjs": "^1.1.0",
20 | "moment": "^2.27.0",
21 | "sass-resources-loader": "^2.1.0",
22 | "style-resources-loader": "^1.3.3",
23 | "vue": "^2.6.11",
24 | "vue-cli-plugin-style-resources-loader": "^0.1.4",
25 | "vue-lazyload": "^1.3.3",
26 | "vue-router": "^3.2.0",
27 | "vue-virtual-scroller": "^1.0.10",
28 | "vuex": "^3.4.0"
29 | },
30 | "devDependencies": {
31 | "@vue/cli-plugin-babel": "~4.5.0",
32 | "@vue/cli-plugin-eslint": "~4.5.0",
33 | "@vue/cli-plugin-router": "~4.5.0",
34 | "@vue/cli-plugin-vuex": "~4.5.0",
35 | "@vue/cli-service": "~4.5.0",
36 | "@vue/eslint-config-prettier": "^6.0.0",
37 | "babel-eslint": "^10.1.0",
38 | "eslint": "^6.7.2",
39 | "eslint-plugin-prettier": "^3.1.3",
40 | "eslint-plugin-vue": "^6.2.2",
41 | "lint-staged": "^9.5.0",
42 | "prettier": "^1.19.1",
43 | "sass": "^1.26.5",
44 | "sass-loader": "^8.0.2",
45 | "vue-template-compiler": "^2.6.11"
46 | },
47 | "gitHooks": {
48 | "pre-commit": "lint-staged"
49 | },
50 | "lint-staged": {
51 | "*.{js,jsx,vue}": [
52 | "vue-cli-service lint",
53 | "git add"
54 | ]
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/components/Home/HomeSider/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
40 |
41 |
60 |
--------------------------------------------------------------------------------
/micro-juejin-topic/src/main.js:
--------------------------------------------------------------------------------
1 | import "./public-path";
2 | import Vue from "vue";
3 | import VueRouter from "vue-router";
4 | import App from "./App.vue";
5 | import { routes } from "./router";
6 | import store from "@/store";
7 | import "@/filter";
8 |
9 | import "@/shared/initLazyLoad";
10 |
11 | const packageName = require("../package.json").name;
12 |
13 | Vue.config.productionTip = false;
14 |
15 | let router = null;
16 | let instance = null;
17 |
18 | function VueRender(props = {}) {
19 | const { container } = props;
20 | router = new VueRouter({
21 | base: window.__POWERED_BY_QIANKUN__ ? `/${packageName}` : "",
22 | mode: "history",
23 | routes
24 | });
25 |
26 | instance = new Vue({
27 | router,
28 | store,
29 | render: h => h(App)
30 | }).$mount(container ? container.querySelector("#app") : "#app");
31 | }
32 |
33 | /*如果不作为微应用加载则直接调用VueRender*/
34 | if (!window.__POWERED_BY_QIANKUN__) {
35 | VueRender();
36 | }
37 |
38 | /*
39 | * 微应用必须暴露加载的生命周期hooks
40 | *
41 | * */
42 | export async function bootstrap() {
43 | console.log("[vue] vue app bootstraped");
44 | }
45 |
46 | /*暴露监听全局状态变化的方法,让局部组件得意实现局部监听*/
47 | export let onGlobalStateChange;
48 |
49 | /*暴露修改全局状态的方法,让局部组件可以修改全局状态*/
50 | export let setGlobalState;
51 |
52 | export async function mount(props) {
53 | onGlobalStateChange = props.onGlobalStateChange;
54 | setGlobalState = props.setGlobalState;
55 | console.log("[vue] props from main framework", props);
56 | VueRender(props);
57 |
58 | //这里加载完毕后可以改变全局的状态通知主应用让其Loading组件消失
59 | setGlobalState({ isLoadingMicro: false });
60 | }
61 |
62 | export async function unmount() {
63 | instance.$destroy();
64 | instance = null;
65 | router = null;
66 |
67 | //这里微应用注销后通知主应用让其Loading组件出现
68 | setGlobalState({ isLoadingMicro: true });
69 | }
70 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/views/Brochure.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
22 |
30 |
81 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/components/People/PeopleList.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
13 |
id: {{ people.id }}
14 |
name: {{ people.name }}
15 |
birth: {{ people.birth | formatDate("YYYY年 M月 D日") }}
16 |
address: {{ people.address }}
17 |
constellation: {{ people.constellation }}
18 |
19 |
20 |
21 |
22 |
67 |
72 |
--------------------------------------------------------------------------------
/micro-juejin-main/nginx.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 80;
3 | server_name localhost;
4 | gzip on;
5 | #压缩级别,1压缩比最小处理速度最快,9压缩比最大但处理最慢,同时也最消耗CPU,一般设置为3就可以了
6 | gzip_comp_level 3;
7 |
8 | # nginx 做前端代理时:启用该选项,表示无论后端服务器的headers头返回什么信息,都无条件启用压缩
9 | gzip_proxied any;
10 |
11 | # 什么类型的页面或文档启用压缩
12 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
13 |
14 | # 最小压缩的页面,如果页面过于小,可能会越压越大,这里规定大于1K的页面才启用压缩
15 | gzip_min_length 1024;
16 |
17 | # 设置系统获取几个单位的缓存用于存储gzip的压缩结果数据流
18 | gzip_buffers 16 8k;
19 | proxy_http_version 1.1;
20 | proxy_set_header Upgrade $http_upgrade;
21 | proxy_set_header Connection 'upgrade';
22 | proxy_set_header Host $host;
23 | proxy_set_header X-Real-IP $remote_addr;
24 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
25 | proxy_set_header X-Forwarded-Proto $scheme;
26 | proxy_cache_bypass $http_upgrade;
27 |
28 | location / {
29 | root /usr/local/nginx/html/main;
30 | try_files $uri $uri/ /index.html;
31 | }
32 |
33 |
34 | location ^~ /api/micro-juejin-home {
35 | proxy_pass http://localhost:8071;
36 | }
37 |
38 | location ^~ /api/micro-juejin-boiling {
39 | proxy_pass http://localhost:8072;
40 | }
41 |
42 | location ^~ /api/micro-juejin-topic {
43 | proxy_pass http://localhost:8073;
44 | }
45 |
46 | location ^~ /api/micro-juejin-brochure {
47 | proxy_pass http://localhost:8074;
48 | }
49 |
50 | location ^~ /api/micro-juejin-activity {
51 | proxy_pass http://localhost:8075;
52 | }
53 |
54 |
55 | }
56 |
57 |
58 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/components/People/PeopleList.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
13 |
id: {{ people.id }}
14 |
name: {{ people.name }}
15 |
birth: {{ people.birth | formatDate("YYYY年 M月 D日") }}
16 |
address: {{ people.address }}
17 |
constellation: {{ people.constellation }}
18 |
19 |
20 |
21 |
22 |
67 |
72 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/views/Activity.vue:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
23 |
33 |
43 |
80 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/components/Boiling/BoilingMain/BoilingList.vue:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
21 |
57 |
58 |
67 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/components/Boiling/NavBar.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 | {{ nav }}
11 |
12 |
13 |
14 |
15 |
16 |
17 |
65 |
66 |
79 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/components/Home/HomeMain/NavTabs.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
热门
9 |
最新
15 |
热榜
24 |
25 |
26 |
27 |
55 |
56 |
86 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/main.js:
--------------------------------------------------------------------------------
1 | import "./public-path";
2 | import Vue from "vue";
3 | import VueRouter from "vue-router";
4 | import App from "./App.vue";
5 | import { routes } from "./router";
6 | import store from "@/store";
7 | import "@/filter";
8 | import "@/shared/initLazyLoad";
9 |
10 | import "@/shared/registAntd";
11 |
12 | const packageName = require("../package.json").name;
13 |
14 | Vue.config.productionTip = false;
15 |
16 | let router = null;
17 | let instance = null;
18 |
19 | function VueRender(props = {}) {
20 | const { container } = props;
21 | router = new VueRouter({
22 | base: window.__POWERED_BY_QIANKUN__ ? `/${packageName}` : "",
23 | mode: "history",
24 | routes
25 | });
26 |
27 | instance = new Vue({
28 | router,
29 | store,
30 | render: h => h(App)
31 | }).$mount(container ? container.querySelector("#app") : "#app");
32 | }
33 |
34 | /*如果不作为微应用加载则直接调用VueRender*/
35 | if (!window.__POWERED_BY_QIANKUN__) {
36 | VueRender();
37 | }
38 |
39 | /*
40 | * 微应用必须暴露加载的生命周期hooks
41 | *
42 | * */
43 | export async function bootstrap() {
44 | console.log("[vue] vue app bootstraped");
45 | }
46 |
47 | /*监听全局状态变化
48 | * onGlobalStateChange: (callback: OnGlobalStateChangeCallback, fireImmediately?: boolean) => void, 在当前应用监听全局状态,有变更触发 callback,fireImmediately = true 立即触发 callback
49 | *
50 | * callback(state,prev)
51 | * @params {Object} state //变更后的全局状态对象
52 | * @params {Object} prev //变更前的全局状态对象
53 | *
54 | * 这里用export暴露给子组件调用,下同
55 | * */
56 | export let onGlobalStateChange;
57 |
58 | /*改变全局状态
59 | * setGlobalState: (state: Record) => boolean, 按一级属性设置全局状态,微应用中只能修改已存在的一级属性
60 | * */
61 | export let setGlobalState;
62 |
63 | export async function mount(props) {
64 | onGlobalStateChange = props.onGlobalStateChange;
65 | setGlobalState = props.setGlobalState;
66 |
67 | console.log("[vue] props from main framework", props);
68 | VueRender(props);
69 |
70 | }
71 |
72 | export async function unmount() {
73 | instance.$destroy();
74 | instance = null;
75 | router = null;
76 | }
77 |
--------------------------------------------------------------------------------
/micro-juejin-activity/src/components/Activity/ADCarousel.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
![screenShot]()
17 |
18 |
19 |
20 |
21 |
22 |
23 |
42 |
43 |
59 |
81 |
82 |
--------------------------------------------------------------------------------
/micro-juejin-brochure/src/components/Brochure/BrochureList.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 | 🦄 没有更多小册了 😱😱😱😱😱😱😱
11 |
12 |
13 |
14 |
15 |
52 |
53 |
84 |
--------------------------------------------------------------------------------
/micro-juejin-server/src/routers/activity.js:
--------------------------------------------------------------------------------
1 | const axios = require('axios')
2 |
3 | const router = require('koa-router')()
4 | const qs = require('querystring')
5 |
6 |
7 | router.get('/bannerList', async ctx => {
8 | const res = await axios.get('https://apinew.juejin.im/event_api/v1/event/banner_list')
9 | ctx.body = {
10 | code: 0,
11 | data: {
12 | list: res.data.data,
13 | err_msg: res.data.err_msg,
14 | err_no: res.data.err_no
15 | }
16 | }
17 | })
18 |
19 | router.get('/monthStat', async ctx => {
20 | const res = await axios.post('https://apinew.juejin.im/event_api/v1/event/month_stat',{
21 | days: 42,
22 | from_date: ctx.query.from_date
23 | })
24 |
25 | ctx.body = {
26 | code: 0,
27 | data: {
28 | list: res.data.data,
29 | err_msg: res.data.err_msg,
30 | err_no: res.data.err_no
31 | }
32 | }
33 | })
34 |
35 | router.get('/activityList', async ctx => {
36 | try{
37 | const postData = {
38 | "count":~~ctx.query.limit || 20,
39 | "cursor":~~ctx.query.cursor,
40 | }
41 | ctx.query.city !=='undefined' && (postData.city = ctx.query.city)
42 | const res = await axios.post('https://apinew.juejin.im/event_api/v1/event/event_list',postData
43 | ,{
44 | headers:{
45 | 'Content-Type': 'application/json'
46 | },
47 | })
48 | const list = res.data.data.map(item => {
49 | return {
50 | ...item,
51 | id:item.id + ctx.query.cursor.toString()
52 | }
53 | })
54 | ctx.body = {
55 | code: 0,
56 | data: {
57 | cursor: res.data.cursor,
58 | list: list,
59 | has_more: res.data.has_more
60 | }
61 | }
62 | }catch (e){
63 | console.log('出错了!!!!!!!')
64 | console.log(e)
65 | ctx.body = {
66 | code: 500,
67 | data: {
68 | error:e
69 | }
70 | }
71 | }
72 | })
73 |
74 |
75 |
76 | module.exports = router
--------------------------------------------------------------------------------
/micro-juejin-topic/src/components/Topic/TopicCard.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
{{ topic.title }}
18 |
19 | {{ topic.follower_count + isFollowed }} 关注 ·
20 | {{ topic.msg_count }} 沸点
21 |
22 |
27 | {{ isFollowed ? "已关注" : "+ 关注" }}
28 |
29 |
30 |
31 |
32 |
33 |
43 |
44 |
91 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/components/Home/HomeSider/MoreBlock.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
23 |
26 |
33 |
36 |
37 |
38 |
43 |
44 |

50 |
51 |
52 |
53 |
56 |
57 |
79 |
--------------------------------------------------------------------------------
/micro-juejin-home/src/components/Home/HomeMain/ArticleList.vue:
--------------------------------------------------------------------------------
1 |
2 |
21 |
22 |
23 |
61 |
62 |
77 |
85 |
--------------------------------------------------------------------------------
/micro-juejin-boiling/src/components/Boiling/BoilingSider/UserCard.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
19 |
33 |
34 |
35 |
36 |
39 |
40 |
97 |
--------------------------------------------------------------------------------