UNPKG

press-next

Version:

Vue3 组件库,支持 Composition API

22 lines (16 loc) 670 B
import { removeFirstSlash } from 't-comm/lib/slash/slash'; export function getGpMatchVertUrl(options = { isTestEnv: false, useDevelopBranchInTest: true, routerPath: '', }) { const CUR_BRANCH = options?.useDevelopBranchInTest ? ((import.meta as any).env.VITE_PUBLISH_BRANCH || 'develop').replace(/\//, '.') : 'develop'; const GP_MATCH_URL = { PROD: 'https://h5.igame.qq.com/pmd-mobile.match.gp-next.gp/', TEST: `https://h5-test.igame.qq.com/pmd-mobile.match.gp-next.gp.${CUR_BRANCH}/`, }; const baseUrl = options?.isTestEnv ? GP_MATCH_URL.TEST : GP_MATCH_URL.PROD; return `${baseUrl}${removeFirstSlash(options?.routerPath || '')}`; }