修改兼容h5调试
This commit is contained in:
@@ -233,6 +233,10 @@ export const useWebSocket = defineStore('socketTask', () => {
|
||||
|
||||
// 发送消息
|
||||
const sendMessage = (data) => {
|
||||
console.log('data',data)
|
||||
if(!data){
|
||||
return
|
||||
}
|
||||
if (isConnected.value && data) {
|
||||
// console.log('发送消息', data);
|
||||
socketTask.value.send({
|
||||
|
||||
@@ -115,6 +115,18 @@ export const productStore = defineStore("product", {
|
||||
getLocation() {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log("获取经纬度");
|
||||
// #ifdef H5
|
||||
resolve({
|
||||
accuracy: 65,
|
||||
altitude: 0,
|
||||
errMsg: "getLocation:ok",
|
||||
horizontalAccuracy: 65,
|
||||
latitude: 23.129163,
|
||||
longitude: 113.264435,
|
||||
speed: -1,
|
||||
verticalAccuracy: 65,
|
||||
});
|
||||
// #endif
|
||||
uni.getLocation({
|
||||
type: "wgs84",
|
||||
altitude: true,
|
||||
@@ -298,11 +310,11 @@ export const productStore = defineStore("product", {
|
||||
]) {
|
||||
resolve(
|
||||
true
|
||||
);
|
||||
);
|
||||
} else {
|
||||
reject(
|
||||
false
|
||||
);
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user