fix: 报告页uid获取增加storage兜底(与wap端同步)
This commit is contained in:
@@ -1515,6 +1515,15 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
dayjs,
|
dayjs,
|
||||||
|
// 获取当前登录用户uid(vuex优先,storage兜底)
|
||||||
|
getUid() {
|
||||||
|
let uid = (typeof vk.getVuex === 'function' && vk.getVuex('$user.userInfo._id')) || ''
|
||||||
|
if (!uid) {
|
||||||
|
const cache = vk.getStorageSync('uni_id_user_info') || {}
|
||||||
|
uid = cache._id || cache.uid || ''
|
||||||
|
}
|
||||||
|
return uid
|
||||||
|
},
|
||||||
menuSelect(e) {
|
menuSelect(e) {
|
||||||
this.menuIndex = String(e)
|
this.menuIndex = String(e)
|
||||||
this.formData.status = Number(e)
|
this.formData.status = Number(e)
|
||||||
@@ -1772,7 +1781,7 @@
|
|||||||
try {
|
try {
|
||||||
const res = await vk.callFunction({
|
const res = await vk.callFunction({
|
||||||
url: 'client/ai/pub/getMyReports',
|
url: 'client/ai/pub/getMyReports',
|
||||||
data: { pageIndex: 1, pageSize: 50, uid: vk.getVuex('$user.userInfo._id') || '' }
|
data: { pageIndex: 1, pageSize: 50, uid: this.getUid() }
|
||||||
});
|
});
|
||||||
if (res.code === 0 && res.data && res.data.rows) {
|
if (res.code === 0 && res.data && res.data.rows) {
|
||||||
this.reportList = res.data.rows.map(r => ({
|
this.reportList = res.data.rows.map(r => ({
|
||||||
@@ -1835,7 +1844,7 @@
|
|||||||
file_id: r.fileId,
|
file_id: r.fileId,
|
||||||
file_name: r.fileName,
|
file_name: r.fileName,
|
||||||
file_size: r.fileSize || 0,
|
file_size: r.fileSize || 0,
|
||||||
uid: vk.getVuex('$user.userInfo._id') || ''
|
uid: this.getUid()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
@@ -1895,7 +1904,7 @@
|
|||||||
file_base64: fileBase64,
|
file_base64: fileBase64,
|
||||||
file_name: file.name,
|
file_name: file.name,
|
||||||
file_size: file.size,
|
file_size: file.size,
|
||||||
uid: vk.getVuex('$user.userInfo._id') || '',
|
uid: this.getUid(),
|
||||||
upload_only: true
|
upload_only: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1942,7 +1951,7 @@
|
|||||||
file_id: this.reviewFileId,
|
file_id: this.reviewFileId,
|
||||||
file_name: this.reviewFile.name,
|
file_name: this.reviewFile.name,
|
||||||
file_size: this.reviewFile.size,
|
file_size: this.reviewFile.size,
|
||||||
uid: vk.getVuex('$user.userInfo._id') || ''
|
uid: this.getUid()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user