尝试启用公告功能

This commit is contained in:
MrZ_26
2024-08-07 12:53:35 +08:00
parent 26287c8f35
commit 59f390de93
3 changed files with 27 additions and 7 deletions

View File

@@ -187,16 +187,36 @@ function NET.getAvatar(uid)
end
end)
end
function NET.getNotice(lang,count)
function NET.launchNotice()
local lang=SETTING.locale:find('zh') and 'zh_cn' or 'en_us'
TASK.new(function()
local res=getMsg({
pool='getNotice',
path='/techmino/api/v1/notice?language='..lang..'&lastCount=1',
},6.26)
if res and res.code==200 then
local opt=res.data.contents[1]
if opt then
MES.new('info',opt.content,12.6)
else
MES.new('info',text.Techrater.NoticeManager.noticeNotFound)
end
end
end)
end
function NET.getNotice(count)
local lang=SETTING.locale:find('zh') and 'zh_cn' or 'en_us'
WAIT{timeout=6.26}
TASK.new(function()
local res=getMsg({
pool='getNotice',
path='/techmino/api/v1/notice?language='..(lang or 'zh_cn')..'&lastCount='..(count or 5),
path='/techmino/api/v1/notice?language='..lang..'&lastCount='..(count or 5),
},6.26)
if res and res.code==200 and type(res.data)=='string' then
local dataStr=""
if res and res.code==200 then
local dataStr=TABLE.dump(res.data)
SCN.go('notice',nil,dataStr)
end
end)