-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
1,227 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
NODE_ENV = 'development' | ||
BASE_URL = '/' | ||
VUE_APP_BASE_API = '' | ||
VUE_APP_BASE_API = '/dev-api' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
VUE_CLI_BABEL_TRANSPILE_MODULES = true | ||
NODE_ENV = 'development' | ||
BASE_URL = '/' | ||
VUE_APP_BASE_API = '' | ||
VUE_APP_BASE_API = '/dev-api' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
NODE_ENV = 'production' | ||
BASE_URL = './' | ||
VUE_APP_BASE_API = 'https://easy-mock.com/' | ||
VUE_APP_BASE_API = '/prod-api' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,26 @@ | ||
# vue-cli-h5 | ||
- [x] 自动注册路由表 | ||
- [x] 自动注册Vuex | ||
- [x] 鉴权处理、登录拦截 | ||
- [x] 页面切换动画 | ||
- [x] 常用目录别名 | ||
- [x] Vant | ||
- [x] Rem适配 | ||
- [x] 全局scss | ||
- [x] 页面Title | ||
- [x] axios封装 | ||
- [x] mock-server | ||
- [x] SVG图标组件 | ||
- [x] 通用登录页面 | ||
- [x] 通用列表页(集成vo-pages) | ||
- [x] V-console | ||
- [x] Dayjs? | ||
- [x] 跨域处理 | ||
- [x] 404页面 | ||
- [x] Lazyload | ||
### 线上环境优化 | ||
|
||
## Project setup | ||
``` | ||
yarn install | ||
``` | ||
|
||
### Compiles and hot-reloads for development | ||
``` | ||
yarn run serve | ||
``` | ||
|
||
### Compiles and minifies for production | ||
``` | ||
yarn run build | ||
``` | ||
|
||
### Run your tests | ||
``` | ||
yarn run test | ||
``` | ||
|
||
### Lints and fixes files | ||
``` | ||
yarn run lint | ||
``` | ||
|
||
### Customize configuration | ||
See [Configuration Reference](https://cli.vuejs.org/config/). | ||
- [x] CDN引入 | ||
- [x] 资源压缩 | ||
- [x] console.log去除 | ||
- [x] gzip | ||
- [x] 关闭 sourcemap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import Mock from 'mockjs' | ||
import { deepClone } from '../../src/utils/index.js' | ||
import { asyncRoutes, constantRoutes } from './routes.js' | ||
|
||
const routes = deepClone([...constantRoutes, ...asyncRoutes]) | ||
|
||
const roles = [ | ||
{ | ||
key: 'admin', | ||
name: 'admin', | ||
description: 'Super Administrator. Have access to view all pages.', | ||
routes: routes | ||
}, | ||
{ | ||
key: 'editor', | ||
name: 'editor', | ||
description: 'Normal Editor. Can see all pages except permission page', | ||
routes: routes.filter(i => i.path !== '/permission')// just a mock | ||
}, | ||
{ | ||
key: 'visitor', | ||
name: 'visitor', | ||
description: 'Just a visitor. Can only see the home page and the document page', | ||
routes: [{ | ||
path: '', | ||
redirect: 'dashboard', | ||
children: [ | ||
{ | ||
path: 'dashboard', | ||
name: 'Dashboard', | ||
meta: { title: 'dashboard', icon: 'dashboard' } | ||
} | ||
] | ||
}] | ||
} | ||
] | ||
|
||
export default [ | ||
// mock get all routes form server | ||
{ | ||
url: '/routes', | ||
type: 'get', | ||
response: _ => { | ||
return { | ||
code: 200, | ||
data: routes | ||
} | ||
} | ||
}, | ||
|
||
// mock get all roles form server | ||
{ | ||
url: '/roles', | ||
type: 'get', | ||
response: _ => { | ||
return { | ||
code: 200, | ||
data: roles | ||
} | ||
} | ||
}, | ||
|
||
// add role | ||
{ | ||
url: '/role', | ||
type: 'post', | ||
response: { | ||
code: 200, | ||
data: { | ||
key: Mock.mock('@integer(300, 5000)') | ||
} | ||
} | ||
}, | ||
|
||
// update role | ||
{ | ||
url: '/role/[A-Za-z0-9]', | ||
type: 'put', | ||
response: { | ||
code: 200, | ||
data: { | ||
status: 'success' | ||
} | ||
} | ||
}, | ||
|
||
// delete role | ||
{ | ||
url: '/role/[A-Za-z0-9]', | ||
type: 'delete', | ||
response: { | ||
code: 200, | ||
data: { | ||
status: 'success' | ||
} | ||
} | ||
} | ||
] |
Oops, something went wrong.