getResourcePath 方法

作用:

获取当前小程序的资源的详细路径。

原型:

export interface CoolinkResPath {
  code: number;
  msg?: string;
  path: string,
}

function getResourcePath(): Promise<CoolinkResPath>;

返回值:

属性类型说明解释
codenumber错误码表示是否发生错误的一个数字,没有错误则为 0
msgstring错误信息文本表示是否发生错误的一个字符串描述,可选
pathstring小程序资源的存放路径例如:"https://webapp.skysrt.com/app1" 或
"/data/data/com.coocaa.os.coolink/res1/xxxxx"

范例:

import { coolink, Util } from 'coolink';

let info = await coolink.baseinfo.CoolinkResPath();
Util.log('当前路径是 ' + info.path);

//
Last Updated:
Contributors: liangquanqing
©深圳市酷开网络科技股份有限公司 ICP备案号粤ICP备06098778号