[新增功能](hyx_2025-01-13_xgf2.0):

- 相关方APP2.0联调
hyx_2025-01-13_xgf2.0
huangyuxuan 2025-02-18 17:55:29 +08:00
parent d32d5b310d
commit 0f8890674f
5 changed files with 19 additions and 11 deletions

View File

@ -335,20 +335,18 @@ export default {
this.form.REVIEW_TIME = uni.$u.timeFormat(event.value, 'yyyy-mm-dd') this.form.REVIEW_TIME = uni.$u.timeFormat(event.value, 'yyyy-mm-dd')
}, },
fnAfterRead(event) { fnAfterRead(event) {
var houzhui = event.file.url.replace(/.+\./, ""); var houzhui = event.file.name.split('.').pop().toLowerCase();
console.log(houzhui); console.log(houzhui)
if (houzhui == "jpg" || houzhui == "png") { if (['jpg', 'png'].includes(houzhui)) {
this.form.fileList.push(event.file) this.form.fileList.push(event.file);
} else { } else {
uni.$u.toast('图片格式不正确请上传jpg格式图片或者png格式图片') uni.$u.toast('图片格式不正确请上传jpg格式图片或者png格式图片');
this.form.fileList = []
} }
}, },
fnAfterRead1(event) { fnAfterRead1(event) {
var houzhui = event.file.url.replace(/.+\./, ""); var houzhui = event.file.name.split('.').pop().toLowerCase();
console.log(houzhui); console.log(houzhui);
if (houzhui == "jpg" || houzhui == "png") { if (['jpg', 'png'].includes(houzhui)) {
this.form.fileListBack.push(event.file) this.form.fileListBack.push(event.file)
} else { } else {
uni.$u.toast('图片格式不正确请上传jpg格式图片或者png格式图片') uni.$u.toast('图片格式不正确请上传jpg格式图片或者png格式图片')

View File

@ -166,6 +166,7 @@ export default {
}) })
} }
let resData = await getUserInfo({ let resData = await getUserInfo({
USER_ID: this.userInfo.USER_ID,
CORPINFO_ID: this.userInfo.CORPINFO_ID, CORPINFO_ID: this.userInfo.CORPINFO_ID,
EMPLOYMENT_APPLY_MANAGEMENT_ID: this.EMPLOYMENT_APPLY_MANAGEMENT_ID EMPLOYMENT_APPLY_MANAGEMENT_ID: this.EMPLOYMENT_APPLY_MANAGEMENT_ID
}) })

View File

@ -1032,6 +1032,7 @@ export default {
USER_ID: result.pd.USER_ID, USER_ID: result.pd.USER_ID,
PHOTO: this.$filePath + result.pd.PHOTO, PHOTO: this.$filePath + result.pd.PHOTO,
userPhoto: this.$filePath + result.pd.PHOTO, userPhoto: this.$filePath + result.pd.PHOTO,
token: this.userInfo.token
}) })
uni.$u.toast('保存成功') uni.$u.toast('保存成功')
setTimeout(() => { setTimeout(() => {

View File

@ -15,6 +15,7 @@ const store = new Vuex.Store({
USERNAME: "", USERNAME: "",
USER_ID: "", USER_ID: "",
PHOTO: "", PHOTO: "",
token: ""
}, },
}, },
getters: { getters: {

View File

@ -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://skqhdg.porthebei.com:9006/qa-prevention-xgf/'; // 后台请求地址
// let requestPath = 'https://qgxgf.qhdsafety.com/qa-prevention-xgf/'; // 外网地址 // let requestPath = 'https://qgxgf.qhdsafety.com/qa-prevention-xgf/'; // 外网地址
import store from '../store/index' import store from '../store/index'
@ -19,7 +19,8 @@ function post(url, data) {
}, },
method: 'POST', method: 'POST',
header: { 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) => { success: (res) => {
if (res.statusCode != 200){ if (res.statusCode != 200){
@ -71,6 +72,9 @@ function upload(url, data) {
filePath: data.filePath, filePath: data.filePath,
name: data.name || 'file', name: data.name || 'file',
formData: data.formData || {}, formData: data.formData || {},
header: {
'token': store.state.userInfo.token || ''
},
success: (res) => { success: (res) => {
uni.hideLoading(); uni.hideLoading();
if (JSON.parse(res.data).result === 'success') { if (JSON.parse(res.data).result === 'success') {
@ -108,6 +112,9 @@ function uploads(url, data) {
url: requestPath + url, url: requestPath + url,
files: data.files, files: data.files,
formData: data.formData || {}, formData: data.formData || {},
header: {
'token': store.state.userInfo.token || ''
},
success: (res) => { success: (res) => {
uni.hideLoading(); uni.hideLoading();
if (JSON.parse(res.data).result === 'success') { if (JSON.parse(res.data).result === 'success') {