Commit 62039be5 by 肖康

Merge branch 'feature/20251222/notice' of…

Merge branch 'feature/20251222/notice' of http://git.ichunt.net/liyang/CMS-Message into feature/20251222/notice

# Conflicts:
#	public/js/public_notice.js
parents b8c7de70 9f423879
...@@ -15,6 +15,27 @@ use Illuminate\Routing\Controller; ...@@ -15,6 +15,27 @@ use Illuminate\Routing\Controller;
//TODO 上线之后去除注释这个notice ,5。0版本的缺陷 https://blog.csdn.net/weixin_44251615/article/details/93710829 //TODO 上线之后去除注释这个notice ,5。0版本的缺陷 https://blog.csdn.net/weixin_44251615/article/details/93710829
ini_set("error_reporting","E_ALL & ~E_NOTICE"); ini_set("error_reporting","E_ALL & ~E_NOTICE");
// 1. 设置允许跨域的源地址(精准匹配你的前端域名)
$allowedOriginArr = [
'http://wms.liexin.net','http://order2.xiaokang.liexinlocal.com'
];
// 2. 检查请求头中的Origin是否为允许的域名
if (isset($_SERVER['HTTP_ORIGIN']) && in_array($_SERVER['HTTP_ORIGIN'],$allowedOriginArr)) {
header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");
}
// 3. 允许携带Cookie(如果你的请求需要传Cookie/Token,必须加这行)
header('Access-Control-Allow-Credentials: true');
// 4. 允许的请求方法(根据接口实际需求调整,如GET/POST/PUT等)
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
// 5. 允许的请求头(按需添加,比如Content-Type、Token等)
header('Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With');
// 6. 处理预检请求(OPTIONS请求)
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
http_response_code(200);
exit; // 预检请求无需返回业务数据,直接结束
}
class NoticeController extends Controller class NoticeController extends Controller
{ {
...@@ -33,6 +54,9 @@ class NoticeController extends Controller ...@@ -33,6 +54,9 @@ class NoticeController extends Controller
public function businessNoticeList(Request $request) public function businessNoticeList(Request $request)
{ {
$data = $request->all(); $data = $request->all();
try{ try{
$data['show_status'] = 1; $data['show_status'] = 1;
...@@ -61,10 +85,8 @@ class NoticeController extends Controller ...@@ -61,10 +85,8 @@ class NoticeController extends Controller
$obj_id = $request->input('obj_id'); $obj_id = $request->input('obj_id');
$act_type = $request->input('act_type'); $act_type = $request->input('act_type');
$act_types = ($act_type) ? [$act_type] : []; $act_types = ($act_type) ? [$act_type] : [];
$data = [
"list" => ActionLogService::getLogsByObjId($obj_type, $obj_id, $act_types) return $this->codeExport(0, '保存成功',ActionLogService::getLogsByObjId($obj_type, $obj_id, $act_types));
];
return $this->codeExport(0, '保存成功',$data);
} }
......
...@@ -158,6 +158,7 @@ class ActionLogService{ ...@@ -158,6 +158,7 @@ class ActionLogService{
$create_uids = array_column($action_logs, 'act_uid'); $create_uids = array_column($action_logs, 'act_uid');
$cms_user_name_map = self::dataDecode($create_uids); $cms_user_name_map = self::dataDecode($create_uids);
foreach ($action_logs as &$log) { foreach ($action_logs as &$log) {
$log['content'] = json_decode($log['log_data'],true);
$log['log_data'] = self::dataDecode($log['log_data']); $log['log_data'] = self::dataDecode($log['log_data']);
$log['create_time'] = empty($log['create_time'])?'':date('Y-m-d H:i:s',$log['create_time']); $log['create_time'] = empty($log['create_time'])?'':date('Y-m-d H:i:s',$log['create_time']);
} }
......
...@@ -214,7 +214,7 @@ layui.use(['form', 'table', 'laydate', 'layedit'], function () { ...@@ -214,7 +214,7 @@ layui.use(['form', 'table', 'laydate', 'layedit'], function () {
type: 1, type: 1,
title: '查看日志', title: '查看日志',
offset: '50px', offset: '50px',
area: ['900px', '450px'], area: ['900px', 'auto'],
shadeClose: false, shadeClose: false,
resize: false, resize: false,
move: false, move: false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment