From 38a058afd433d0fc4084f4d9f155c2a4b0195ecf Mon Sep 17 00:00:00 2001 From: 1585346868 <1585346868@qq.com> Date: Wed, 15 Apr 2026 19:26:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20target/fwutils/funs.lua?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复教师photo可能出现的崩溃问题 --- target/fwutils/funs.lua | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/target/fwutils/funs.lua b/target/fwutils/funs.lua index 816adc0..c220815 100644 --- a/target/fwutils/funs.lua +++ b/target/fwutils/funs.lua @@ -143,6 +143,40 @@ M.menu_top = function() ]] end +M.teacher_photos = function() + require("app.app") + local conn = db_conn() + local edu_id = edu_id() + local edu_teacher = require("app.function.edu_teacher") + local edu_setting = require("app.function.edu_setting") + local teacher_info = edu_teacher.get_by_id(pint("id"),edu_id,conn) + if teacher_info == nil then + conn:close() + return "" + end + local domain_assets_cn = edu_setting.get_assets_domain_cn(edu_id,conn) + local photos = {} + if teacher_info.photo and type(teacher_info.photo) == "string" and teacher_info.photo ~= "" then + local ok, decoded = pcall(function() return cjson.decode(teacher_info.photo) end) + if ok and type(decoded) == "table" then + photos = decoded + end + end + local content = "