|
|
@@ -121,12 +121,18 @@ export default {
|
|
|
editable: true,
|
|
|
success: async function(res) {
|
|
|
if (!res.confirm || !res.content) return
|
|
|
- var ok = await self.$store.dispatch('switchBackWithPassword', res.content)
|
|
|
- if (ok) {
|
|
|
- self.isSwitchedChild = false
|
|
|
- self.role = 'parent'
|
|
|
- uni.showToast({ title: '已退出切换', icon: 'success' })
|
|
|
- uni.reLaunch({ url: '/pages/index-home/index' })
|
|
|
+ try {
|
|
|
+ var ok = await self.$store.dispatch('switchBackWithPassword', res.content)
|
|
|
+ if (ok) {
|
|
|
+ self.isSwitchedChild = false
|
|
|
+ self.role = 'parent'
|
|
|
+ uni.showToast({ title: '已退出切换', icon: 'success' })
|
|
|
+ uni.reLaunch({ url: '/pages/index-home/index' })
|
|
|
+ } else {
|
|
|
+ uni.showToast({ title: '密码错误', icon: 'none' })
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ uni.showToast({ title: '验证失败', icon: 'none' })
|
|
|
}
|
|
|
}
|
|
|
})
|