// 获取微信小程序外链
import {tansParams} from "@/utils/ruoyi";

export function getWxSchemeUrl(path, query) {
  return `${process.env.VUE_APP_WX_DEVICE_URL}&path=${path}&query=${encodeURIComponent(query)}`;
}

// 设备二维码链接
export function getWxIndexUrl(query) {
  let url = `https://kang.chuangtewl.com/w`;
  if (query != null ) {
    if (query instanceof Object) {
      query = tansParams(query).slice(0, -1);
    }
    if (query.length > 0) {
      url += `?${query}`;
    }
  }
  return url;
}

// 推广码链接
export function getShareCodeWxUrl(code) {
  return `https://kang.chuangtewl.com/sc?c=${code}`
}
