1***@qq.com
1***@qq.com
  • 发布:2024-03-12 14:50
  • 更新:2024-03-13 18:54
  • 阅读:88

连接unicloud数据库一直报错:Error: 无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。

分类:uni-app

连接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>

2024-03-12 14:50 负责人:无 分享
已邀请:
1***@qq.com

1***@qq.com (作者)

测试的是app,真机调试,一直报这个错。h5正常返回。

DCloud_UNI_CHB

DCloud_UNI_CHB

需要确保手机和你的开发PC电脑处于同一个局域网下,可以互相访问。

要回复问题请先登录注册