提交 26f8116b authored 作者: 王鹏飞's avatar 王鹏飞

Merge branch 'dev' into ecollage

...@@ -107,7 +107,7 @@ export default class API { ...@@ -107,7 +107,7 @@ export default class API {
const { data } = res const { data } = res
/* 带 code 参数,新接口模型 */ /* 带 code 参数,新接口模型 */
if (data.code !== undefined) { if (data.code !== undefined) {
if (data.code !== 0 && !/get-user-info$/gi.test(res.config.url)) { if (data.code !== 0 && !/getinfo$/gi.test(res.config.url)) {
data.msg && Message({ type: 'error', message: data.msg }) data.msg && Message({ type: 'error', message: data.msg })
} }
} }
...@@ -128,7 +128,7 @@ export default class API { ...@@ -128,7 +128,7 @@ export default class API {
const { status, data } = res.response const { status, data } = res.response
/* 不带 code 参数,老接口模型 */ /* 不带 code 参数,老接口模型 */
if (data) { if (data) {
if (status === 403 && !/check-access$/gi.test(res.config.url)) { if (status === 403 && !/getinfo$/gi.test(res.config.url)) {
this.setConfirm('提示', '确定', '登录状态已过期, 请重新登录。') this.setConfirm('提示', '确定', '登录状态已过期, 请重新登录。')
.then(() => { .then(() => {
this.goLoginIndex(_vIn) this.goLoginIndex(_vIn)
......
...@@ -29,7 +29,7 @@ export default class OtherAPI extends BaseAPI { ...@@ -29,7 +29,7 @@ export default class OtherAPI extends BaseAPI {
* @param {[object]} obj * @param {[object]} obj
*/ */
uploadFile = (obj = {}) => uploadFile = (obj = {}) =>
this.post('/api/usercenter/user/upload-image', obj, { this.post('/api/lms/util/upload-file', obj, {
headers: { 'Content-Type': 'multipart/form-data' } headers: { 'Content-Type': 'multipart/form-data' }
}) })
......
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
type: '', type: '',
lastModifiedDate: '', lastModifiedDate: '',
size: '', size: '',
avatar: '' file: ''
}, },
filesArr: [] filesArr: []
} }
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
this.file.type = file.raw.type this.file.type = file.raw.type
this.file.lastModifiedDate = file.raw.lastModifiedDate this.file.lastModifiedDate = file.raw.lastModifiedDate
this.file.size = file.raw.size this.file.size = file.raw.size
this.file.avatar = file.raw this.file.file = file.raw
}, },
uploadFile() { uploadFile() {
if (!/\.(jpg|jpeg|gif|png|bmp)$/gi.test(this.file.name)) { if (!/\.(jpg|jpeg|gif|png|bmp)$/gi.test(this.file.name)) {
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
spinner: '', spinner: '',
background: 'rgba(255, 255, 255, 0.9)' background: 'rgba(255, 255, 255, 0.9)'
}) })
action.Other.uploadFile({ image: this.file.avatar }) action.Other.uploadFile(this.file)
.then(data => { .then(data => {
this.imgUrl = data.url this.imgUrl = data.url
this.updateUser() this.updateUser()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论