const app = tcb.init({
env: 'vue-douyin-test-16f173'
})
app
.auth({ persistance: "session" })
.anonymousAuthProvider()
.signIn()
.then(() => loginInPhone())
.catch(err => console.error(err))
function queryVideos() {
const DB = app.database()
const _ = DB.command;
DB.collection('videos')
.where({
city: _.eq("上海市")
})
//.orderBy("_id","desc")
//.limit(4)
.skip(0)
.get()
.then(res => console.log(res))
}
function login() {
app.callFunction({
name: "login",
data: { username:"123", password:"1234" }
})
.then(res => console.log(res))
}
function loginInPhone() {
app.callFunction({
name:"smsVerify",
data: { phoneNum: "123", isSendSms: false }
})
.then(res => console.log(res))
}
console