Showing
6 changed files
with
64 additions
and
36 deletions
@@ -239,11 +239,11 @@ g.__e.on("callback", function(obj) { | @@ -239,11 +239,11 @@ g.__e.on("callback", function(obj) { | ||
239 | $(document).on("click",".sortadd",function(){ | 239 | $(document).on("click",".sortadd",function(){ |
240 | var text=$(this).text(); | 240 | var text=$(this).text(); |
241 | if(!Bll.validateSort()){ | 241 | if(!Bll.validateSort()){ |
242 | - common.util.__tip("请选择完整的分类目录"); | 242 | + common.util.__tip("请选择完整的分类目录","warning"); |
243 | return; | 243 | return; |
244 | } | 244 | } |
245 | if ($.trim($("#salesPriceStr").val())=="") { | 245 | if ($.trim($("#salesPriceStr").val())=="") { |
246 | - common.util.__tip("请填写销售价"); | 246 | + common.util.__tip("请填写销售价","warning"); |
247 | return; | 247 | return; |
248 | } | 248 | } |
249 | if(g.__e.validate()){ | 249 | if(g.__e.validate()){ |
@@ -425,8 +425,8 @@ e.on("validate",function(){ | @@ -425,8 +425,8 @@ e.on("validate",function(){ | ||
425 | if(_count>0){ | 425 | if(_count>0){ |
426 | return "同一颜色包含两组相同尺码"; | 426 | return "同一颜色包含两组相同尺码"; |
427 | } | 427 | } |
428 | - if(_count1>0&&common.util.__input("supplierId")){ | ||
429 | - return "JIT商品条码不能重复"; | 428 | + if(_count1>0){ |
429 | + return "商品条码不能重复"; | ||
430 | } | 430 | } |
431 | }); | 431 | }); |
432 | e.on("validate",function(){ | 432 | e.on("validate",function(){ |
@@ -14,13 +14,13 @@ var config = { | @@ -14,13 +14,13 @@ var config = { | ||
14 | apiKey: 'sd4H1ecAqlp', | 14 | apiKey: 'sd4H1ecAqlp', |
15 | //http: //192.168.102.214:8088/platform | 15 | //http: //192.168.102.214:8088/platform |
16 | // domain: 'http://172.16.6.240:8088/platform', | 16 | // domain: 'http://172.16.6.240:8088/platform', |
17 | - // domain:'http://172.16.6.240:8088/platform',//王书生 | 17 | + domain:'http://172.16.6.240:8088/platform',//王书生 |
18 | // domain: 'http://172.16.6.124:8088/platform',//陈超 | 18 | // domain: 'http://172.16.6.124:8088/platform',//陈超 |
19 | //http://172.16.6.124:8088/platform/product/queryAllProductAttr | 19 | //http://172.16.6.124:8088/platform/product/queryAllProductAttr |
20 | //domain: 'http://172.16.6.227:8088/platform', //玛丽 | 20 | //domain: 'http://172.16.6.227:8088/platform', //玛丽 |
21 | // domain: 'http://192.168.102.202:8088/platform', | 21 | // domain: 'http://192.168.102.202:8088/platform', |
22 | //domain:'http://172.16.9.8:8080/yohobuy-platform-web',//葛超 | 22 | //domain:'http://172.16.9.8:8080/yohobuy-platform-web',//葛超 |
23 | - domain: 'http://192.168.102.202:8088/platform', | 23 | + // domain: 'http://192.168.102.202:8088/platform', |
24 | //domain: 'http://172.16.6.239:8080', //孙杰翔 | 24 | //domain: 'http://172.16.6.239:8080', //孙杰翔 |
25 | loggers: { | 25 | loggers: { |
26 | api: { | 26 | api: { |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | * @type {Object} | 3 | * @type {Object} |
4 | */ | 4 | */ |
5 | module.exports = { | 5 | module.exports = { |
6 | - url:'http://admin.portal.yohobuy.com', | 6 | + url:'http://admin.yohobuy.com',//'http://admin.portal.yohobuy.com', |
7 | sessionKeep:'/account/profile/display', | 7 | sessionKeep:'/account/profile/display', |
8 | timeout:30000 | 8 | timeout:30000 |
9 | }; | 9 | }; |
@@ -25,21 +25,20 @@ var errorMessage = { | @@ -25,21 +25,20 @@ var errorMessage = { | ||
25 | util.setLogger(res.app.logger); | 25 | util.setLogger(res.app.logger); |
26 | var options = { | 26 | var options = { |
27 | url:oldService.login, | 27 | url:oldService.login, |
28 | - form:{ | ||
29 | - account:user, | ||
30 | - password:password, | ||
31 | - website:WEBSITE | ||
32 | - } | 28 | + form:'["'+user+'","'+password+'",1]' |
33 | } | 29 | } |
34 | 30 | ||
35 | //调用登陆 | 31 | //调用登陆 |
36 | util.httpCall(options,function(err,ret){ | 32 | util.httpCall(options,function(err,ret){ |
33 | + console.log("************************************"); | ||
34 | + console.log(ret); | ||
37 | if(err) { | 35 | if(err) { |
38 | res.json(errorMessage); | 36 | res.json(errorMessage); |
39 | return; | 37 | return; |
40 | } else { | 38 | } else { |
39 | + | ||
41 | //调用菜单 | 40 | //调用菜单 |
42 | - _callGetMenu(ret.data.pid,function(err,data){ | 41 | + _callGetMenu(ret.data.pid,ret.data.role_id,function(err,data){ |
43 | if(err) { | 42 | if(err) { |
44 | res.json(errorMessage); | 43 | res.json(errorMessage); |
45 | } else { | 44 | } else { |
@@ -66,21 +65,18 @@ var errorMessage = { | @@ -66,21 +65,18 @@ var errorMessage = { | ||
66 | * @param {Number} pid 操作员ID | 65 | * @param {Number} pid 操作员ID |
67 | * @param {Function} callback 回调 | 66 | * @param {Function} callback 回调 |
68 | */ | 67 | */ |
69 | -function _callGetMenu(pid,callback) { | 68 | +function _callGetMenu(pid,roleid,callback) { |
70 | var options = { | 69 | var options = { |
71 | url:oldService.getResourceByPid, | 70 | url:oldService.getResourceByPid, |
72 | - form:{ | ||
73 | - pid:pid, | ||
74 | - website:WEBSITE | ||
75 | - } | 71 | + form:'['+pid+','+roleid+',1]' |
76 | } | 72 | } |
77 | - | 73 | +console.log(options); |
78 | util.httpCall(options,function(err,ret){ | 74 | util.httpCall(options,function(err,ret){ |
79 | if(err) { | 75 | if(err) { |
80 | callback(err); | 76 | callback(err); |
81 | } else { | 77 | } else { |
82 | var menuData = {menu:[],right:{}}; | 78 | var menuData = {menu:[],right:{}}; |
83 | - if(ret.data && ret.data.length>0) { | 79 | + if(ret.data) { |
84 | menuData = _makeMenu(ret.data); | 80 | menuData = _makeMenu(ret.data); |
85 | } | 81 | } |
86 | _getAllMenu(function(ret){ | 82 | _getAllMenu(function(ret){ |
@@ -103,9 +99,9 @@ function filterRight(ret,menuData) { | @@ -103,9 +99,9 @@ function filterRight(ret,menuData) { | ||
103 | var noRight = {}; | 99 | var noRight = {}; |
104 | //匹配没有权限 | 100 | //匹配没有权限 |
105 | _.forEach(ret,function(v,k){ | 101 | _.forEach(ret,function(v,k){ |
106 | - if(v.module_url!=='') { | ||
107 | - if(!menuData.right[v.module_url]) { | ||
108 | - noRight[v.module_url] = true; | 102 | + if(v.menu_url!=='') { |
103 | + if(!menuData.right[v.menu_url]) { | ||
104 | + noRight[v.menu_url] = true; | ||
109 | } | 105 | } |
110 | } | 106 | } |
111 | }); | 107 | }); |
@@ -140,27 +136,51 @@ function _getAllMenu (callback) { | @@ -140,27 +136,51 @@ function _getAllMenu (callback) { | ||
140 | function _makeMenu (data) { | 136 | function _makeMenu (data) { |
141 | var menu = []; | 137 | var menu = []; |
142 | var right = {}; | 138 | var right = {}; |
143 | - _.forEach(data,function(v){ | ||
144 | - var item = { | ||
145 | - title:v.resource_name, | 139 | + for(var key in data){ |
140 | + | ||
141 | + var v=data[key]; | ||
142 | + var item = { | ||
143 | + title:v.menu_name, | ||
146 | } | 144 | } |
147 | if(v.parent_id === "0") { | 145 | if(v.parent_id === "0") { |
148 | item.parent = 'menu-template'; | 146 | item.parent = 'menu-template'; |
149 | var itemSubs = []; | 147 | var itemSubs = []; |
150 | _.forEach(v.sub,function(val) { | 148 | _.forEach(v.sub,function(val) { |
151 | var sub = { | 149 | var sub = { |
152 | - title:val.resource_name, | ||
153 | - href:val.module_url, | 150 | + title:val.menu_name, |
151 | + href:val.menu_url, | ||
154 | icon: 'list-alt' | 152 | icon: 'list-alt' |
155 | } | 153 | } |
156 | - right[val.module_url] = true; | 154 | + right[val.menu_url] = true; |
157 | itemSubs.push(sub); | 155 | itemSubs.push(sub); |
158 | }); | 156 | }); |
159 | 157 | ||
160 | item.menu = itemSubs; | 158 | item.menu = itemSubs; |
161 | } | 159 | } |
162 | menu.push(item); | 160 | menu.push(item); |
163 | - }); | 161 | + } |
162 | + // _.forEach(data,function(v){ | ||
163 | + // var item = { | ||
164 | + // title:v.menu_name, | ||
165 | + // } | ||
166 | + // if(v.parent_id === "0") { | ||
167 | + // item.parent = 'menu-template'; | ||
168 | + // var itemSubs = []; | ||
169 | + // _.forEach(v.sub,function(val) { | ||
170 | + // console.log(v.sub); | ||
171 | + // var sub = { | ||
172 | + // title:val.menu_name, | ||
173 | + // href:val.menu_url, | ||
174 | + // icon: 'list-alt' | ||
175 | + // } | ||
176 | + // right[val.menu_url] = true; | ||
177 | + // itemSubs.push(sub); | ||
178 | + // }); | ||
179 | + | ||
180 | + // item.menu = itemSubs; | ||
181 | + // } | ||
182 | + // menu.push(item); | ||
183 | + // }); | ||
164 | 184 | ||
165 | return { | 185 | return { |
166 | menu:menu, | 186 | menu:menu, |
1 | -var oldSerDomain = 'http://service.api.yohobuy.com'; | 1 | +// var oldSerDomain = 'http://service.api.yohobuy.com'; |
2 | +// module.exports = { | ||
3 | +// login: oldSerDomain + '/account/api/v1/profile/login', | ||
4 | +// getResourceByPid: oldSerDomain + '/account/api/v1/profile/getResourceByPid', | ||
5 | +// getAllResByWebsite: oldSerDomain + '/account/api/v1/resources/getAllResByWebsite' | ||
6 | +// }; | ||
7 | + | ||
8 | +var oldSerDomain = 'http://lserve.yohobuy.com'; | ||
2 | module.exports = { | 9 | module.exports = { |
3 | - login: oldSerDomain + '/account/api/v1/profile/login', | ||
4 | - getResourceByPid: oldSerDomain + '/account/api/v1/profile/getResourceByPid', | ||
5 | - getAllResByWebsite: oldSerDomain + '/account/api/v1/resources/getAllResByWebsite' | ||
6 | -}; | ||
10 | + login: oldSerDomain + '/service/account/v1/Profile/login', | ||
11 | + getResourceByPid: oldSerDomain + '/service/account/v1/Profile/getMenuByPid', | ||
12 | + getAllResByWebsite: oldSerDomain + '/service/setting/v1/menu/getAllMenu' | ||
13 | +}; | ||
14 | + |
-
Please register or login to post a comment