getResourcePath 方法
作用:
获取当前小程序的资源的详细路径。
原型:
export interface CoolinkResPath {
code: number;
msg?: string;
path: string,
}
function getResourcePath(): Promise<CoolinkResPath>;
返回值:
| 属性 | 类型 | 说明 | 解释 |
|---|---|---|---|
| code | number | 错误码 | 表示是否发生错误的一个数字,没有错误则为 0 |
| msg | string | 错误信息文本 | 表示是否发生错误的一个字符串描述,可选 |
| path | string | 小程序资源的存放路径 | 例如:"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);
//
©深圳市酷开网络科技股份有限公司 ICP备案号粤ICP备06098778号
