diff --git a/pages/certificate_information/add.vue b/pages/certificate_information/add.vue index 0ae6497..0518f0f 100644 --- a/pages/certificate_information/add.vue +++ b/pages/certificate_information/add.vue @@ -335,20 +335,18 @@ export default { this.form.REVIEW_TIME = uni.$u.timeFormat(event.value, 'yyyy-mm-dd') }, fnAfterRead(event) { - var houzhui = event.file.url.replace(/.+\./, ""); - console.log(houzhui); - if (houzhui == "jpg" || houzhui == "png") { - this.form.fileList.push(event.file) + var houzhui = event.file.name.split('.').pop().toLowerCase(); + console.log(houzhui) + if (['jpg', 'png'].includes(houzhui)) { + this.form.fileList.push(event.file); } else { - uni.$u.toast('图片格式不正确,请上传jpg格式图片或者png格式图片') - this.form.fileList = [] - + uni.$u.toast('图片格式不正确,请上传jpg格式图片或者png格式图片'); } }, fnAfterRead1(event) { - var houzhui = event.file.url.replace(/.+\./, ""); + var houzhui = event.file.name.split('.').pop().toLowerCase(); console.log(houzhui); - if (houzhui == "jpg" || houzhui == "png") { + if (['jpg', 'png'].includes(houzhui)) { this.form.fileListBack.push(event.file) } else { uni.$u.toast('图片格式不正确,请上传jpg格式图片或者png格式图片') diff --git a/pages/mine/information/index.vue b/pages/mine/information/index.vue index 80aaf8e..5072063 100644 --- a/pages/mine/information/index.vue +++ b/pages/mine/information/index.vue @@ -166,6 +166,7 @@ export default { }) } let resData = await getUserInfo({ + USER_ID: this.userInfo.USER_ID, CORPINFO_ID: this.userInfo.CORPINFO_ID, EMPLOYMENT_APPLY_MANAGEMENT_ID: this.EMPLOYMENT_APPLY_MANAGEMENT_ID }) diff --git a/pages/mine/information/update.vue b/pages/mine/information/update.vue index ace4771..de2a1fe 100644 --- a/pages/mine/information/update.vue +++ b/pages/mine/information/update.vue @@ -1032,6 +1032,7 @@ export default { USER_ID: result.pd.USER_ID, PHOTO: this.$filePath + result.pd.PHOTO, userPhoto: this.$filePath + result.pd.PHOTO, + token: this.userInfo.token }) uni.$u.toast('保存成功') setTimeout(() => { diff --git a/store/index.js b/store/index.js index cf0b9e9..e334391 100644 --- a/store/index.js +++ b/store/index.js @@ -15,6 +15,7 @@ const store = new Vuex.Store({ USERNAME: "", USER_ID: "", PHOTO: "", + token: "" }, }, getters: { diff --git a/utils/request.js b/utils/request.js index 62d0e9c..005c26c 100644 --- a/utils/request.js +++ b/utils/request.js @@ -1,4 +1,4 @@ -let requestPath = 'https://qggf.qhdsafety.com/xgfApi/'; // 后台请求地址 +let requestPath = 'http://192.168.0.104:8059/xgf_gwj'; // 后台请求地址 // let requestPath = 'https://skqhdg.porthebei.com:9006/qa-prevention-xgf/'; // 后台请求地址 // let requestPath = 'https://qgxgf.qhdsafety.com/qa-prevention-xgf/'; // 外网地址 import store from '../store/index' @@ -19,7 +19,8 @@ function post(url, data) { }, method: 'POST', header: { - 'Content-type': data?.postMethod || 'application/x-www-form-urlencoded' + 'Content-type': data?.postMethod || 'application/x-www-form-urlencoded', + 'token': store.state.userInfo.token || '' }, success: (res) => { if (res.statusCode != 200){ @@ -71,6 +72,9 @@ function upload(url, data) { filePath: data.filePath, name: data.name || 'file', formData: data.formData || {}, + header: { + 'token': store.state.userInfo.token || '' + }, success: (res) => { uni.hideLoading(); if (JSON.parse(res.data).result === 'success') { @@ -108,6 +112,9 @@ function uploads(url, data) { url: requestPath + url, files: data.files, formData: data.formData || {}, + header: { + 'token': store.state.userInfo.token || '' + }, success: (res) => { uni.hideLoading(); if (JSON.parse(res.data).result === 'success') {