提交 b6db3303 编写于 作者: Q qiang

Merge branch 'dev' into alpha

......@@ -314,7 +314,7 @@ export default {
db = db.action(action)
}
db.collection(this.collection).add(value).then((res) => {
db.collection(this._getCollection()).add(value).then((res) => {
success && success(res)
if (showToast) {
uni.showToast({
......@@ -388,7 +388,7 @@ export default {
db = db.action(action)
}
return db.collection(this.collection).doc(id).update(value).then((res) => {
return db.collection(this._getCollection()).doc(id).update(value).then((res) => {
success && success(res)
if (showToast) {
uni.showToast({
......@@ -546,9 +546,7 @@ export default {
exec = exec.action(action)
}
const collection = this.collection.indexOf(',') > 0 ? this.collection.substring(0, this.collection.indexOf(',')) : this.collection
exec.collection(collection).where({
exec.collection(this._getCollection()).where({
_id: dbCmd.in(ids)
}).remove().then((res) => {
success && success(res.result)
......@@ -572,6 +570,11 @@ export default {
complete && complete()
})
},
_getCollection() {
const index = this.collection.indexOf(',')
const collection = index > 0 ? this.collection.substring(0, index) : this.collection
return collection
},
removeData (ids) {
const il = ids.slice(0)
const dl = this.dataList
......
......@@ -5,6 +5,7 @@ import {
warpPlusSuccessCallback,
warpPlusErrorCallback
} from '../util'
import { isPlainObject } from 'uni-shared'
function getService (provider) {
return new Promise((resolve, reject) => {
......@@ -135,7 +136,7 @@ export function closeAuthView () {
* 一键登录自定义登陆按钮点击处理
*/
function univerifyButtonsClickHandling (univerifyStyle, errorCallback) {
if (univerifyStyle.buttons &&
if (univerifyStyle && isPlainObject(univerifyStyle) && univerifyStyle.buttons &&
Object.prototype.toString.call(univerifyStyle.buttons.list) === '[object Array]' &&
univerifyStyle.buttons.list.length > 0
) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册