diff --git a/.env b/.env
index c6889c1a..27c38a1b 100644
--- a/.env
+++ b/.env
@@ -1,4 +1,5 @@
# 所有环境
# 页面 title 前缀
-VUE_APP_TITLE=D2Admin
\ No newline at end of file
+VUE_APP_TITLE=D2Admin
+VUE_APP_API=/api/
diff --git a/docs/zh/collaborator/README.md b/docs/zh/collaborator/README.md
index ea56aef7..0f8a0d1f 100644
--- a/docs/zh/collaborator/README.md
+++ b/docs/zh/collaborator/README.md
@@ -10,4 +10,5 @@ sidebar: auto
|
| sunhaoxiang | [https://github.com/sunhaoxiang](https://github.com/sunhaoxiang) |
|
| namklaw | [https://github.com/namklaw](https://github.com/namklaw) |
|
| mokeyjay | [https://github.com/mokeyjay](https://github.com/mokeyjay) |
-|
| Aysnine | [https://github.com/Aysnine](https://github.com/Aysnine) |
\ No newline at end of file
+|
| Aysnine | [https://github.com/Aysnine](https://github.com/Aysnine) |
+|
| rongxingsun | [https://github.com/rongxingsun](https://github.com/rongxingsun) |
\ No newline at end of file
diff --git a/package-lock.json.REMOVED.git-id b/package-lock.json.REMOVED.git-id
index 8e30f099..e44ada5f 100644
--- a/package-lock.json.REMOVED.git-id
+++ b/package-lock.json.REMOVED.git-id
@@ -1 +1 @@
-208665c165b32daf4021f61c3ad430a972cb9735
\ No newline at end of file
+937f5369a5d9b43eeb3c7fa2991f76724481721c
\ No newline at end of file
diff --git a/src/api/components/markdown/index.js b/src/api/components/markdown/index.js
new file mode 100644
index 00000000..8769a0b0
--- /dev/null
+++ b/src/api/components/markdown/index.js
@@ -0,0 +1,9 @@
+import request from '@/plugin/axios'
+
+export function ComponentsMarkdownBase (url) {
+ return request({
+ baseURL: process.env.BASE_URL,
+ url,
+ method: 'get'
+ })
+}
diff --git a/src/api/demo/business/table/1/index.js b/src/api/demo/business/table/1/index.js
new file mode 100644
index 00000000..4e09ecb9
--- /dev/null
+++ b/src/api/demo/business/table/1/index.js
@@ -0,0 +1,9 @@
+import request from '@/plugin/axios'
+
+export function BusinessTable1List (data) {
+ return request({
+ url: '/demo/business/table/1',
+ method: 'post',
+ data
+ })
+}
diff --git a/src/api/demo/plugins/mocks/ajax/index.js b/src/api/demo/plugins/mocks/ajax/index.js
new file mode 100644
index 00000000..a7ec00cc
--- /dev/null
+++ b/src/api/demo/plugins/mocks/ajax/index.js
@@ -0,0 +1,8 @@
+import request from '@/plugin/axios'
+
+export function PluginMocksAjax () {
+ return request({
+ url: '/demo/plugins/mock/ajax',
+ method: 'get'
+ })
+}
diff --git a/src/api/sys/http/index.js b/src/api/sys/http/index.js
new file mode 100644
index 00000000..c2f7eeb4
--- /dev/null
+++ b/src/api/sys/http/index.js
@@ -0,0 +1,17 @@
+import request from '@/plugin/axios'
+
+export function httpGet (url, params = {}) {
+ return request({
+ url,
+ method: 'get',
+ params
+ })
+}
+
+export function httpPost (url, data = {}) {
+ return request({
+ url,
+ method: 'post',
+ data
+ })
+}
diff --git a/src/api/sys/login/index.js b/src/api/sys/login/index.js
new file mode 100644
index 00000000..882292e3
--- /dev/null
+++ b/src/api/sys/login/index.js
@@ -0,0 +1,9 @@
+import request from '@/plugin/axios'
+
+export function AccountLogin (data) {
+ return request({
+ url: '/login',
+ method: 'post',
+ data
+ })
+}
diff --git a/src/assets/style/theme/theme.scss.REMOVED.git-id b/src/assets/style/theme/theme.scss.REMOVED.git-id
index 8b5ae210..9ba9d43f 100644
--- a/src/assets/style/theme/theme.scss.REMOVED.git-id
+++ b/src/assets/style/theme/theme.scss.REMOVED.git-id
@@ -1 +1 @@
-87fff7214e7b64123842f1f52b649a8af614eb46
\ No newline at end of file
+bfee5e91a3b150e04d9f24695061f6f3e7c59342
\ No newline at end of file
diff --git a/src/components/d2-markdown/index.vue b/src/components/d2-markdown/index.vue
index f6d733e2..aaf60f50 100644
--- a/src/components/d2-markdown/index.vue
+++ b/src/components/d2-markdown/index.vue
@@ -12,6 +12,7 @@ import marked from 'marked'
import highlight from 'highlight.js'
import bandupan from './plugin/baidupan'
import 'github-markdown-css'
+import { ComponentsMarkdownBase } from '@/api/components/markdown'
export default {
name: 'd2-markdown',
props: {
@@ -63,7 +64,7 @@ export default {
},
// 从 url 加载原始数据
async getReadme (url) {
- const data = await this.$axios.get(url)
+ const data = await ComponentsMarkdownBase(url)
return this.marked(data)
},
marked (data) {
diff --git a/src/layout/header-aside/components/menu-header/index.vue b/src/layout/header-aside/components/menu-header/index.vue
index acea80cf..940aaf63 100644
--- a/src/layout/header-aside/components/menu-header/index.vue
+++ b/src/layout/header-aside/components/menu-header/index.vue
@@ -1,5 +1,5 @@
-
+
@@ -25,6 +25,19 @@ export default {
...mapState('d2admin/menu', [
'header'
])
+ },
+ data () {
+ return {
+ active: ''
+ }
+ },
+ watch: {
+ '$route.matched': {
+ handler (val) {
+ this.active = val[val.length - 1].path
+ },
+ immediate: true
+ }
}
}
diff --git a/src/mock/api/demo/business/table/1/index.js b/src/mock/api/demo/business/table/1/index.js
index 7c8d2621..ff02e4c7 100644
--- a/src/mock/api/demo/business/table/1/index.js
+++ b/src/mock/api/demo/business/table/1/index.js
@@ -7,17 +7,23 @@ Mock.mock('/api/demo/business/table/1', ({ body }) => {
page.total = 1000
return Mock.mock(
{
- page,
- 'list|20': [{
- 'key': '@guid',
- 'value|1': [10, 100, 200, 500],
- 'type': '@boolean',
- 'admin': '@cname',
- 'adminNote': '@cparagraph(0.5)',
- 'dateTimeCreat': '@datetime',
- 'used': '@boolean',
- 'dateTimeUse': '@datetime'
- }]
+ code: 0,
+ msg: '获取数据成功',
+ data: {
+ page,
+ 'list|20': [
+ {
+ 'key': '@guid',
+ 'value|1': [10, 100, 200, 500],
+ 'type': '@boolean',
+ 'admin': '@cname',
+ 'adminNote': '@cparagraph(0.5)',
+ 'dateTimeCreat': '@datetime',
+ 'used': '@boolean',
+ 'dateTimeUse': '@datetime'
+ }
+ ]
+ }
}
)
})
diff --git a/src/mock/api/demo/plugins/mock/ajax/index.js b/src/mock/api/demo/plugins/mock/ajax/index.js
index fa5a4ce5..0e696322 100644
--- a/src/mock/api/demo/plugins/mock/ajax/index.js
+++ b/src/mock/api/demo/plugins/mock/ajax/index.js
@@ -1,13 +1,19 @@
import Mock from 'mockjs'
Mock.mock('/api/demo/plugins/mock/ajax', {
- 'list|4-10': [{
- 'id|+1': 1,
- 'name': '@CNAME',
- 'star|1-5': '★',
- 'delFlag|1': [0, 1],
- 'creatDate': '@DATE',
- 'address': '@CITY',
- 'zip': '@ZIP'
- }]
+ code: 0,
+ msg: '获取数据成功',
+ data: {
+ 'list|4-10': [
+ {
+ 'id|+1': 1,
+ 'name': '@CNAME',
+ 'star|1-5': '★',
+ 'delFlag|1': [0, 1],
+ 'creatDate': '@DATE',
+ 'address': '@CITY',
+ 'zip': '@ZIP'
+ }
+ ]
+ }
})
diff --git a/src/mock/api/sys/login/index.js b/src/mock/api/sys/login/index.js
index 99222985..36662ce7 100644
--- a/src/mock/api/sys/login/index.js
+++ b/src/mock/api/sys/login/index.js
@@ -21,7 +21,7 @@ const userDB = [
}
]
-Mock.mock('/login', 'post', ({url, type, body}) => {
+Mock.mock('/api/login', 'post', ({url, type, body}) => {
const bodyObj = JSON.parse(body)
const user = userDB.find(e => e.username === bodyObj.username && e.password === bodyObj.password)
if (user) {
@@ -36,7 +36,8 @@ Mock.mock('/login', 'post', ({url, type, body}) => {
} else {
return {
code: 401,
- msg: '用户名或密码错误'
+ msg: '用户名或密码错误',
+ data: {}
}
}
})
diff --git a/src/pages/demo/business/table/1/index.vue b/src/pages/demo/business/table/1/index.vue
index 0bd5cd09..c7e4b5aa 100644
--- a/src/pages/demo/business/table/1/index.vue
+++ b/src/pages/demo/business/table/1/index.vue
@@ -17,6 +17,7 @@