Procházet zdrojové kódy

feat: 内容平台

TIANYONG před 1 rokem
rodič
revize
780c1fa19e
2 změnil soubory, kde provedl 3 přidání a 3 odebrání
  1. 2 2
      src/utils/index.ts
  2. 1 1
      vite.config.ts

+ 2 - 2
src/utils/index.ts

@@ -131,11 +131,11 @@ export const matchProductApiUrl = () => {
 			'online': 'https://kt.colexiu.com'
 		}
 	}
-	let environment: 'dev' | 'test' | 'test2' | 'online' = location.origin.includes('//dev') ? 'dev' : location.origin.includes('//test') ? 'test' : location.origin.includes('//online') ? 'online' : 'dev'
+	let environment: 'dev' | 'test' | 'test2' | 'online' = location.origin.includes('//dev') ? 'dev' : location.origin.includes('//test') ? 'test' : (location.origin.includes('//online') || location.origin.includes('//mec')) ? 'online' : 'dev'
 	if (query.isCbs) {
 		return apiUrls.cbs[environment] + '/cbs-app'
 	} else {
-		const pathName = location.pathname.includes('index') ? 'gym' : location.pathname.includes('colexiu') ? 'colexiu' : location.pathname.includes('orchestra') ? 'orchestra' : 'instrument'
+		const pathName = location.pathname.includes('gym') ? 'gym' : location.pathname.includes('colexiu') ? 'colexiu' : location.pathname.includes('orchestra') ? 'orchestra' : 'instrument'
 		// 兼容课堂乐器,测试环境两个域名
 		if (pathName === 'instrument' && environment === 'test') {
 			environment = location.origin.includes('//test.kt') ? 'test' : 'test2'

+ 1 - 1
vite.config.ts

@@ -33,7 +33,7 @@ export default defineConfig({
 	build: {
 		rollupOptions: {
 			input: {
-				index: resolve(__dirname, "index.html"),
+				gym: resolve(__dirname, "index.html"),
 				colexiu: resolve(__dirname, "colexiu.html"),
 				orchestra: resolve(__dirname, "orchestra.html"),
 				"report-share": resolve(__dirname, "report-share.html"),