This commit is contained in:
binbin_pan 2024-08-29 08:58:38 +08:00
parent 79f2a9d6b1
commit 9dc605192f
3 changed files with 11 additions and 6 deletions

View File

@ -434,8 +434,8 @@ export default {
}, },
data: params, data: params,
success: res => { success: res => {
console.log('🚀 ~ openFaceScan ~ res-人脸识别:', res)
res = res.data res = res.data
console.log('🚀 ~ openFaceScan ~ res-人脸识别:', res, res.code)
if (res.code == 200) { if (res.code == 200) {
this.$refs.uToast.show({ this.$refs.uToast.show({
message: '人脸识别成功', message: '人脸识别成功',

View File

@ -53,11 +53,13 @@
</template> </template>
<script> <script>
import config from '@/config'
export default { export default {
data() { data() {
return { return {
infos: { infos: {
avatar: '', avatar: config.fileUrl + uni.getStorageSync('facePath'),
username: '', username: '',
unit: '' unit: ''
} }
@ -68,7 +70,6 @@
opt = JSON.parse(opt.params) opt = JSON.parse(opt.params)
this.infos.username = opt.userName this.infos.username = opt.userName
this.infos.unit = opt.className this.infos.unit = opt.className
this.infos.avatar = uni.getStorageSync('facePath')
}, },
methods: { methods: {
// //

View File

@ -110,7 +110,7 @@ export default {
}, },
success: res => { success: res => {
res = res.data res = res.data
console.log('🚀 ~ this.uploadFaceRecognition ~ res上传成功:', res) console.log('🚀 ~ this.uploadFaceRecognition ~ res上传成功:', res, res.code)
if (res.code == 200) { if (res.code == 200) {
uni.showToast({ uni.showToast({
title: '人脸信息录入成功', title: '人脸信息录入成功',
@ -118,13 +118,17 @@ export default {
}) })
uni.removeStorageSync('facePath') uni.removeStorageSync('facePath')
uni.setStorageSync('facePath', this.facePath) uni.setStorageSync('facePath', this.facePath)
setTimeout(() => {
uni.navigateTo({
url: '/pages/YNEduApp/user/user'
})
}, 1000)
} else { } else {
uni.showToast({ uni.showToast({
title: '人脸信息录入失败', title: res.msg,
icon: 'none' icon: 'none'
}) })
} }
uni.navigateBack()
}, },
fail: err => { fail: err => {
console.log('🚀 ~ this.uploadFaceRecognition ~ err:', err) console.log('🚀 ~ this.uploadFaceRecognition ~ err:', err)