Authored by yyq

fix login

... ... @@ -85,7 +85,7 @@ yoho.auth = async (args) => {
} = args || {};
let user;
if (needLogin) {
if (!needLogin) {
user = await sdk.getUser(true);
}
... ...
... ... @@ -124,8 +124,14 @@ export default {
this.uploading = true;
},
successHandler(file) {
if (get(file, 'response.code') === 200 && this.uploadCallback) {
this.uploadCallback(get(file, 'response.data.imagesList[0]'), file.url);
if (get(file, 'response.code') === 200) {
this.uploadCallback && this.uploadCallback(get(file, 'response.data.imagesList[0]'), file.url);
} else {
this.$createToast && this.$createToast({
txt: res.message || '上传失败',
type: 'txt',
time: 1000
}).show();
}
this.uploading = false;
... ...