修正未登录状态下部分功能未能使用的问题

This commit is contained in:
WindowBird 2025-09-13 15:18:18 +08:00
parent e96e22f2b0
commit 3ca6a20434
2 changed files with 15 additions and 2 deletions

View File

@ -99,7 +99,7 @@
{{ `立即支付 ¥${payAmount}` }}
</button>
<view class="agreement">
<view v-if="isLogin" class="agreement">
<view :class="{ checked: hasAgreed }" class="checkbox">
<text v-if="hasAgreed"></text>
</view>
@ -202,6 +202,7 @@ export default {
},
},
onShow() {
this.refreshLogin()
this.getIsSignProtocolInstallationOnshow()
// if (!this.hasAgreed) {
// uni.navigateTo({
@ -223,6 +224,7 @@ export default {
},
data() {
return {
isLogin: false,
hasAgreed: false,
formData: {
quantity: 1,
@ -247,7 +249,15 @@ export default {
}
},
methods: {
refreshLogin() {
if (uni.getStorageSync('token')) {
this.isLogin = true
}
},
async getIsSignProtocolInstallationOnshow() {
if (!uni.getStorageSync('token')) {
return
}
let res = await isSignProtocolInstallation()
console.log('res', res)
console.log('res.data', res.data)
@ -256,6 +266,9 @@ export default {
},
async getIsSignProtocolInstallation() {
if (!uni.getStorageSync('token')) {
return
}
let res = await isSignProtocolInstallation()
console.log('res', res)
console.log('res.data', res.data)

View File

@ -20,7 +20,7 @@ const ENV_CONFIG = {
// 正式版
// baseUrl: 'https://chu.chuangtewl.com/prod-api',
// baseUrl: 'http://192.168.2.21:4601',
baseUrl: 'https://chu.chuangtewl.com/prod-api',
baseUrl: 'http://192.168.2.21:4601',
appId: 1,
},
}