资源类型

通过引入 @/common/service/resources 文件调用接口
目前总共六种资源类型需要通过服务端接口返回:

type name 是否需要区分模块
INPUT 输入端口 不需要,默认为0
OUTPUT 输出端口 不需要,默认为0
SOUND_YX 音效-音效 需要
SOUND_BJ 音效-背景 需要
MEDIA_SP MP4-视频 需要
MEDIA_TP MP4-图片 需要

获取资源接口

  1. import resources from "@/common/service/resources";
  2. resources.fetch(
  3. theme_id, // 主题id
  4. type, // 资源类型
  5. module // 模块,如果不需要模块的资源可以不传入。
  6. ).then(res=>{
  7. // 返回的数据结构
  8. res = [ { value:1,label:"模块1" } ,{ value:2,label:"模块2" } ]
  9. })

更新资源的label

  1. import resources from "@/common/service/resources";
  2. resources.updateName(
  3. theme_id, // 主题id
  4. type, // 资源类型
  5. value, // 值 1~500
  6. label, // 需要修改的名字
  7. module // 模块,如果不需要模块的资源就传入 0
  8. ).then(res=>{
  9. })