constant.ts 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. import { MediaTypeEnum } from '@/interface';
  2. import { prodDomain } from '@/spec-config';
  3. import { LiveRoomTypeEnum } from './types/ILiveRoom';
  4. export const QQ_CLIENT_ID = `101958191`;
  5. export const QQ_OAUTH_URL = `https://graph.qq.com/oauth2.0`;
  6. export const QQ_REDIRECT_URI = `https://live.${prodDomain}/oauth/qq_login`;
  7. export const WECHAT_GZH_APPID = `wxbd243c01ac5ad1b7`; // 公众号
  8. export const WECHAT_GZH_OAUTH_URL = `https://open.weixin.qq.com/connect/oauth2/authorize?`;
  9. export const WECHAT_REDIRECT_URI = `https://live.${prodDomain}/oauth/wechat_login`;
  10. export const QRCODE_LOGIN_URI = `https://live.${prodDomain}/qrcodeLogin`;
  11. export const AUTHOR_GITHUB = `https://github.com/galaxy-s10`;
  12. export const appBuildInfo =
  13. // @ts-ignore
  14. process.env.BilldHtmlWebpackPlugin as BilldHtmlWebpackPluginLog;
  15. export const WEBSOCKET_URL =
  16. process.env.NODE_ENV === 'development'
  17. ? `ws://localhost:4300`
  18. : `wss://srs-pull.${prodDomain}`;
  19. export const AXIOS_BASEURL =
  20. process.env.NODE_ENV === 'development'
  21. ? `/api`
  22. : `https://live-api.${prodDomain}`;
  23. export const COOKIE_DOMAIN =
  24. process.env.NODE_ENV === 'development' ? undefined : `.${prodDomain}`;
  25. export const THEME_COLOR = '#ffd700';
  26. export const SRS_CB_URL_PARAMS = {
  27. publishKey: 'pushkey',
  28. publishType: 'pushtype',
  29. userToken: 'usertoken',
  30. userId: 'userid',
  31. randomId: 'randomid',
  32. };
  33. export const QINIU_RESOURCE = {
  34. domain: `resource.${prodDomain}`,
  35. url: `https://resource.${prodDomain}`,
  36. bucket: 'hssblog',
  37. prefix: {
  38. 'billd-live/image/': 'billd-live/image/',
  39. 'billd-live/msg-image/': 'billd-live/msg-image/',
  40. },
  41. };
  42. export const COMMON_URL = {
  43. apifox: `https://apifox.com/apidoc/shared-c7556b54-17b2-494e-a039-572d83f103ed/`,
  44. admin: `https://live-admin.${prodDomain}`,
  45. mobileApk: `${QINIU_RESOURCE.url}/billd-live/image/app-release.apk`,
  46. bilibiliCollectiondetail: `https://space.bilibili.com/381307133/channel/collectiondetail?sid=1458070&ctype=0`,
  47. payCoursesArticle: `https://www.${prodDomain}/article/151`,
  48. };
  49. export const DEFAULT_AUTH_INFO = {
  50. ALL_AUTH: {
  51. id: 1,
  52. auth_value: 'ALL_AUTH',
  53. },
  54. USER_MANAGE: {
  55. id: 2,
  56. auth_value: 'USER_MANAGE',
  57. },
  58. ROLE_MANAGE: {
  59. id: 3,
  60. auth_value: 'ROLE_MANAGE',
  61. },
  62. AUTH_MANAGE: {
  63. id: 4,
  64. auth_value: 'AUTH_MANAGE',
  65. },
  66. MESSAGE_MANAGE: {
  67. id: 5,
  68. auth_value: 'MESSAGE_MANAGE',
  69. },
  70. MESSAGE_SEND: {
  71. id: 6,
  72. auth_value: 'MESSAGE_SEND',
  73. },
  74. MESSAGE_DISABLE: {
  75. id: 7,
  76. auth_value: 'MESSAGE_DISABLE',
  77. },
  78. LOG_MANAGE: {
  79. id: 8,
  80. auth_value: 'LOG_MANAGE',
  81. },
  82. LIVE_MANAGE: {
  83. id: 9,
  84. auth_value: 'LIVE_MANAGE',
  85. },
  86. LIVE_PUSH: {
  87. id: 10,
  88. auth_value: 'LIVE_PUSH',
  89. },
  90. LIVE_PULL: {
  91. id: 11,
  92. auth_value: 'LIVE_PULL',
  93. },
  94. LIVE_PULL_SVIP: {
  95. id: 12,
  96. auth_value: 'LIVE_PULL_SVIP',
  97. },
  98. };
  99. // 全局的cookie的key
  100. export const COOKIE_KEY = {
  101. thirdLoginInfo: 'thirdLoginInfo',
  102. };
  103. export const lsKeyPrefix = 'billd_live___';
  104. export const MODULE_CONFIG_SWITCH = {
  105. logo: true,
  106. home: true,
  107. area: true,
  108. shop: true,
  109. pullGiftList: true,
  110. pullShowAuth: false,
  111. // 后台入口
  112. admin: true,
  113. // app下载入口
  114. appdownload: true,
  115. // 文档
  116. doc: true,
  117. // 生态系统
  118. ecosystem: true,
  119. // 关于
  120. about: true,
  121. // 赞助
  122. sponsors: true,
  123. // 私有化部署
  124. privatizationDeployment: true,
  125. // github
  126. github: true,
  127. // 轮播
  128. slider: true,
  129. // 底部版权提示
  130. copyrightNotice: true,
  131. // 侧边栏
  132. sidebar: true,
  133. // 侧边栏排行榜
  134. sidebarRank: true,
  135. // 侧边栏商店
  136. sidebarShop: true,
  137. // 侧边栏订单
  138. sidebarOrder: true,
  139. // 支付
  140. pay: true,
  141. // 第三方登录
  142. thirdLogin: true,
  143. // qq登录
  144. qqLogin: true,
  145. // 微信扫码登录
  146. wechatQrcodeLogin: false,
  147. // 微信登录
  148. wechatLogin: false,
  149. // github登录
  150. githubLogin: true,
  151. // 我要开播按钮
  152. startLive: true,
  153. // srs开播
  154. startLiveSRS: true,
  155. // webrtc开播
  156. startLiveWebRTC: true,
  157. // msr开播
  158. startLiveWebMSR: true,
  159. };
  160. // 全局的localStorage的key
  161. export const lsKey = {
  162. lastBuildDate: 'lastBuildDate',
  163. token: 'token',
  164. };
  165. export const mediaTypeEnumMap = {
  166. [MediaTypeEnum.camera]: '摄像头',
  167. [MediaTypeEnum.microphone]: '麦克风',
  168. [MediaTypeEnum.screen]: '窗口',
  169. [MediaTypeEnum.img]: '图片',
  170. [MediaTypeEnum.txt]: '文字',
  171. [MediaTypeEnum.media]: '视频',
  172. [MediaTypeEnum.time]: '时间',
  173. [MediaTypeEnum.stopwatch]: '秒表',
  174. [MediaTypeEnum.pk]: '打pk',
  175. [MediaTypeEnum.metting]: '会议',
  176. };
  177. export const liveRoomTypeEnumMap = {
  178. [LiveRoomTypeEnum.msr]: 'msr推流',
  179. [LiveRoomTypeEnum.obs]: 'obs推流',
  180. [LiveRoomTypeEnum.pk]: '打pk',
  181. [LiveRoomTypeEnum.srs]: 'srs推流',
  182. [LiveRoomTypeEnum.system]: '系统推流',
  183. [LiveRoomTypeEnum.tencent_css]: '腾讯云css推流',
  184. [LiveRoomTypeEnum.tencent_css_pk]: '腾讯云css打pk',
  185. [LiveRoomTypeEnum.wertc_live]: 'webrtc直播',
  186. [LiveRoomTypeEnum.wertc_meeting_one]: 'webrtc会议一',
  187. [LiveRoomTypeEnum.wertc_meeting_two]: 'webrtc会议二',
  188. };
  189. export const sliderList = [
  190. {
  191. img: `${QINIU_RESOURCE.url}/billd-live/image/a4039f86e5352bcfccaddecc4b72a1df.webp`,
  192. txt: 'SRS',
  193. link: 'https://ossrs.net',
  194. },
  195. {
  196. img: `${QINIU_RESOURCE.url}/image/c3c342f6852706e0b70d011e8753d2d6.webp`,
  197. txt: 'FFmpeg',
  198. link: 'https://ffmpeg.org',
  199. },
  200. {
  201. img: `${QINIU_RESOURCE.url}/image/0214acde5f5f5e3caf278ce446cc4414.webp`,
  202. txt: 'WebRTC',
  203. link: 'https://github.com/webrtc',
  204. },
  205. {
  206. img: `${QINIU_RESOURCE.url}/billd-live/image/1277df4371045310acbc4bf2fc0811b8.webp`,
  207. txt: 'Vue3',
  208. link: 'https://vuejs.org',
  209. },
  210. {
  211. img: `${QINIU_RESOURCE.url}/image/dd907463af7fdec395e5f6d088b0308b.webp`,
  212. txt: 'Pinia',
  213. link: 'https://pinia.vuejs.org',
  214. },
  215. {
  216. img: `${QINIU_RESOURCE.url}/image/9d54ed9673f2ca4ffc78fc6348f2b736.png`,
  217. txt: 'TypeScript',
  218. link: 'https://www.typescriptlang.org',
  219. },
  220. {
  221. img: `${QINIU_RESOURCE.url}/image/a6473eed036e5d35ca2c9f7118c974cd.webp`,
  222. txt: 'Vite4',
  223. link: 'https://vitejs.dev',
  224. },
  225. {
  226. img: `${QINIU_RESOURCE.url}/image/627105f0e5674018cb03c8da036ae5d5.webp`,
  227. txt: 'Webpack5',
  228. link: 'https://webpack.js.org',
  229. },
  230. {
  231. img: `${QINIU_RESOURCE.url}/billd-live/image/5304af2ea6864369df3ba895d20e3d14.png`,
  232. txt: 'swc',
  233. link: 'https://swc.rs',
  234. },
  235. {
  236. img: `${QINIU_RESOURCE.url}/image/dd8ffe33c22723381a3664684eaca237.png`,
  237. txt: 'esbuild',
  238. link: 'https://esbuild.github.io',
  239. },
  240. {
  241. img: `${QINIU_RESOURCE.url}/image/f6b9f5cfade1d96634dddb0b89b056be.png`,
  242. txt: 'Pnpm',
  243. link: 'https://pnpm.io',
  244. },
  245. {
  246. img: `${QINIU_RESOURCE.url}/image/89fadfed21f1dd6389dfeb227b3d1ca6.webp`,
  247. txt: 'naive-ui',
  248. link: 'https://www.naiveui.com',
  249. },
  250. {
  251. img: `${QINIU_RESOURCE.url}/image/5ce36cab3d6b23974625900dc4cf39a3.webp`,
  252. txt: 'Node',
  253. link: 'https://nodejs.org',
  254. },
  255. {
  256. img: `${QINIU_RESOURCE.url}/image/0dcabc80c616240edc3111450fbf79aa.webp`,
  257. txt: 'socket.io',
  258. link: 'https://socket.io',
  259. },
  260. {
  261. img: `${QINIU_RESOURCE.url}/image/2009474c455813d487803e2acfcbb4af.webp`,
  262. txt: 'mysql',
  263. link: 'https://www.mysql.com/',
  264. },
  265. {
  266. img: `${QINIU_RESOURCE.url}/image/e66deaf779edb2a94e91f9b0f2995f6d.webp`,
  267. txt: 'redis',
  268. link: 'https://redis.io',
  269. },
  270. {
  271. img: `${QINIU_RESOURCE.url}/image/fd783552a400643c611c62e9200bb429.webp`,
  272. txt: 'Sequelize',
  273. link: 'https://sequelize.org',
  274. },
  275. {
  276. img: `${QINIU_RESOURCE.url}/image/dce3470845321ce654d09ce811837749.webp`,
  277. txt: '腾讯云云直播 CSS',
  278. link: 'https://cloud.tencent.com/product/css',
  279. },
  280. {
  281. img: `${QINIU_RESOURCE.url}/image/074835fbbaf976992e78bc6a585530e6.webp`,
  282. txt: '阿里云轻量服务器',
  283. link: 'https://www.aliyun.com',
  284. },
  285. {
  286. img: `${QINIU_RESOURCE.url}/image/9a934ebf993f5d3b4146f050f7071518.webp`,
  287. txt: '七牛云对象存储',
  288. link: 'https://www.qiniu.com',
  289. },
  290. {
  291. img: `${QINIU_RESOURCE.url}/image/e247f6fd39320051d236f3f844b9056f.webp`,
  292. txt: '支付宝当面付',
  293. link: 'https://opendocs.alipay.com/open/194',
  294. },
  295. {
  296. img: `${QINIU_RESOURCE.url}/image/d5eb237bd54bc4e729186115e89e5935.webp`,
  297. txt: 'Docker',
  298. link: 'https://www.docker.com',
  299. },
  300. {
  301. img: `${QINIU_RESOURCE.url}/image/92a6f3e295634ddd21b6b8034fa3b25f.webp`,
  302. txt: 'Jenkins',
  303. link: 'https://www.jenkins.io',
  304. },
  305. {
  306. img: `${QINIU_RESOURCE.url}/image/354823b72eb805264c940f5232d824fe.webp`,
  307. txt: 'PM2',
  308. link: 'https://github.com/Unitech/pm2',
  309. },
  310. {
  311. img: `${QINIU_RESOURCE.url}/image/d4417f70fa36edbc62b5aa3840cbf25f.webp`,
  312. txt: 'bilibili',
  313. link: 'https://www.bilibili.com',
  314. },
  315. ];