连接unicloud数据库一直报错:Error: 无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。
<template>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title">{{title}}</text>
</view>
<button @click="test1" type="warn">test1</button>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
test1() {
uniCloud.callFunction({
name:'get_test1',
success(res) {
console.log(res)
},
fail(err) {
console.log("err=",err)
}
})
}
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>
2 个回复
1***@qq.com (作者)
测试的是app,真机调试,一直报这个错。h5正常返回。
DCloud_UNI_CHB
需要确保手机和你的开发PC电脑处于同一个局域网下,可以互相访问。