Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mingPayPc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fengzhaoyu
mingPayPc
Commits
1fb2c089
Commit
1fb2c089
authored
Dec 07, 2019
by
liang ce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改默认菜单
parent
54e80fd3
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
25 deletions
+60
-25
axios.js
src/api/axios.js
+32
-22
Home.vue
src/components/common/Home.vue
+0
-0
CanteenManagementHome.vue
...ponents/pages/CanteenManagement/CanteenManagementHome.vue
+9
-0
PaymentManagementHome.vue
...ponents/pages/PaymentManagement/PaymentManagementHome.vue
+16
-3
rightsManagementHome.vue
...omponents/pages/rightsManagement/rightsManagementHome.vue
+3
-0
No files found.
src/api/axios.js
View file @
1fb2c089
...
@@ -28,18 +28,13 @@ axios.interceptors.request.use((config) => {
...
@@ -28,18 +28,13 @@ axios.interceptors.request.use((config) => {
})
})
// 配置请求返回的拦截器,
// 配置请求返回的拦截器,
axios
.
interceptors
.
response
.
use
(
res
=>
{
axios
.
interceptors
.
response
.
use
(
res
=>
{
// if (res.data.resultCode === 0) {
// if (res.data.code === 0 || res.data.resultCode === 0) {
// return Promise.resolve(res)
// store.dispatch('setSpinning', false)
// } else {
return
Promise
.
resolve
(
res
)
// } else if (res.data.code === 40003 || res.data.resultCode === 40003) {
// message.error('权限不足')
// return Promise.reject()
// return Promise.reject()
// }
// }
if
(
res
.
data
.
code
===
0
||
res
.
data
.
resultCode
===
0
)
{
store
.
dispatch
(
'setSpinning'
,
false
)
return
Promise
.
resolve
(
res
)
}
else
if
(
res
.
data
.
code
===
40003
||
res
.
data
.
resultCode
===
40003
)
{
message
.
error
(
'权限不足'
)
return
Promise
.
reject
(
'1'
)
}
},
err
=>
{
},
err
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
console
.
log
(
err
)
console
.
log
(
err
)
...
@@ -80,22 +75,21 @@ axios.interceptors.response.use(res => {
...
@@ -80,22 +75,21 @@ axios.interceptors.response.use(res => {
const
$http
=
{
const
$http
=
{
post
:
(
url
,
data
)
=>
{
post
:
(
url
,
data
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
// let postData
// if (data === undefined) {
// postData = {
// orgId: localStorage.getItem('orgId')
// }
// } else {
// postData = data
// postData.orgId = localStorage.getItem('orgId')
// }
let
postData
=
data
===
undefined
?
''
:
data
let
postData
=
data
===
undefined
?
''
:
data
axios
.
post
(
`
${
BASE_URL
}${
url
}
`
,
postData
,
{
axios
.
post
(
`
${
BASE_URL
}${
url
}
`
,
postData
,
{
headers
:
{
headers
:
{
'Content-Type'
:
'application/json; charset=UTF-8'
'Content-Type'
:
'application/json; charset=UTF-8'
}
}
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
return
resolve
(
res
)
if
(
res
.
data
.
code
===
0
||
res
.
data
.
resultCode
===
0
)
{
store
.
dispatch
(
'setSpinning'
,
false
)
return
Promise
.
resolve
(
res
)
}
else
if
(
res
.
data
.
code
===
40003
||
res
.
data
.
resultCode
===
40003
)
{
message
.
error
(
'权限不足'
)
return
Promise
.
reject
()
}
}).
catch
((
err
)
=>
{
console
.
log
(
err
)
})
})
})
})
},
},
...
@@ -103,7 +97,15 @@ const $http = {
...
@@ -103,7 +97,15 @@ const $http = {
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
getData
=
data
===
undefined
?
''
:
qs
.
stringify
(
data
)
let
getData
=
data
===
undefined
?
''
:
qs
.
stringify
(
data
)
axios
.
get
(
`
${
BASE_URL
}${
url
}
?
${
getData
}
`
).
then
((
res
)
=>
{
axios
.
get
(
`
${
BASE_URL
}${
url
}
?
${
getData
}
`
).
then
((
res
)
=>
{
return
resolve
(
res
)
if
(
res
.
data
.
code
===
0
||
res
.
data
.
resultCode
===
0
)
{
store
.
dispatch
(
'setSpinning'
,
false
)
return
Promise
.
resolve
(
res
)
}
else
if
(
res
.
data
.
code
===
40003
||
res
.
data
.
resultCode
===
40003
)
{
message
.
error
(
'权限不足'
)
return
Promise
.
reject
()
}
}).
catch
((
err
)
=>
{
console
.
log
(
err
)
})
})
})
})
},
},
...
@@ -111,7 +113,15 @@ const $http = {
...
@@ -111,7 +113,15 @@ const $http = {
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
getData
=
data
===
undefined
?
''
:
qs
.
stringify
(
data
)
let
getData
=
data
===
undefined
?
''
:
qs
.
stringify
(
data
)
axios
.
delete
(
`
${
BASE_URL
}${
url
}
?
${
getData
}
`
).
then
((
res
)
=>
{
axios
.
delete
(
`
${
BASE_URL
}${
url
}
?
${
getData
}
`
).
then
((
res
)
=>
{
return
resolve
(
res
)
if
(
res
.
data
.
code
===
0
||
res
.
data
.
resultCode
===
0
)
{
store
.
dispatch
(
'setSpinning'
,
false
)
return
Promise
.
resolve
(
res
)
}
else
if
(
res
.
data
.
code
===
40003
||
res
.
data
.
resultCode
===
40003
)
{
message
.
error
(
'权限不足'
)
return
Promise
.
reject
()
}
}).
catch
((
err
)
=>
{
console
.
log
(
err
)
})
})
})
})
}
}
...
...
src/components/common/Home.vue
View file @
1fb2c089
src/components/pages/CanteenManagement/CanteenManagementHome.vue
View file @
1fb2c089
...
@@ -42,6 +42,15 @@ export default {
...
@@ -42,6 +42,15 @@ export default {
created
()
{
created
()
{
this
.
defaultSelectedKeys
=
this
.
$route
.
name
this
.
defaultSelectedKeys
=
this
.
$route
.
name
this
.
chooseMenuList
=
this
.
$route
.
name
this
.
chooseMenuList
=
this
.
$route
.
name
if
(
this
.
$store
.
state
.
menuList
.
indexOf
(
'4100'
)
>
-
1
)
{
this
.
chooseMenuList
=
'classificationOfDishes'
}
else
if
(
this
.
$store
.
state
.
menuList
.
indexOf
(
'4200'
)
>
-
1
)
{
this
.
chooseMenuList
=
'menuManagement'
}
else
if
(
this
.
$store
.
state
.
menuList
.
indexOf
(
'4300'
)
>
-
1
)
{
this
.
chooseMenuList
=
'consumptionOrder'
}
else
if
(
this
.
$store
.
state
.
menuList
.
indexOf
(
'4400'
)
>
-
1
)
{
this
.
chooseMenuList
=
'consumptionStatistics'
}
},
},
watch
:
{
watch
:
{
$route
(
to
,
from
)
{
$route
(
to
,
from
)
{
...
...
src/components/pages/PaymentManagement/PaymentManagementHome.vue
View file @
1fb2c089
...
@@ -14,8 +14,6 @@
...
@@ -14,8 +14,6 @@
<a-menu-item
v-if=
"this.$store.state.menuList.indexOf('3300') > -1"
class=
"itemFlex"
key=
"allowancePayment"
><div
:class=
"[chooseMenuList === 'allowancePayment' ? 'menuIcon menuIcon3_2' : 'menuIcon menuIcon3_1']"
></div>
津贴发放
</a-menu-item>
<a-menu-item
v-if=
"this.$store.state.menuList.indexOf('3300') > -1"
class=
"itemFlex"
key=
"allowancePayment"
><div
:class=
"[chooseMenuList === 'allowancePayment' ? 'menuIcon menuIcon3_2' : 'menuIcon menuIcon3_1']"
></div>
津贴发放
</a-menu-item>
<a-menu-item
v-if=
"this.$store.state.menuList.indexOf('3400') > -1"
class=
"itemFlex"
key=
"recordsOfConsumption"
><div
:class=
"[chooseMenuList === 'recordsOfConsumption' ? 'menuIcon menuIcon4_2' : 'menuIcon menuIcon4_1']"
></div>
消费记录
</a-menu-item>
<a-menu-item
v-if=
"this.$store.state.menuList.indexOf('3400') > -1"
class=
"itemFlex"
key=
"recordsOfConsumption"
><div
:class=
"[chooseMenuList === 'recordsOfConsumption' ? 'menuIcon menuIcon4_2' : 'menuIcon menuIcon4_1']"
></div>
消费记录
</a-menu-item>
<a-menu-item
v-if=
"this.$store.state.menuList.indexOf('3500') > -1"
class=
"itemFlex"
key=
"systemReconciliation"
><div
:class=
"[chooseMenuList === 'systemReconciliation' ? 'menuIcon menuIcon6_2' : 'menuIcon menuIcon6_1']"
></div>
系统对账
</a-menu-item>
<a-menu-item
v-if=
"this.$store.state.menuList.indexOf('3500') > -1"
class=
"itemFlex"
key=
"systemReconciliation"
><div
:class=
"[chooseMenuList === 'systemReconciliation' ? 'menuIcon menuIcon6_2' : 'menuIcon menuIcon6_1']"
></div>
系统对账
</a-menu-item>
<!--
<a-menu-item
class=
"itemFlex"
key=
"cashierManagement"
><div
:class=
"[chooseMenuList === 'cashierManagement' ? 'menuIcon menuIcon5_2' : 'menuIcon menuIcon5_1']"
></div>
设置收银员
</a-menu-item>
<a-menu-item
class=
"itemFlex"
key=
"SetAdministrators"
><div
:class=
"[chooseMenuList === 'SetAdministrators' ? 'menuIcon menuIcon5_2' : 'menuIcon menuIcon5_1']"
></div>
设置管理员
</a-menu-item>
-->
<a-menu-item
v-if=
"this.$store.state.menuList.indexOf('3600') > -1"
class=
"itemFlex"
key=
"paymentManagementSetting"
><div
:class=
"[chooseMenuList === 'paymentManagementSetting' ? 'menuIcon menuIcon7_2' : 'menuIcon menuIcon7_1']"
></div>
设置中心
</a-menu-item>
<a-menu-item
v-if=
"this.$store.state.menuList.indexOf('3600') > -1"
class=
"itemFlex"
key=
"paymentManagementSetting"
><div
:class=
"[chooseMenuList === 'paymentManagementSetting' ? 'menuIcon menuIcon7_2' : 'menuIcon menuIcon7_1']"
></div>
设置中心
</a-menu-item>
<a-menu-item
v-if=
"this.$store.state.menuList.indexOf('3700') > -1"
class=
"itemFlex"
key=
"operationLog"
><div
:class=
"[chooseMenuList === 'operationLog' ? 'menuIcon menuIcon8_2' : 'menuIcon menuIcon8_1']"
></div>
操作日志
</a-menu-item>
<a-menu-item
v-if=
"this.$store.state.menuList.indexOf('3700') > -1"
class=
"itemFlex"
key=
"operationLog"
><div
:class=
"[chooseMenuList === 'operationLog' ? 'menuIcon menuIcon8_2' : 'menuIcon menuIcon8_1']"
></div>
操作日志
</a-menu-item>
</a-menu>
</a-menu>
...
@@ -33,12 +31,27 @@ export default {
...
@@ -33,12 +31,27 @@ export default {
data
()
{
data
()
{
return
{
return
{
defaultSelectedKeys
:
'defaultSelectedKeys'
,
defaultSelectedKeys
:
'defaultSelectedKeys'
,
chooseMenuList
:
'
accountManagement
'
chooseMenuList
:
''
}
}
},
},
created
()
{
created
()
{
this
.
defaultSelectedKeys
=
this
.
$route
.
name
this
.
defaultSelectedKeys
=
this
.
$route
.
name
this
.
chooseMenuList
=
this
.
$route
.
name
this
.
chooseMenuList
=
this
.
$route
.
name
if
(
this
.
$store
.
state
.
menuList
.
indexOf
(
'3100'
)
>
-
1
)
{
this
.
chooseMenuList
=
'accountManagement'
}
else
if
(
this
.
$store
.
state
.
menuList
.
indexOf
(
'3200'
)
>
-
1
)
{
this
.
chooseMenuList
=
'rechargeRecord'
}
else
if
(
this
.
$store
.
state
.
menuList
.
indexOf
(
'3300'
)
>
-
1
)
{
this
.
chooseMenuList
=
'allowancePayment'
}
else
if
(
this
.
$store
.
state
.
menuList
.
indexOf
(
'3400'
)
>
-
1
)
{
this
.
chooseMenuList
=
'recordsOfConsumption'
}
else
if
(
this
.
$store
.
state
.
menuList
.
indexOf
(
'3500'
)
>
-
1
)
{
this
.
chooseMenuList
=
'systemReconciliation'
}
else
if
(
this
.
$store
.
state
.
menuList
.
indexOf
(
'3600'
)
>
-
1
)
{
this
.
chooseMenuList
=
'paymentManagementSetting'
}
else
if
(
this
.
$store
.
state
.
menuList
.
indexOf
(
'3700'
)
>
-
1
)
{
this
.
chooseMenuList
=
'operationLog'
}
},
},
watch
:
{
watch
:
{
$route
(
to
,
from
)
{
$route
(
to
,
from
)
{
...
...
src/components/pages/rightsManagement/rightsManagementHome.vue
View file @
1fb2c089
...
@@ -33,6 +33,9 @@ export default {
...
@@ -33,6 +33,9 @@ export default {
created
()
{
created
()
{
this
.
defaultSelectedKeys
=
this
.
$route
.
name
this
.
defaultSelectedKeys
=
this
.
$route
.
name
this
.
chooseMenuList
=
this
.
$route
.
name
this
.
chooseMenuList
=
this
.
$route
.
name
if
(
this
.
$store
.
state
.
menuList
.
indexOf
(
'9100'
)
>
-
1
)
{
this
.
chooseMenuList
=
'rightsManagement'
}
},
},
watch
:
{
watch
:
{
$route
(
to
,
from
)
{
$route
(
to
,
from
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment