mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 03:01:12 +00:00
no message
This commit is contained in:
parent
ad3e773f27
commit
479d3e3f39
@ -786,7 +786,7 @@ class DialogController extends AbstractController
|
||||
*
|
||||
* @apiParam {Object} id 消息ID(组)
|
||||
* - 1、多个ID用逗号分隔,如:1,2,3
|
||||
* - 2、另一种格式:{"id": "[会话ID]"},如:{"2": 0, "3": 10}
|
||||
* - 2、另一种格式:{"id": "会话ID|0"},如:{"2": 0, "3": 10}
|
||||
* -- 会话ID:标记id之后的消息已读
|
||||
* -- 其他:标记已读
|
||||
*
|
||||
|
||||
@ -42,7 +42,6 @@ class UsersController extends AbstractController
|
||||
/**
|
||||
* @api {get} api/users/login 01. 登录、注册
|
||||
*
|
||||
* @apiDescription 需要token身份
|
||||
* @apiVersion 1.0.0
|
||||
* @apiGroup users
|
||||
* @apiName login
|
||||
|
||||
@ -960,11 +960,19 @@ class Base
|
||||
/**
|
||||
* 判断是否二维数组
|
||||
* @param $array
|
||||
* @param bool $strict 严格模式,是否每个元素都是数组
|
||||
* @return bool
|
||||
*/
|
||||
public static function isTwoArray($array)
|
||||
public static function isTwoArray($array, bool $strict = true)
|
||||
{
|
||||
return is_array($array) && count(array_filter($array, 'is_array')) > 0;
|
||||
if (!is_array($array)) {
|
||||
return false;
|
||||
}
|
||||
$count = count(array_filter($array, 'is_array'));
|
||||
if ($strict) {
|
||||
return $count === count($array);
|
||||
}
|
||||
return $count > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -820,7 +820,7 @@ export default {
|
||||
},
|
||||
render: (h, {row}) => {
|
||||
const checkin_face = $A.cloneJSON(row.checkin_face || '')
|
||||
return h('div', checkin_face ? this.$L('已上传') : '-');
|
||||
return h('AutoTip', checkin_face ? this.$L('已上传') : '-');
|
||||
},
|
||||
}, {
|
||||
key: 'checkin_mac',
|
||||
|
||||
34
resources/assets/js/store/actions.js
vendored
34
resources/assets/js/store/actions.js
vendored
@ -3298,13 +3298,16 @@ export default {
|
||||
state.readTimeout = null;
|
||||
//
|
||||
if (state.userId === 0) {
|
||||
data && (data.read_at = null);
|
||||
return;
|
||||
}
|
||||
if (Object.values(state.readWaitData).length === 0) {
|
||||
const entries = Object.entries(state.readWaitData);
|
||||
if (entries.length === 0) {
|
||||
data && (data.read_at = null);
|
||||
return
|
||||
}
|
||||
const ids = $A.cloneJSON(state.readWaitData);
|
||||
state.readWaitData = {};
|
||||
const ids = Object.fromEntries(entries.slice(0, 100));
|
||||
state.readWaitData = Object.fromEntries(entries.slice(100));
|
||||
//
|
||||
dispatch("call", {
|
||||
method: 'post',
|
||||
@ -3313,18 +3316,23 @@ export default {
|
||||
id: ids
|
||||
}
|
||||
}).then(({data}) => {
|
||||
for (const id in ids) {
|
||||
if (ids.hasOwnProperty(id) && /^\d+$/.test(ids[id])) {
|
||||
state.dialogMsgs.some(item => {
|
||||
if (item.dialog_id == ids[id] && item.id >= id) {
|
||||
item.read_at = $A.daytz().format("YYYY-MM-DD HH:mm:ss")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Object.entries(ids)
|
||||
.filter(([_, dialogId]) => /^\d+$/.test(dialogId))
|
||||
.forEach(([msdId, dialogId]) => {
|
||||
state.dialogMsgs
|
||||
.filter(item => item.dialog_id == dialogId && item.id >= msdId)
|
||||
.forEach(item => {
|
||||
item.read_at = $A.daytz().format("YYYY-MM-DD HH:mm:ss");
|
||||
});
|
||||
});
|
||||
dispatch("saveDialog", data)
|
||||
}).catch(_ => {
|
||||
state.readWaitData = ids;
|
||||
Object.keys(ids)
|
||||
.forEach(id => {
|
||||
const msg = state.dialogMsgs.find(item => item.id == id);
|
||||
if (msg) msg.read_at = null;
|
||||
});
|
||||
state.readWaitData = Object.assign(state.readWaitData, ids);
|
||||
}).finally(_ => {
|
||||
state.readLoadNum++
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user