PageSourceSearch

https://www.ottohub.cn/assets/videoStaffApi-BM5KDgOf.js

js ottohub.cn collected 2026-10-06 13:14:40 UTC 3,868 bytes, 1 lines download raw bytes

1import{l as e,o as t,s as n}from"./apiResponse-C8fEm_-L.js";var r={error_token:`登录失效,请重新登录`,error_vid:`视频 ID 无效`,error_staff_id:`邀请不存在`,staff_already_responded:`该邀请已处理`,staff_too_many:`参演人员最多 10 人`,error_staff:`参演人员数据无效`,error_staff_uid:`参演用户不存在`,staff_cannot_self:`不能添加本人为参演者`,staff_duplicate:`参演人员不能重复`,error_staff_role:`请填写参演角色`,staff_role_too_long:`参演角色过长(最多 32 字)`,blocked:`与目标用户存在拉黑关系`,no_permission:`无权操作`,system_error:`系统错误,请稍后重试`};function i(e){return{uid:Number(e.uid)||0,username:String(e.username??``),avatarUrl:e.avatar_url?String(e.avatar_url):void 0,role:String(e.role??``),sortOrder:e.sort_order==null?void 0:Number(e.sort_order),id:e.id==null?void 0:Number(e.id),status:e.status==null?void 0:Number(e.status)}}function a(e){return Array.isArray(e)?e.map(e=>i(e)).filter(e=>e.uid>0):[]}function o(e){return Array.isArray(e)?e.map(e=>{let t=i(e),n=e;return{...t,id:n.id==null?void 0:Number(n.id),status:n.status==null?void 0:Number(n.status),canReinvite:Number(n.can_reinvite)===1}}).filter(e=>e.uid>0):[]}function s(e){let t=Number(e.id),n=Number(e.vid);return!Number.isFinite(t)||t<=0||!Number.isFinite(n)||n<=0?null:{id:t,vid:n,role:String(e.role??``),invitedAt:String(e.invited_at??``),videoTitle:String(e.video_title??``),ownerUid:Number(e.owner_uid)||0,ownerUsername:String(e.owner_username??``),ownerAvatarUrl:e.owner_avatar_url?String(e.owner_avatar_url):void 0}}async function c(i,a=0,o=20){let c=await fetch(e(`/api/video/staff/invites`,{token:i,offset:a,num:o}),{cache:`no-store`}),l=await t(c),u=n(c,l,{messages:r,fallback:`获取参演邀请失败`});if(u)throw Error(u);let d=l&&typeof l==`object`&&l.data?l.data:l,f=(Array.isArray(d.invite_list)?d.invite_list:[]).map(e=>s(e)).filter(e=>e!==null);return{invites:f,totalCount:Number(d.total_count)||f.length}}async function l(i,a){let o=await fetch(e(`/api/video/staff/${encodeURIComponent(String(i))}/accept`),{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:a}),cache:`no-store`}),s=await t(o),c=n(o,s,{messages:r,fallback:`同意邀请失败`});if(c)throw Error(c)}async function u(i,a){let o=await fetch(e(`/api/video/staff/${encodeURIComponent(String(i))}/reject`),{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:a}),cache:`no-store`}),s=await t(o),c=n(o,s,{messages:r,fallback:`拒绝邀请失败`});if(c)throw Error(c)}async function d(i,a){let s=await fetch(e(`/api/video/${encodeURIComponent(String(i))}/staff`,{token:a}),{cache:`no-store`}),c=await t(s),l=n(s,c,{messages:r,fallback:`获取参演名单失败`});if(l)throw Error(l);return o((c&&typeof c==`object`&&c.data?c.data:c).staff)}async function f(i,a,o){let s=await fetch(e(`/api/video/${encodeURIComponent(String(i))}/staff`),{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:a,staff:o}),cache:`no-store`}),c=await t(s),l=n(s,c,{messages:r,fallback:`更新参演名单失败`});if(l)throw Error(l)}async function p(i,a,o){let s=await fetch(e(`/api/video/staff/${encodeURIComponent(String(i))}/reinvite`),{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(o?{token:a,role:o}:{token:a}),cache:`no-store`}),c=await t(s),l=n(s,c,{messages:r,fallback:`再次邀请失败`});if(l)throw Error(l)}function m(e){return e.filter(e=>e.uid>0&&e.role.trim()).map(e=>({uid:e.uid,role:e.role.trim()}))}function h(e){return e.map(e=>({uid:e.uid,username:e.username,avatarUrl:e.avatarUrl,role:e.role,id:`id`in e?e.id:void 0,status:`status`in e?e.status:void 0,canReinvite:`canReinvite`in e?e.canReinvite:void 0}))}export{p as a,m as c,a as i,f as l,c as n,u as o,d as r,h as s,l as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.