11
This commit is contained in:
1 parent
e1ac23b5af
commit
a76f180161
1 file changed
+17
-12
@@ -7,16 +7,9 @@
|
||||
{{ loginError }}
|
||||
</view>
|
||||
<view class="h-100rpx" />
|
||||
<tm-button v-if="!loginError" @click="show = true">继续跳转</tm-button>
|
||||
<tm-button v-if="!loginError" @click="openThirdAppConfirm">继续跳转</tm-button>
|
||||
<tm-button v-else @click="retryLogin">清除缓存并重试</tm-button>
|
||||
</view>
|
||||
|
||||
<tm-modal v-model:show="show" :overlayClick="false" title="注意" position="bottom" height="auto"
|
||||
:showCancel="true" cancelText="取消" confirmText="继续访问" @confirm="thirdAppJump()" @cancel="show = false">
|
||||
<tm-text font-size="30" color="#999999">
|
||||
您即将离开智慧后勤应用并跳转到第三方应用,请注意个人隐私和账号财产安全。您通过第三方服务页面主动提供给第三方商户的个人信息,相关信息保护责任由第三方商户承担。
|
||||
</tm-text>
|
||||
</tm-modal>
|
||||
</crud-layout>
|
||||
</template>
|
||||
|
||||
@@ -31,15 +24,28 @@ import { clearBizSession, ensureBizLogin, recoverBizSession } from "@@/utils/req
|
||||
// type: "4",
|
||||
// })
|
||||
|
||||
const show = ref(false)
|
||||
const loginError = ref("")
|
||||
|
||||
const openThirdAppConfirm = () => {
|
||||
uni.showModal({
|
||||
title: "注意",
|
||||
content:
|
||||
"您即将离开智慧后勤应用并跳转到第三方应用,请注意个人隐私和账号财产安全。您通过第三方服务页面主动提供给第三方商户的个人信息,相关信息保护责任由第三方商户承担。",
|
||||
showCancel: true,
|
||||
cancelText: "取消",
|
||||
confirmText: "继续访问",
|
||||
success: (res) => {
|
||||
if (res.confirm) void thirdAppJump()
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
const ensureLoginAndMaybeOpen = async (autoOpenModal: boolean) => {
|
||||
loginError.value = ""
|
||||
try {
|
||||
const ok = await ensureBizLogin()
|
||||
if (ok) {
|
||||
if (autoOpenModal) show.value = true
|
||||
if (autoOpenModal) openThirdAppConfirm()
|
||||
return
|
||||
}
|
||||
loginError.value = "登录失败,可点下方清除缓存后重试"
|
||||
@@ -54,7 +60,7 @@ const retryLogin = async () => {
|
||||
clearBizSession({ clearRole: true })
|
||||
const ok = await recoverBizSession()
|
||||
if (ok) {
|
||||
show.value = true
|
||||
openThirdAppConfirm()
|
||||
return
|
||||
}
|
||||
loginError.value = "仍无法登录,请关闭后从工作台重新进入"
|
||||
@@ -91,7 +97,6 @@ const thirdAppJump = async () => {
|
||||
uni.showLoading({ title: "跳转中", mask: true })
|
||||
const res: any = await merchantApi.lbLogin()
|
||||
if (res.code == 0) {
|
||||
show.value = false
|
||||
if (!res.data) return uni.showToast({ title: "url错误", icon: "none" })
|
||||
window.location.href = res.data
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user