...
|
...
|
@@ -14,13 +14,22 @@ const sign = require(`${lRoot}/sign`); |
|
|
|
|
|
const api = new API('http://testservice.yoho.cn:28077');
|
|
|
|
|
|
/**
|
|
|
* 获取接口配置
|
|
|
* @param undefined
|
|
|
* @return {Object} 配置对象
|
|
|
*/
|
|
|
const getConfig = () => ({
|
|
|
title: 'home',
|
|
|
devEnv: true,
|
|
|
version: '0.0.1'
|
|
|
});
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取菜单
|
|
|
* @param undefined
|
|
|
* @return {array} 菜单数组
|
|
|
*/
|
|
|
const getMenuData = () => (
|
|
|
[
|
|
|
{
|
...
|
...
|
@@ -51,8 +60,11 @@ const getMenuData = () => ( |
|
|
]
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取导航
|
|
|
* @param undefined
|
|
|
* @return {array} 导航数组
|
|
|
*/
|
|
|
const getNavBar = (data) => {
|
|
|
let navBars = [];
|
|
|
|
...
|
...
|
@@ -69,6 +81,12 @@ const getNavBar = (data) => { |
|
|
return navBars;
|
|
|
};
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取品牌名字
|
|
|
* @param undefined
|
|
|
* @return {array} 品牌数组
|
|
|
*/
|
|
|
const getBrandItems = (data) => {
|
|
|
let brandItems = [];
|
|
|
|
...
|
...
|
@@ -86,6 +104,11 @@ const getBrandItems = (data) => { |
|
|
return brandItems;
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 获取三级菜单
|
|
|
* @param undefined
|
|
|
* @return {array} 三级菜单数组
|
|
|
*/
|
|
|
const getThirdNav = (data) => {
|
|
|
let thirdNav = [];
|
|
|
|
...
|
...
|
@@ -107,6 +130,11 @@ const getThirdNav = (data) => { |
|
|
return thirdNav;
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 获取子菜单
|
|
|
* @param undefined
|
|
|
* @return {array} 子菜单数组
|
|
|
*/
|
|
|
const getSubNav = (data) => {
|
|
|
let subNav = [];
|
|
|
|
...
|
...
|
@@ -125,13 +153,15 @@ const getSubNav = (data) => { |
|
|
subNav.push(obj);
|
|
|
});
|
|
|
|
|
|
|
|
|
console.log(subNav);
|
|
|
|
|
|
return subNav;
|
|
|
};
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 处理接口返回的数据
|
|
|
* @param {object} 接口返回的对象
|
|
|
* @return {object} 头部数据
|
|
|
*/
|
|
|
exports.getAllHeaderData = function(resData) {
|
|
|
let config = getConfig();
|
|
|
let data = {
|
...
|
...
|
@@ -147,6 +177,11 @@ exports.getAllHeaderData = function(resData) { |
|
|
return _.merge(config, data);
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 请求头部数据
|
|
|
* @param undefined
|
|
|
* @return {promise}
|
|
|
*/
|
|
|
exports.getHeaderData = function() {
|
|
|
let data = sign.apiSign({
|
|
|
|
...
|
...
|
|