Skip to content

Commit f6752f1

Browse files
author
oguzhan.onder
committed
Fetching menus from server
1 parent 4aac9cd commit f6752f1

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

src/containers/menus.js

-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ export default [
88
to: '/dashboard',
99
icon: 'cil-speedometer'
1010
},
11-
12-
{
13-
_name: 'CSidebarNavTitle',
14-
_children: ['Ürün']
15-
},
1611
{
1712
_name: 'CSidebarNavDropdown',
1813
name: 'Ürün Yönetimi',

src/store/actions.js

+7
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ export const registerConfirm = (vueContext, param) => {
3636
})
3737
};
3838

39+
export const getUserAndMenus = (vueContext) => {
40+
return util.service.get("user/menus")
41+
.then(response => {
42+
console.log(response);
43+
})
44+
}
3945

4046
export const login = (vueContext, loginData) => {
4147
loginData.password = util.randomCode(loginData.password);
@@ -46,6 +52,7 @@ export const login = (vueContext, loginData) => {
4652
loginData.username = null;
4753
if (response) {
4854
util.common.loginSuccessfully(response.data);
55+
vueContext.dispatch("getUserAndMenus");
4956
vueContext.dispatch("getTradeResult");
5057
util.common.routePush("dashboard");
5158
util.common.control(response);

src/util/router.js

-8
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,6 @@ const routes = [
7676
}
7777
},
7878
children: [
79-
/* {
80-
path: "productList",
81-
name: "ProductList",
82-
component: () => System.import('../components/ProductList'),
83-
beforeEnter(to, from, next) {
84-
controlLogin(next);
85-
}
86-
},*/
8779
{
8880
path: "purchase",
8981
name: "ProductPurchase",

0 commit comments

Comments
 (0)