提交 97b7f98e 编写于 作者: M MicroMilo

修复间谍bug(雾)

上级 98c8a9a7
......@@ -14,7 +14,11 @@ exports.main = async (event, context) => {
"duration": res.data[0]["duration"],
"pace": res.data[0]["pace"],
"StartDatetime": res.data[0]["start_date"],
"feeling": res.data[0]["feelings"]
"feeling": res.data[0]["feelings"],
"startPoint": res.data[0]["start_point"],
"endPoint": res.data[0]["end_point"],
"pathLine": res.data[0]["path_line"]
}
}
}
......
......@@ -6,6 +6,15 @@ exports.main = async (event, context) => {
const db = uniCloud.database();
let collection = db.collection('mustgo-running-record');
if (event.distance < 0.01) {
return {
code: 400,
message: "距离过短,不予保存",
data: {
}
}
}
let res = await collection.add({
start_date: event.startTime,
duration: event.duration,
......
......@@ -6,10 +6,19 @@ exports.main = async (event, context) => {
const db = uniCloud.database();
let collection = db.collection('mustgo-walking-record');
if (event.distance < 0.01) {
return {
code: 400,
message: "距离过短,不予保存",
data: {
}
}
}
let res = await collection.add({
start_date: event.startTime,
duration: event.duration,
// feelings: event.feelings,
feelings: "",
owner_id: event.userId,
distance: event.distance,
pace: event.pace,
......
......@@ -6,8 +6,18 @@ exports.main = async (event, context) => {
let teamres = await teamcollection.where({
_id: event.teamId
}).get()
if (teamres.affectedDocs == 1) {
let userres = await collection.where({
_id: event.userId
}).get()
if(userres.data[0]["team_id"] != "") {
return {
"code": 400,
"message": "加入小队失败",
"data": {}
}
}
const res = await collection.doc(event.userId).update({
team_id: event.teamId
})
......@@ -28,4 +38,4 @@ exports.main = async (event, context) => {
"message": "加入小队失败",
"data": {}
}
};
\ No newline at end of file
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册