'xiaoshan'
This commit is contained in:
@@ -70,7 +70,7 @@ export const ossUpload = (filePath, name, dir,progress,successCallback,errorCall
|
||||
},
|
||||
fail: (err) => {
|
||||
if (typeof(errorCallback) === 'function'){
|
||||
errorCallback({success: false, data: '上传失败'})
|
||||
errorCallback({success: false, data: err})
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -103,7 +103,9 @@
|
||||
this.editData.avatar = res.data
|
||||
await editUserAPI(this.editData)
|
||||
this.$store.dispatch('GetInfo')
|
||||
});
|
||||
}, err => {
|
||||
this.$u.showToast('uploadImageOne',JSON.stringify(err))
|
||||
});
|
||||
},
|
||||
showImage() {
|
||||
this.showImageUpload = true
|
||||
|
||||
@@ -39,11 +39,13 @@ function baseRequest(url, method, data, {
|
||||
reslove(res.data, res);
|
||||
} else if ([410000, 410001, 410002, 401, 402].indexOf(res.data.code) !== -1) {
|
||||
util.toLogin();
|
||||
uni.clearStorageSync('userInfo')
|
||||
reject(res.data);
|
||||
} else if (res.data.code == 500) {
|
||||
uni.$emit('z-paging-error-emit');
|
||||
if (res.data.message && res.data.message.indexOf('登录信息已过期') != -1) {
|
||||
util.toLogin();
|
||||
uni.clearStorageSync('userInfo')
|
||||
}
|
||||
reject(res.data.message || '系统异常');
|
||||
}else{
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
import {getLongUrl , AppVersion} from '@/api/api.js';
|
||||
import { ossUpload } from '@/js_sdk/AliOSS/oss.js'
|
||||
import store from '../store';
|
||||
import icon from '../uni_modules/uview-ui/libs/config/props/icon.js';
|
||||
export default {
|
||||
/**
|
||||
* opt object | string
|
||||
@@ -108,8 +109,9 @@ export default {
|
||||
cancelColor: '#000000',
|
||||
confirmColor: '#526BB1',
|
||||
success: (res) => {
|
||||
console.log(res);
|
||||
if(res.confirm){
|
||||
uni.$u.route('/pages/home/index');
|
||||
this.$tab.navigateTo('/pages/login/login')
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -171,13 +173,18 @@ export default {
|
||||
sizeType:opt.sizeType||['original'],
|
||||
sourceType:opt.sourceType||['album', 'camera'],
|
||||
success: (res) => {
|
||||
uni.showLoading({mask:true,title:'上传中...'});
|
||||
// uni.showLoading({mask:true,title:'上传中...'});
|
||||
res.tempFiles.forEach(item=>{
|
||||
ossUpload(item.path,item.path,opt.dir||'crmebimage/public/maintain/',(p)=>{
|
||||
if (progress != null && typeof(progress) === 'function') {
|
||||
progress(p)
|
||||
}
|
||||
}, successCallback, errorCallback);
|
||||
}, successCallback, err => {
|
||||
uni.showToast({
|
||||
title: JSON.stringify(err),
|
||||
icon: 'none'
|
||||
})
|
||||
});
|
||||
});
|
||||
},
|
||||
fail: err => {
|
||||
|
||||
Reference in New Issue
Block a user