@plasosdk/client-sdk
Version:
Plaso教育平台的客户端SDK
29 lines (26 loc) • 995 B
text/typescript
import { Environment, getEnvironmentConfig } from './environment';
// 定义内容类型枚举
export enum PlasoContentType {
NHOMEWORK = 'nhomework',
LIVECLASS = 'liveclass',
MAIN = 'main',
RESOURCES = 'resources'
// 后期可以在这里添加更多类型
}
export const getUrlConfigMap = (mode: Environment, platform: string) => {
const config = getEnvironmentConfig(platform);
return {
[PlasoContentType.NHOMEWORK]: {
baseUrl: `${config[mode].baseUrl}?appType=${PlasoContentType.NHOMEWORK}&useInClientSDK=1`
},
[PlasoContentType.LIVECLASS]: {
baseUrl: `${config[mode].baseUrl}?appType=${PlasoContentType.LIVECLASS}&useInClientSDK=1`
},
[PlasoContentType.MAIN]: {
baseUrl: `${config[mode].baseUrl}?appType=${PlasoContentType.MAIN}&useInClientSDK=1`
},
[PlasoContentType.RESOURCES]: {
baseUrl: `${config[mode].baseUrl}?appType=${PlasoContentType.RESOURCES}&useInClientSDK=1`
}
}
}