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

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

View File

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