Authored by htoooth

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

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