|
|
@ -41,6 +41,9 @@ |
|
|
|
<button class="btn flex flex-center out-btn" type="button" @click="logout"> |
|
|
|
<button class="btn flex flex-center out-btn" type="button" @click="logout"> |
|
|
|
退出 |
|
|
|
退出 |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
|
|
|
|
<button class="btn flex flex-center out-btn" type="button" @click="deleteUser"> |
|
|
|
|
|
|
|
注销 |
|
|
|
|
|
|
|
</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view :class="{ mask: popupShow }" @click="popupShow = false"></view> |
|
|
|
<view :class="{ mask: popupShow }" @click="popupShow = false"></view> |
|
|
@ -76,7 +79,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import userInfoMixin from "@/mixins/userInfo"; |
|
|
|
import userInfoMixin from "@/mixins/userInfo"; |
|
|
|
import { changePwd, getAuthCode, saveUserInfo, logout } from "@/api/user"; |
|
|
|
import { changePwd, getAuthCode, saveUserInfo, logout, deleteUser } from "@/api/user"; |
|
|
|
import { VALID_LOGIN_STATUS } from "@/store/types/action-types"; |
|
|
|
import { VALID_LOGIN_STATUS } from "@/store/types/action-types"; |
|
|
|
import { SET_LOGIN, SET_LOGOUT } from "@/store/types/muations-types"; |
|
|
|
import { SET_LOGIN, SET_LOGOUT } from "@/store/types/muations-types"; |
|
|
|
|
|
|
|
|
|
|
@ -238,6 +241,22 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
deleteUser() { |
|
|
|
|
|
|
|
uni.showModal({ |
|
|
|
|
|
|
|
title: "提示", |
|
|
|
|
|
|
|
content: "确定注销账号?", |
|
|
|
|
|
|
|
success: async ({ confirm }) => { |
|
|
|
|
|
|
|
if (!confirm) return; |
|
|
|
|
|
|
|
await deleteUser(); |
|
|
|
|
|
|
|
this.$store.commit("app/" + SET_LOGOUT); |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
uni.reLaunch({ |
|
|
|
|
|
|
|
url: "/pages/index/index", |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, 500); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|