Merge remote-tracking branch 'origin/develop' into develop

# Conflicts:
#	public/js/app.js
#	public/js/build/423.js
#	public/js/build/726.js
#	public/js/build/93.js
This commit is contained in:
韦荣超
2022-02-15 09:05:20 +08:00
19 changed files with 87 additions and 57 deletions
+18 -7
View File
@@ -189,7 +189,7 @@ class DialogController extends AbstractController
}
/**
* @api {get} api/dialog/msg/sendtext 06. 发送消息
* @api {post} api/dialog/msg/sendtext 06. 发送消息
*
* @apiDescription 需要token身份
* @apiVersion 1.0.0
@@ -205,6 +205,7 @@ class DialogController extends AbstractController
*/
public function msg__sendtext()
{
Base::checkClientVersion('0.8.1');
$user = User::auth();
//
$chat_nickname = Base::settingFind('system', 'chat_nickname');
@@ -215,8 +216,8 @@ class DialogController extends AbstractController
}
}
//
$dialog_id = intval(Request::input('dialog_id'));
$text = trim(Request::input('text'));
$dialog_id = Base::getPostInt('dialog_id');
$text = trim(Base::getPostValue('text'));
//
if (mb_strlen($text) < 1) {
return Base::retError('消息内容不能为空');
@@ -226,11 +227,21 @@ class DialogController extends AbstractController
//
WebSocketDialog::checkDialog($dialog_id);
//
$msg = [
'text' => $text
];
if (mb_strlen($text) > 2000) {
$array = mb_str_split($text, 2000);
} else {
$array = [$text];
}
//
return WebSocketDialogMsg::sendMsg($dialog_id, 'text', $msg, $user->userid);
$list = [];
foreach ($array as $item) {
$res = WebSocketDialogMsg::sendMsg($dialog_id, 'text', ['text' => $item], $user->userid);
if (Base::isSuccess($res)) {
$list[] = $res['data'];
}
}
//
return Base::retSuccess('发送成功', $list);
}
/**
@@ -150,7 +150,7 @@ class SystemController extends AbstractController
}
/**
* @api {post} api/system/column/template 03. 创建项目模板
* @api {post} api/system/column/template 04. 创建项目模板
*
* @apiDescription 获取创建项目模板、保存创建项目模板
* @apiVersion 1.0.0
@@ -197,7 +197,7 @@ class SystemController extends AbstractController
}
/**
* @api {get} api/system/get/info 04. 获取终端详细信息
* @api {get} api/system/get/info 05. 获取终端详细信息
*
* @apiVersion 1.0.0
* @apiGroup system
@@ -226,7 +226,7 @@ class SystemController extends AbstractController
}
/**
* @api {get} api/system/get/ip 05. 获取IP地址
* @api {get} api/system/get/ip 06. 获取IP地址
*
* @apiVersion 1.0.0
* @apiGroup system
@@ -241,7 +241,7 @@ class SystemController extends AbstractController
}
/**
* @api {get} api/system/get/cnip 06. 是否中国IP地址
* @api {get} api/system/get/cnip 07. 是否中国IP地址
*
* @apiVersion 1.0.0
* @apiGroup system
@@ -258,7 +258,7 @@ class SystemController extends AbstractController
}
/**
* @api {get} api/system/get/ipgcj02 07. 获取IP地址经纬度
* @api {get} api/system/get/ipgcj02 08. 获取IP地址经纬度
*
* @apiVersion 1.0.0
* @apiGroup system
@@ -275,7 +275,7 @@ class SystemController extends AbstractController
}
/**
* @api {get} api/system/get/ipinfo 08. 获取IP地址详细信息
* @api {get} api/system/get/ipinfo 09. 获取IP地址详细信息
*
* @apiVersion 1.0.0
* @apiGroup system
@@ -292,7 +292,7 @@ class SystemController extends AbstractController
}
/**
* @api {post} api/system/imgupload 09. 上传图片
* @api {post} api/system/imgupload 10. 上传图片
*
* @apiDescription 需要token身份
* @apiVersion 1.0.0
@@ -342,7 +342,7 @@ class SystemController extends AbstractController
}
/**
* @api {get} api/system/get/imgview 10. 浏览图片空间
* @api {get} api/system/get/imgview 11. 浏览图片空间
*
* @apiDescription 需要token身份
* @apiVersion 1.0.0
@@ -438,7 +438,7 @@ class SystemController extends AbstractController
}
/**
* @api {post} api/system/fileupload 11. 上传文件
* @api {post} api/system/fileupload 12. 上传文件
*
* @apiDescription 需要token身份
* @apiVersion 1.0.0
+3
View File
@@ -33,6 +33,9 @@ class VerifyCsrfToken extends Middleware
// 修改任务
'api/project/task/update/',
// 聊天发文本
'api/dialog/msg/sendtext/',
// 聊天发文件
'api/dialog/msg/sendfile/',
+1 -3
View File
@@ -508,9 +508,7 @@ class ProjectTask extends AbstractModel
{
AbstractModel::transaction(function () use ($data, &$updateMarking) {
// 判断版本
if (version_compare(Base::getClientVersion(), '0.6.0', '<')) {
throw new ApiException('当前版本过低');
}
Base::checkClientVersion('0.6.0');
// 主任务
$mainTask = $this->parent_id > 0 ? self::find($this->parent_id) : null;
// 工作流
+13
View File
@@ -2,6 +2,7 @@
namespace App\Module;
use App\Exceptions\ApiException;
use App\Models\Setting;
use App\Models\Tmp;
use Cache;
@@ -87,6 +88,18 @@ class Base
return $_A["__static_client_version"];
}
/**
* 检查客户端版本
* @param string $min 最小版本
* @return void
*/
public static function checkClientVersion($min)
{
if (version_compare(Base::getClientVersion(), $min, '<')) {
throw new ApiException('当前版本 (v' . Base::getClientVersion() . ') 过低');
}
}
/**
* 判断是否域名格式
* @param $domain
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "DooTask",
"version": "0.8.0",
"version": "0.8.2",
"description": "DooTask is task management system.",
"main": "main.js",
"license": "MIT",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "DooTask",
"version": "0.8.0",
"version": "0.8.2",
"description": "DooTask is task management system.",
"scripts": {
"start": "./cmd dev",
+23 -24
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -1,6 +1,6 @@
/*!
* html2canvas 1.4.0 <https://html2canvas.hertzen.com>
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
* html2canvas 1.3.4 <https://html2canvas.hertzen.com>
* Copyright (c) 2021 Niklas von Hertzen <https://hertzen.com>
* Released under MIT License
*/
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
-1
View File
@@ -1,6 +1,5 @@
{
"/js/app.js": "/js/app.js",
"/css/app.css": "/css/app.css",
"/.DS_Store": "/.DS_Store",
"/favicon.ico": "/favicon.ico"
}
@@ -69,7 +69,7 @@
type="textarea"
:rows="1"
:autosize="{ minRows: 1, maxRows: 3 }"
:maxlength="255"
:maxlength="20000"
@on-focus="onEventFocus"
@on-blur="onEventblur"
@on-keydown="chatKeydown"
@@ -280,6 +280,7 @@ export default {
dialog_id: this.dialogId,
text: this.msgText,
},
method: 'post'
}).then(({data}) => {
this.tempMsgs = this.tempMsgs.filter(({id}) => id != tempId)
this.sendSuccess(data);
@@ -387,6 +388,12 @@ export default {
},
sendSuccess(data) {
if ($A.isArray(data)) {
data.some(item => {
this.sendSuccess(item)
})
return;
}
this.$store.dispatch("saveDialogMsg", data);
this.$store.dispatch("increaseTaskMsgNum", this.dialogId);
this.$store.dispatch("updateDialogLastMsg", data);
@@ -393,7 +393,7 @@
:disabled="sendLoad > 0"
:rows="1"
:autosize="{ minRows: 1, maxRows: 3 }"
:maxlength="255"
:maxlength="20000"
:placeholder="$L('输入消息...')"
@on-keydown="msgKeydown"
@on-input-paste="msgPasteDrag"/>