Authored by htoooth

Merge branch 'release/1.0' of http://git.yoho.cn/fe/yoho-shop-manage into release/1.0

... ... @@ -7,7 +7,7 @@ import yohoPluginAuth from './plugins/yoho-plugin-auth';
import './filters';
import './directives';
import 'iview/dist/styles/iview.css';
import 'font-awesome/css/font-awesome.css';
import './fonts/iconfont.css';
Vue.use(yohoPluginCore);
Vue.use(yohoPluginRouter);
... ...
... ... @@ -23,6 +23,22 @@ const component = (resolve) => {
'full-screen',
'info',
],
icons: {
text: 'iconfont icon-pencil',
color: 'iconfont icon-paintbrush',
font: 'iconfont icon-font',
align: 'iconfont icon-alignjustify',
list: 'iconfont icon-list',
link: 'iconfont icon-chain',
unlink: 'iconfont icon-chainbroken',
tabulation: 'iconfont icon-table',
image: 'iconfont icon-images',
'multi-image': 'iconfont icon-images',
hr: 'iconfont icon-minus',
eraser: 'iconfont icon-eraser',
undo: 'iconfont icon-undo',
'full-screen': 'iconfont icon-arrows-alt',
},
image: {
sizeLimit: 512 * 1024,
upload: {
... ...
export default {
historyMode: 'history',
shopsFeDomain: 'http://shops.yohobuy.com',
axiosBaseUrl: '/Api',
axiosResponseType: 'json',
homePage: 'home.overview',
storeKeys: {
user: '_user',
dev: {
historyMode: 'history',
shopsFeDomain: 'http://shops.yohobuy.com',
axiosBaseUrl: '/Api',
axiosResponseType: 'json',
homePage: 'home.overview',
storeKeys: {
user: '_user',
}
},
production: {
historyMode: 'history',
shopsFeDomain: 'http://shops.yohops.com',
axiosBaseUrl: '/Api',
axiosResponseType: 'json',
homePage: 'home.overview',
storeKeys: {
user: '_user',
}
}
};
... ...
@font-face {font-family: "iconfont";
src: url('iconfont.eot?t=1495163726758'); /* IE9*/
src: url('iconfont.eot?t=1495163726758#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff?t=1495163726758') format('woff'), /* chrome, firefox */
url('iconfont.ttf?t=1495163726758') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('iconfont.svg?t=1495163726758#iconfont') format('svg'); /* iOS 4.1- */
}
.iconfont {
font-family:"iconfont" !important;
font-size:16px;
font-style:normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-alignjustify:before { content: "\e603"; }
.icon-table:before { content: "\e7b5"; }
.icon-minus:before { content: "\e6b5"; }
.icon-font:before { content: "\e6e2"; }
.icon-list:before { content: "\e728"; }
.icon-paintbrush:before { content: "\e751"; }
.icon-undo:before { content: "\e7f2"; }
.icon-pencil:before { content: "\e604"; }
.icon-images:before { content: "\e7ee"; }
.icon-chain:before { content: "\ea36"; }
.icon-eraser:before { content: "\ea9b"; }
.icon-chainbroken:before { content: "\e679"; }
.icon-arrows-alt:before { content: "\e700"; }
... ...
No preview for this file type
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
Created by FontForge 20120731 at Fri May 19 11:15:26 2017
By admin
</metadata>
<defs>
<font id="iconfont" horiz-adv-x="1024" >
<font-face
font-family="iconfont"
font-weight="500"
font-stretch="normal"
units-per-em="1024"
panose-1="2 0 6 3 0 0 0 0 0 0"
ascent="896"
descent="-128"
x-height="792"
bbox="0 -212 1096.82 887"
underline-thickness="0"
underline-position="0"
unicode-range="U+0078-EA9B"
/>
<missing-glyph
/>
<glyph glyph-name=".notdef"
/>
<glyph glyph-name=".notdef"
/>
<glyph glyph-name=".null" horiz-adv-x="0"
/>
<glyph glyph-name="nonmarkingreturn" horiz-adv-x="341"
/>
<glyph glyph-name="x" unicode="x" horiz-adv-x="1001"
d="M281 543q-27 -1 -53 -1h-83q-18 0 -36.5 -6t-32.5 -18.5t-23 -32t-9 -45.5v-76h912v41q0 16 -0.5 30t-0.5 18q0 13 -5 29t-17 29.5t-31.5 22.5t-49.5 9h-133v-97h-438v97zM955 310v-52q0 -23 0.5 -52t0.5 -58t-10.5 -47.5t-26 -30t-33 -16t-31.5 -4.5q-14 -1 -29.5 -0.5
t-29.5 0.5h-32l-45 128h-439l-44 -128h-29h-34q-20 0 -45 1q-25 0 -41 9.5t-25.5 23t-13.5 29.5t-4 30v167h911zM163 247q-12 0 -21 -8.5t-9 -21.5t9 -21.5t21 -8.5q13 0 22 8.5t9 21.5t-9 21.5t-22 8.5zM316 123q-8 -26 -14 -48q-5 -19 -10.5 -37t-7.5 -25t-3 -15t1 -14.5
t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-5 19 -11 39h-368zM336 498v228q0 11 2.5 23t10 21.5t20.5 15.5t34 6h188q31 0 51.5 -14.5t20.5 -52.5v-227h-327z" />
<glyph glyph-name="alignjustify" unicode="&#xe603;"
d="M960 76v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-832q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h832q13 0 22.5 -9.5t9.5 -22.5zM960 268v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-832q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h832q13 0 22.5 -9.5
t9.5 -22.5zM960 460v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-832q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h832q13 0 22.5 -9.5t9.5 -22.5zM960 652v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-832q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h832q13 0 22.5 -9.5
t9.5 -22.5z" />
<glyph glyph-name="table" unicode="&#xe7b5;"
d="M329 26v109q0 8 -5 13.5t-13 5.5h-183q-8 0 -13 -5.5t-5 -13.5v-109q0 -8 5 -13.5t13 -5.5h183q8 0 13 5.5t5 13.5zM329 245v110q0 8 -5 13t-13 5h-183q-8 0 -13 -5t-5 -13v-110q0 -8 5 -13t13 -5h183q8 0 13 5t5 13zM622 26v109q0 8 -5.5 13.5t-13.5 5.5h-182
q-8 0 -13.5 -5.5t-5.5 -13.5v-109q0 -8 5.5 -13.5t13.5 -5.5h182q8 0 13.5 5.5t5.5 13.5zM329 465v109q0 8 -5 13.5t-13 5.5h-183q-8 0 -13 -5.5t-5 -13.5v-109q0 -8 5 -13.5t13 -5.5h183q8 0 13 5.5t5 13.5zM622 245v110q0 8 -5.5 13t-13.5 5h-182q-8 0 -13.5 -5t-5.5 -13
v-110q0 -8 5.5 -13t13.5 -5h182q8 0 13.5 5t5.5 13zM914 26v109q0 8 -5 13.5t-13 5.5h-183q-8 0 -13 -5.5t-5 -13.5v-109q0 -8 5 -13.5t13 -5.5h183q8 0 13 5.5t5 13.5zM622 465v109q0 8 -5.5 13.5t-13.5 5.5h-182q-8 0 -13.5 -5.5t-5.5 -13.5v-109q0 -8 5.5 -13.5
t13.5 -5.5h182q8 0 13.5 5.5t5.5 13.5zM914 245v110q0 8 -5 13t-13 5h-183q-8 0 -13 -5t-5 -13v-110q0 -8 5 -13t13 -5h183q8 0 13 5t5 13zM914 465v109q0 8 -5 13.5t-13 5.5h-183q-8 0 -13 -5.5t-5 -13.5v-109q0 -8 5 -13.5t13 -5.5h183q8 0 13 5.5t5 13.5zM987 647v-621
q0 -38 -26.5 -65t-64.5 -27h-768q-38 0 -64.5 27t-26.5 65v621q0 38 26.5 65t64.5 27h768q38 0 64.5 -27t26.5 -65z" />
<glyph glyph-name="minus" unicode="&#xe6b5;"
d="M914 358v-110q0 -22 -16 -38t-39 -16h-694q-23 0 -39 16t-16 38v110q0 23 16 39t39 16h694q23 0 39 -16t16 -39z" />
<glyph glyph-name="font" unicode="&#xe6e2;"
d="M451 493l-97 -258q19 0 78 -1t91 -1q11 0 33 1q-50 145 -105 259zM37 -139l1 45q13 4 32 7.5t32.5 6t28 8t25.5 16.5t18 29l135 352l160 414h73q5 -8 7 -12l117 -274q19 -45 60.5 -147.5t64.5 -156.5q9 -20 33.5 -83t41.5 -96q11 -26 20 -33q11 -8 50 -16.5t48 -11.5
q3 -22 3 -33q0 -2 3 -7.5t3 -7.5q-36 0 -108.5 4.5t-109.5 4.5q-43 0 -122.5 -4t-101.5 -4q0 24 2 44l75 16q1 0 7.5 1.5t8.5 2t8 2.5t8.5 4t6.5 4.5t5.5 6t1.5 8.5q0 9 -18 55t-41.5 101.5t-23.5 57.5l-257 1q-15 -33 -44 -112t-29 -93q0 -12 8 -21t25 -14t28 -8t32.5 -5
t23.5 -2v-33q0 -5 -1 -16q-33 0 -99.5 6t-99.5 6q-5 0 -15.5 -2.5t-12.5 -2.5q-45 -8 -107 -8h-6z" />
<glyph glyph-name="list" unicode="&#xe728;"
d="M146 62v-109q0 -8 -5.5 -13.5t-12.5 -5.5h-110q-7 0 -12.5 5.5t-5.5 13.5v109q0 8 5.5 13.5t12.5 5.5h110q7 0 12.5 -5.5t5.5 -13.5zM146 282v-110q0 -7 -5.5 -12.5t-12.5 -5.5h-110q-7 0 -12.5 5.5t-5.5 12.5v110q0 7 5.5 12.5t12.5 5.5h110q7 0 12.5 -5.5t5.5 -12.5z
M146 501v-110q0 -7 -5.5 -12.5t-12.5 -5.5h-110q-7 0 -12.5 5.5t-5.5 12.5v110q0 8 5.5 13t12.5 5h110q7 0 12.5 -5t5.5 -13zM1024 62v-109q0 -8 -5.5 -13.5t-12.5 -5.5h-768q-8 0 -13.5 5.5t-5.5 13.5v109q0 8 5.5 13.5t13.5 5.5h768q7 0 12.5 -5.5t5.5 -13.5zM146 721
v-110q0 -8 -5.5 -13t-12.5 -5h-110q-7 0 -12.5 5t-5.5 13v110q0 7 5.5 12.5t12.5 5.5h110q7 0 12.5 -5.5t5.5 -12.5zM1024 282v-110q0 -7 -5.5 -12.5t-12.5 -5.5h-768q-8 0 -13.5 5.5t-5.5 12.5v110q0 7 5.5 12.5t13.5 5.5h768q7 0 12.5 -5.5t5.5 -12.5zM1024 501v-110
q0 -7 -5.5 -12.5t-12.5 -5.5h-768q-8 0 -13.5 5.5t-5.5 12.5v110q0 8 5.5 13t13.5 5h768q7 0 12.5 -5t5.5 -13zM1024 721v-110q0 -8 -5.5 -13t-12.5 -5h-768q-8 0 -13.5 5t-5.5 13v110q0 7 5.5 12.5t13.5 5.5h768q7 0 12.5 -5.5t5.5 -12.5z" />
<glyph glyph-name="paintbrush" unicode="&#xe751;"
d="M923 812q40 0 70 -26.5t30 -66.5q0 -36 -26 -86q-190 -360 -266 -430q-55 -52 -124 -52q-72 0 -124 53t-52 125q0 73 53 121l365 331q33 31 74 31zM403 221q23 -43 61.5 -74t85.5 -44l1 -40q2 -122 -74 -198.5t-199 -76.5q-71 0 -125 26.5t-87 73t-49.5 104.5t-16.5 126
q4 -3 23.5 -17.5t35.5 -25.5t33.5 -20.5t26.5 -9.5q23 0 31 21q15 37 33.5 64t39.5 43.5t50 27t59 14.5t71 6z" />
<glyph glyph-name="undo" unicode="&#xe7f2;"
d="M951 300q0 -89 -35 -170t-94 -140t-140 -94t-170 -35q-98 0 -186.5 41.5t-151.5 116.5q-4 6 -3.5 13t4.5 12l79 79q5 5 14 5q9 -1 13 -7q42 -54 102.5 -84t128.5 -30q59 0 113 23.5t93.5 63t63 93.5t23.5 113t-23.5 113t-63 93.5t-93.5 63t-113 23.5q-56 0 -107.5 -20.5
t-91.5 -58.5l78 -79q18 -17 8 -39q-9 -23 -33 -23h-256q-15 0 -26 11t-11 26v256q0 24 23 33q22 10 39 -8l75 -73q61 57 139.5 89t162.5 32q89 0 170 -35t140 -94t94 -140t35 -170z" />
<glyph glyph-name="pencil" unicode="&#xe604;"
d="M33 811v-1022v1022zM65 811v-1022v1022zM97 811v-1022v1022zM129 811v-1022v1022zM161 811v-1022v1022zM193 811v-1022v1022zM225 811v-1022v1022zM256 811v-1022v1022zM288 811v-1022v1022zM320 811v-1022v1022zM352 811v-1022v1022zM384 811v-1022v1022zM416 811v-1022
v1022zM448 811v-1022v1022zM480 811v-1022v1022zM512 811v-1022v1022zM544 811v-1022v1022zM576 811v-1022v1022zM608 811v-1022v1022zM640 811v-1022v1022zM672 811v-1022v1022zM704 811v-1022v1022zM736 811v-1022v1022zM768 811v-1022v1022zM799 811v-1022v1022zM831 811
v-1022v1022zM863 811v-1022v1022zM895 811v-1022v1022zM927 811v-1022v1022zM959 811v-1022v1022zM991 811v-1022v1022zM1 779h1022h-1022zM1 747h1022h-1022zM1 715h1022h-1022zM1 683h1022h-1022zM1 651h1022h-1022zM1 619h1022h-1022zM1 587h1022h-1022zM1 556h1022
h-1022zM1 524h1022h-1022zM1 492h1022h-1022zM1 460h1022h-1022zM1 428h1022h-1022zM1 396h1022h-1022zM1 364h1022h-1022zM1 332h1022h-1022zM1 300h1022h-1022zM1 268h1022h-1022zM1 236h1022h-1022zM1 204h1022h-1022zM1 172h1022h-1022zM1 140h1022h-1022zM1 108h1022
h-1022zM1 76h1022h-1022zM1 44h1022h-1022zM1 13h1022h-1022zM1 -19h1022h-1022zM1 -51h1022h-1022zM1 -83h1022h-1022zM1 -115h1022h-1022zM1 -147h1022h-1022zM1 -179h1022h-1022zM863 811q66 0 113 -47t47 -113q0 -53 -32 -95l-64 -64l-223 223l64 64q42 32 95 32zM65 76
l-64 -287l287 64l591 591l-223 223zM715 448l-447 -447l-55 55l447 447z" />
<glyph glyph-name="images" unicode="&#xe7ee;"
d="M915 532l-165 8l-9 107q-2 17 -15 27.5t-31 9.5l-592 -49q-18 -1 -29 -13.5t-10 -29.5l42 -472q2 -17 15.5 -27.5t30.5 -8.5l30 2l-5 -92q0 -18 12.5 -32t32.5 -15l661 -31q19 -1 33.5 11.5t15.5 30.5l28 527q1 19 -12 32.5t-33 14.5zM205 521l-14 -270l-35 -49l-32 356
v1v1q1 8 6 13t13 6l522 43q8 0 14 -4.5t7 -11.5l0.5 -0.5l0.5 -0.5v-0.5v-0.5l6 -61l-438 21q-20 0 -34.5 -12t-15.5 -31zM873 47l-93 111l-55 65q-9 11 -21 11q-10 1 -22 -8l-33 -24q-12 -7 -20 -6q-11 0 -18 7l-3.5 3.5l-3.5 3.5l-86 98q-10 12 -27 13q-18 1 -30 -11
l-202 -218l-14 -14l1 13l13 258l7 126v1v1q5 19 24 18l408 -20l58 -3l116 -5q9 -1 15 -6.5t6 -14.5h0.5t0.5 -0.5v-0.5v-1zM746.5 287q29.5 0 50 21t20.5 50t-20.5 49.5t-50 20.5t-50 -20.5t-20.5 -49.5t20.5 -50t50 -21z" />
<glyph glyph-name="chain" unicode="&#xea36;"
d="M869 201q0 23 -16 39l-119 119q-16 16 -39 16q-24 0 -41 -18q1 -2 10.5 -11t12.5 -12.5t8.5 -11t7.5 -14.5t2 -15q0 -23 -16 -39t-39 -16q-9 0 -16 2t-14.5 7.5t-11 8.5t-12 12t-10.5 11q-19 -18 -19 -42q0 -23 16 -39l118 -118q15 -15 39 -15q22 0 38 14l84 84
q16 16 16 38h1zM467 604q0 23 -16 39l-118 118q-16 16 -39 16q-22 0 -39 -15l-83 -84q-16 -16 -16 -38q0 -23 16 -39l118 -119q16 -15 39 -15q24 0 41 18q-1 1 -10.5 10t-12.5 12.5t-8.5 11t-7.5 14.5t-2 16q0 22 16 38t39 16q9 0 16 -2t14.5 -7t11 -8.5t12 -12.5t10.5 -11
q19 18 19 42v0zM978 201.5q0 -68.5 -48 -116.5l-84 -83q-48 -48 -116 -48q-69 0 -117 49l-118 118q-47 48 -47 116q0 70 50 120l-50 50q-49 -50 -119 -50q-68 0 -116 48l-119 118q-48 48 -48 117t48 116l84 83q48 48 116 48q69 0 117 -49l118 -118q47 -47 47 -116
q0 -70 -50 -119l50 -51q49 51 119 51q68 0 116 -48l119 -119q48 -48 48 -116.5z" />
<glyph glyph-name="eraser" unicode="&#xea9b;" horiz-adv-x="1098"
d="M512 91l192 220h-439l-192 -220h439zM1091 707q8 -20 5 -41t-17 -37l-512 -586q-22 -25 -55 -25h-439q-22 0 -40 12t-27 31q-8 20 -5 41t17 37l512 586q22 25 55 25h439q22 0 40 -12t27 -31z" />
<glyph glyph-name="chainbroken" unicode="&#xe679;"
d="M287 86l-146 -147q-6 -5 -13 -5t-13 5q-5 6 -5 13.5t5 13.5l146 146q6 5 13.5 5t12.5 -5q6 -6 6 -13.5t-6 -12.5zM384 62v-183q0 -8 -5 -13t-13 -5t-13.5 5t-5.5 13v183q0 8 5.5 13.5t13.5 5.5t13 -5.5t5 -13.5zM256 190q0 -8 -5 -13t-13 -5h-183q-8 0 -13 5t-5 13
t5 13.5t13 5.5h183q8 0 13 -5.5t5 -13.5zM978 117q0 -68 -48 -116l-84 -83q-48 -48 -116 -48q-69 0 -117 49l-191 191q-12 12 -24 32l137 11l156 -157q15 -15 38.5 -15.5t39.5 14.5l84 84q16 16 16 38q0 23 -16 39l-157 157l10 137q20 -12 32 -24l192 -192q48 -49 48 -117z
M626 531l-137 -10l-156 156q-16 16 -39 16q-22 0 -39 -15l-84 -84q-16 -16 -16 -38q0 -23 16 -39l157 -156l-10 -138q-20 12 -32 24l-192 192q-48 50 -48 117q0 69 48 116l84 83q48 48 116 48q69 0 117 -49l191 -191q12 -12 24 -32zM987 483q0 -8 -5 -13t-13 -5h-183
q-8 0 -13 5t-5 13t5 13t13 5h183q8 0 13 -5t5 -13zM677 794v-183q0 -8 -5.5 -13t-13.5 -5t-13 5t-5 13v183q0 8 5 13t13 5t13.5 -5t5.5 -13zM909 707l-146 -146q-6 -5 -13 -5t-13 5q-6 6 -6 13.5t6 12.5l146 147q6 5 13 5t13 -5q5 -6 5 -13.5t-5 -13.5z" />
<glyph glyph-name="arrows-alt" unicode="&#xe700;"
d="M806 587l-203 -203l203 -203l83 82q16 18 40 8q22 -9 22 -33v-256q0 -15 -11 -26t-26 -11h-256q-24 0 -33 23q-10 22 8 39l82 83l-203 203l-203 -203l82 -83q18 -17 8 -39q-9 -23 -33 -23h-256q-15 0 -26 11t-11 26v256q0 24 23 33q22 10 39 -8l83 -82l203 203l-203 203
l-83 -82q-10 -11 -25 -11q-7 0 -14 3q-23 9 -23 33v256q0 15 11 26t26 11h256q24 0 33 -23q10 -22 -8 -39l-82 -83l203 -203l203 203l-82 83q-18 17 -8 39q9 23 33 23h256q15 0 26 -11t11 -26v-256q0 -24 -22 -33q-8 -3 -15 -3q-15 0 -25 11z" />
</font>
</defs></svg>
... ...
No preview for this file type
No preview for this file type
... ... @@ -161,4 +161,7 @@ body {
.ivu-menu-item {
color: #fff !important;
}
.iconfont {
display: initial !important;
}
</style>
... ...
... ... @@ -448,6 +448,8 @@ export default {
return this.validate().then(() => {
this.beforeSubmit();
return api.saveBaseProductInfo(this.product);
}, () => {
this.$Message.error('表单验证失败!');
});
},
nextStep: function(go) {
... ...
... ... @@ -116,7 +116,7 @@
<Row>
<Col>
<editor :content="desc" z-index="2" @change="updateProductDesc"></editor>
<editor :content="desc" :z-index="2" @change="updateProductDesc"></editor>
</Col>
</Row>
... ...
... ... @@ -142,12 +142,14 @@
return;
}
this.$Loading.start();
service.productList(
_.merge(params || {}, {
shelfStatus: 0,
size: 20
}))
.then(res => {
this.$Loading.finish();
if (res.code === 200) {
this.updateStore(res.data);
}
... ...
... ... @@ -136,12 +136,14 @@
return;
}
this.$Loading.start();
service.productList(
_.merge(params || {}, {
shelfStatus: 1,
size: 20
}))
.then(res => {
this.$Loading.finish();
if (res.code === 200) {
this.updateStore(res.data);
}
... ...
... ... @@ -161,11 +161,13 @@
return values;
},
productList(params) {
this.$Loading.start();
service.allotPurchaseList(params)
.then(res => {
const fmt = 'YYYY-MM-DD HH:mm:ss';
const list = res.data.records;
this.$Loading.finish();
_.each(list, i => {
i._colorName = i.factoryGoodsName || '';
i.createTime = moment.unix(i.createTime).format(fmt);
... ...
... ... @@ -63,8 +63,10 @@
},
methods: {
getExpList(params) {
this.$Loading.start();
service.allotExpressList(params)
.then(res => {
this.$Loading.finish();
this.handleData(res.data);
});
},
... ...
... ... @@ -163,8 +163,10 @@
return values;
},
productList(params) {
this.$Loading.start();
service.allotPurchaseList(params)
.then(res => {
this.$Loading.finish();
this.processData(res.data);
});
},
... ...
... ... @@ -86,7 +86,7 @@ const plugin = {
Vue.use(Router);
// 附加Vue原型属性
Vue.prop('config', config);
Vue.prop('config', config[process.env.NODE_ENV]);
Vue.prop('store', store);
Vue.prop('cookie', cookie);
... ...
... ... @@ -52,7 +52,18 @@ const plugin = {
routes = routes.concat(common);
Vue.$router = new Router({
routes: routes,
mode: Vue.$config.historyMode
mode: Vue.$config.historyMode,
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
return savedPosition;
} else if (to.hash) {
return {
selector: to.hash
};
} else {
return { x: 0, y: 0 };
}
}
});
}
};
... ...
{
"name": "yoho-shop-manage",
"version": "1.0.2",
"version": "1.0.3",
"description": "",
"main": "app.js",
"scripts": {
... ...
... ... @@ -16,25 +16,28 @@ const cookieSession = require('cookie-session');
const favicon = require('serve-favicon');
const path = require('path');
global.env = {
version: pkg.version,
Production: process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'gray',
Test: (process.env.NODE_ENV || '').indexOf('test') >= 0
};
let app = new Express();
const config = require('./common/config');
const logger = require('yoho-node-lib/lib/logger').init(config);
const helpers = require('yoho-node-lib/lib/helpers');
let app = new Express();
global.yoho = {
logger,
helpers,
config,
apiDomain: config.apiDomain,
version: pkg.version
config
};
app.use(cookieSession({
name: 'yoho-shop',
secret: 'yoho!shop@manage',
cookie: {
maxAge: 2 * 60 * 60 * 1000
}
maxAge: 2 * 60 * 60 * 1000
}));
app.use(compression());
... ...
... ... @@ -66,16 +66,14 @@ const domains = {
shop: 'http://192.168.102.211:30016'
};
const isProd = process.env.NODE_ENV === 'production';
const isTest = (process.env.NODE_ENV || '').indexOf('test') >= 0;
if (isTest) {
if (global.env.Test) {
domains.erp = 'http://192.168.103.82:9098';
domains.platform = 'http://192.168.102.210:8088/platform';
domains.shop = 'http://192.168.102.211:30016';
}
if (isProd) {
if (global.env.Production) {
domains.erp = 'http://gw.erp.yohoops.org';
domains.platform = 'http://api.platform.yohoops.org/platform';
domains.shop = 'http://shops.yohobuy.com';
... ...
const Express = require('express');
let router = Express.Router(); // eslint-disable-line
const request = require('request');
const version = global.yoho.version;
const env = global.env;
let mainProxy = (req, res) => {
request.get(`http://cdn.yoho.cn/yoho-shop-manage/${version}/index.html`).pipe(res);
request.get(`http://cdn.yoho.cn/yoho-shop-manage/${env.version}/index.html`).pipe(res);
};
router.get('/', mainProxy);
... ...
... ... @@ -6,7 +6,7 @@
const Api = require('../common/api');
const _ = require('lodash');
const blacklist = require('../common/api-blacklist');
const apiDomain = global.yoho.apiDomain;
const config = global.yoho.config;
const logger = global.yoho.logger;
const apiReg = /^\/Api/;
... ... @@ -32,7 +32,7 @@ module.exports = (req, res, next) => {
});
}
let apiUrl = _.get(apiDomain, apiMap);
let apiUrl = _.get(config.apiDomain, apiMap);
if (!apiUrl) {
logger.error(`proxy [${req.method}] fail`, `${req.path} can't find proxy url`);
... ...
... ... @@ -8,7 +8,6 @@ const _ = require('lodash');
const Context = require('../framework/context');
const rp = require('request-promise');
const Api = require('../common/api');
const apiDomain = global.yoho.apiDomain;
const config = global.yoho.config;
const regSession = '${0}=([^;]+);';
... ... @@ -19,7 +18,7 @@ class UserService extends Context {
this.api = this.instance(Api);
}
login(account, password) {
return this.api.post(apiDomain.erp.login, {
return this.api.post(config.apiDomain.erp.login, {
account,
password,
platform: config.platform
... ... @@ -33,7 +32,7 @@ class UserService extends Context {
shopLogin(account, password) {
return rp.get({
url: apiDomain.shop.login,
url: config.apiDomain.shop.login,
resolveWithFullResponse: true,
qs: {
user: account,
... ... @@ -61,7 +60,7 @@ class UserService extends Context {
}
getShops(pid) {
return this.api.get(apiDomain.platform.queryShopsByAdminPid, {
return this.api.get(config.apiDomain.platform.queryShopsByAdminPid, {
userId: pid
}).then(result => {
return result;
... ... @@ -69,7 +68,7 @@ class UserService extends Context {
}
profile(pid) {
return this.instance(Api).get(apiDomain.shop.profile.url, {userId: pid});
return this.instance(Api).get(config.apiDomain.shop.profile.url, {userId: pid});
}
}
... ...