Authored by 陈峰

filter maxwitdh

... ... @@ -30,4 +30,9 @@ export default {
line-height: 32px;
max-width: 100px;
}
.item-col {
input, select, .ivu-select {
max-width: 300px;
}
}
</style>
... ...
... ... @@ -30,6 +30,7 @@ const plugin = {
// return Promise.reject();
},
initPurview(Vue, user) {
Vue.$cookie.set('_isLogin', true);
Vue.$cookie.set('shopsId', user.currentShop.id);
return userService.purviews().then((purviews) => {
this.updateUser(Vue, user, purviews);
... ... @@ -78,9 +79,9 @@ const plugin = {
local: (username, password) => {
return userService.login(username, password).then((res) => {
if (res.code === 200) {
Vue.$cookie.set('_isLogin', true);
this.initPurview(Vue, res.data);
return res.data;
return this.initPurview(Vue, res.data).then(() => {
return res.data;
});
}
return Promise.reject(res);
});
... ...
... ... @@ -5,8 +5,6 @@ const request = require('request');
const logger = global.yoho.logger;
const API_INTERNAL_ERROR = {
code: 500,
message: '服务器错误'
... ... @@ -69,6 +67,7 @@ class Api extends Context {
resolveWithFullResponse: true
});
return rp[options.method || 'get'](options).then(response => {
console.log(response.rawHeaders)
let jsonBody = JSON.parse(response.body);
let req = response.request;
... ...
... ... @@ -22,6 +22,9 @@ class UserService extends Context {
password,
platform: config.platform
}).then(userInfo => {
this.api.get(`http://192.168.102.211:30016/loginInter?user=${account}&password=${password}`).then(res => {
console.log(res);
});
if (userInfo.code !== 200 || !userInfo.data.pid) {
return Promise.reject({code: 500, message: '用户名密码错误'});
}
... ...