|
@@ -259,7 +259,7 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import PageBanner from '../../components/PageBanner.vue'
|
|
import PageBanner from '../../components/PageBanner.vue'
|
|
|
-import { getWealthDetail, verifyPassword, getChildren } from '../../utils/api.js'
|
|
|
|
|
|
|
+import { getWealthDetail, getChildren, switchBackVerify } from '../../utils/api.js'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: { PageBanner },
|
|
components: { PageBanner },
|
|
@@ -390,13 +390,19 @@ export default {
|
|
|
success: async (res) => {
|
|
success: async (res) => {
|
|
|
if (res.confirm && res.content) {
|
|
if (res.confirm && res.content) {
|
|
|
try {
|
|
try {
|
|
|
- var verifyResult = await verifyPassword(res.content)
|
|
|
|
|
- if (verifyResult.code === 200) {
|
|
|
|
|
- this.$store.commit('switchBackToParent')
|
|
|
|
|
|
|
+ var verifyResult = await switchBackVerify(res.content)
|
|
|
|
|
+ if (verifyResult && verifyResult.code === 200 && verifyResult.data === true) {
|
|
|
|
|
+ uni.removeStorageSync('isSwitchedChild')
|
|
|
|
|
+ uni.removeStorageSync('currentChildId')
|
|
|
this.isSwitchedChild = false
|
|
this.isSwitchedChild = false
|
|
|
this.role = 'parent'
|
|
this.role = 'parent'
|
|
|
|
|
+ if (this.$store && this.$store.commit) {
|
|
|
|
|
+ this.$store.commit('switchBackToParent')
|
|
|
|
|
+ }
|
|
|
uni.showToast({ title: '已退出切换', icon: 'success' })
|
|
uni.showToast({ title: '已退出切换', icon: 'success' })
|
|
|
- uni.reLaunch({ url: '/pages/index/index' })
|
|
|
|
|
|
|
+ setTimeout(function() {
|
|
|
|
|
+ uni.reLaunch({ url: '/pages/index/index' })
|
|
|
|
|
+ }, 1000)
|
|
|
} else {
|
|
} else {
|
|
|
uni.showToast({ title: '密码错误', icon: 'none' })
|
|
uni.showToast({ title: '密码错误', icon: 'none' })
|
|
|
}
|
|
}
|