wx-starlock/pages/webview/webview.vue
范鹏 0b595ed01c 1. 添加全局登录状态
2. 完成修改安全问题
3. 优化请求处理
2024-08-21 16:20:11 +08:00

41 lines
806 B
Vue

<template>
<view>
<web-view :src="url"></web-view>
</view>
</template>
<script>
import baseConfig from '@/config/env'
export default {
data() {
return {
url: ''
}
},
onLoad: function (options) {
console.log(baseConfig.webviewBaseUrl)
const officialAccounts = {
default: {
url: '/app/introduce',
name: '介绍'
},
userAgreement: {
url: '/app/userAgreement',
name: '用户协议'
},
privacy: {
url: '/app/privacy',
name: '隐私政策'
}
}
const item = officialAccounts[options?.type] || officialAccounts['default']
this.url = baseConfig.webviewBaseUrl + item['url']
console.log(this.url)
uni.setNavigationBarTitle({
title: item['name']
})
}
}
</script>