Authored by htoooth

Merge remote-tracking branch 'origin/release/1.0' into release/1.0

1 import Vue from 'vue'; 1 import Vue from 'vue';
2 import Router from 'vue-router'; 2 import Router from 'vue-router';
  3 +import Promise from 'promise-polyfill';
3 import App from './pages/app'; 4 import App from './pages/app';
4 import Routers from './pages'; 5 import Routers from './pages';
5 import yohoPluginCore from './plugins/yoho-plugin-core'; 6 import yohoPluginCore from './plugins/yoho-plugin-core';
@@ -8,9 +9,20 @@ import './filters'; @@ -8,9 +9,20 @@ import './filters';
8 import './directives'; 9 import './directives';
9 import 'iview/dist/styles/iview.css'; 10 import 'iview/dist/styles/iview.css';
10 import 'font-awesome/css/font-awesome.css'; 11 import 'font-awesome/css/font-awesome.css';
11 -import Promise from 'promise-polyfill';  
12 12
13 -// To add to window 13 +// 兼容IE的Function没有name属性为题,为了修复iView的bug
  14 +if (!(function f() {}).name) {
  15 + Object.defineProperty(Function.prototype, 'name', { //eslint-disable-line
  16 + get: function() {
  17 + let name = (this.toString().match(/^function\s*([^\s(]+)/) || [])[1];
  18 +
  19 + Object.defineProperty(this, 'name', { value: name });
  20 + return name;
  21 + }
  22 + });
  23 +}
  24 +
  25 +// 使用了webpack code spliting IE下需要promise ployfill
14 if (!window.Promise) { 26 if (!window.Promise) {
15 window.Promise = Promise; 27 window.Promise = Promise;
16 } 28 }
@@ -38,7 +38,7 @@ export default { @@ -38,7 +38,7 @@ export default {
38 }, 38 },
39 switchShop(id) { 39 switchShop(id) {
40 this.userInfo.currentShop = this.userInfo.shops.find(shop => shop.id === id); 40 this.userInfo.currentShop = this.userInfo.shops.find(shop => shop.id === id);
41 - Vue.updateUser(this.userInfo); 41 + Vue.switchShop(id);
42 } 42 }
43 } 43 }
44 }; 44 };
@@ -85,6 +85,11 @@ const plugin = { @@ -85,6 +85,11 @@ const plugin = {
85 }); 85 });
86 } 86 }
87 }; 87 };
  88 + Vue.switchShop = shopsId => {
  89 + Vue.$cookie.set('shopsId', shopsId, {
  90 + path: '/'
  91 + });
  92 + };
88 Vue.logout = () => { 93 Vue.logout = () => {
89 _.each(config.storeKeys, Vue.$store.remove); 94 _.each(config.storeKeys, Vue.$store.remove);
90 Vue.prop('user', void 0); 95 Vue.prop('user', void 0);
@@ -3,8 +3,8 @@ const _ = require('lodash'); @@ -3,8 +3,8 @@ const _ = require('lodash');
3 // api调用列表 3 // api调用列表
4 let domainApis = { 4 let domainApis = {
5 erp: { 5 erp: {
6 - login: '/erp-gateway-web/account/profile/login',  
7 - getPurview: '/erp-gateway-web/account/menu/query_by_pid' 6 + login: '/erp-shop-web/account/profile/login',
  7 + getPurview: '/erp-shop-web/account/menu/query_by_pid'
8 }, 8 },
9 platform: { 9 platform: {
10 queryShopsByAdminPid: '/SellerShopController/queryShopsByAdminPid', 10 queryShopsByAdminPid: '/SellerShopController/queryShopsByAdminPid',
@@ -36,7 +36,7 @@ let domainApis = { @@ -36,7 +36,7 @@ let domainApis = {
36 36
37 // 域名列表 37 // 域名列表
38 const domains = { 38 const domains = {
39 - erp: 'http://192.168.13.249', 39 + erp: 'http://192.168.103.82:9098',
40 platform: 'http://192.168.102.210:8088/platform', 40 platform: 'http://192.168.102.210:8088/platform',
41 shop: 'http://192.168.102.211:30016' 41 shop: 'http://192.168.102.211:30016'
42 }; 42 };