constant.ts 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  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. // 全局的localStorage的key
  105. export const lsKey = {
  106. lastBuildDate: 'lastBuildDate',
  107. token: 'token',
  108. };
  109. export const mediaTypeEnumMap = {
  110. [MediaTypeEnum.camera]: '摄像头',
  111. [MediaTypeEnum.microphone]: '麦克风',
  112. [MediaTypeEnum.screen]: '窗口',
  113. [MediaTypeEnum.img]: '图片',
  114. [MediaTypeEnum.txt]: '文字',
  115. [MediaTypeEnum.media]: '视频',
  116. [MediaTypeEnum.time]: '时间',
  117. [MediaTypeEnum.stopwatch]: '秒表',
  118. [MediaTypeEnum.pk]: '打pk',
  119. [MediaTypeEnum.metting]: '会议',
  120. };
  121. export const liveRoomTypeEnumMap = {
  122. [LiveRoomTypeEnum.msr]: 'msr推流',
  123. [LiveRoomTypeEnum.obs]: 'obs推流',
  124. [LiveRoomTypeEnum.pk]: '打pk',
  125. [LiveRoomTypeEnum.srs]: 'srs推流',
  126. [LiveRoomTypeEnum.system]: '系统推流',
  127. [LiveRoomTypeEnum.tencent_css]: '腾讯云css推流',
  128. [LiveRoomTypeEnum.tencent_css_pk]: '腾讯云css打pk',
  129. [LiveRoomTypeEnum.wertc_live]: 'webrtc直播',
  130. [LiveRoomTypeEnum.wertc_meeting_one]: 'webrtc会议一',
  131. [LiveRoomTypeEnum.wertc_meeting_two]: 'webrtc会议二',
  132. };
  133. export const sliderList = [
  134. {
  135. img: `${QINIU_RESOURCE.url}/billd-live/image/a4039f86e5352bcfccaddecc4b72a1df.webp`,
  136. txt: 'SRS',
  137. link: 'https://ossrs.net',
  138. },
  139. {
  140. img: `${QINIU_RESOURCE.url}/image/c3c342f6852706e0b70d011e8753d2d6.webp`,
  141. txt: 'FFmpeg',
  142. link: 'https://ffmpeg.org',
  143. },
  144. {
  145. img: `${QINIU_RESOURCE.url}/image/0214acde5f5f5e3caf278ce446cc4414.webp`,
  146. txt: 'WebRTC',
  147. link: 'https://github.com/webrtc',
  148. },
  149. {
  150. img: `${QINIU_RESOURCE.url}/billd-live/image/1277df4371045310acbc4bf2fc0811b8.webp`,
  151. txt: 'Vue3',
  152. link: 'https://vuejs.org',
  153. },
  154. {
  155. img: `${QINIU_RESOURCE.url}/image/dd907463af7fdec395e5f6d088b0308b.webp`,
  156. txt: 'Pinia',
  157. link: 'https://pinia.vuejs.org',
  158. },
  159. {
  160. img: `${QINIU_RESOURCE.url}/image/9d54ed9673f2ca4ffc78fc6348f2b736.png`,
  161. txt: 'TypeScript',
  162. link: 'https://www.typescriptlang.org',
  163. },
  164. {
  165. img: `${QINIU_RESOURCE.url}/image/a6473eed036e5d35ca2c9f7118c974cd.webp`,
  166. txt: 'Vite4',
  167. link: 'https://vitejs.dev',
  168. },
  169. {
  170. img: `${QINIU_RESOURCE.url}/image/627105f0e5674018cb03c8da036ae5d5.webp`,
  171. txt: 'Webpack5',
  172. link: 'https://webpack.js.org',
  173. },
  174. {
  175. img: `${QINIU_RESOURCE.url}/billd-live/image/5304af2ea6864369df3ba895d20e3d14.png`,
  176. txt: 'swc',
  177. link: 'https://swc.rs',
  178. },
  179. {
  180. img: `${QINIU_RESOURCE.url}/image/dd8ffe33c22723381a3664684eaca237.png`,
  181. txt: 'esbuild',
  182. link: 'https://esbuild.github.io',
  183. },
  184. {
  185. img: `${QINIU_RESOURCE.url}/image/f6b9f5cfade1d96634dddb0b89b056be.png`,
  186. txt: 'Pnpm',
  187. link: 'https://pnpm.io',
  188. },
  189. {
  190. img: `${QINIU_RESOURCE.url}/image/89fadfed21f1dd6389dfeb227b3d1ca6.webp`,
  191. txt: 'naive-ui',
  192. link: 'https://www.naiveui.com',
  193. },
  194. {
  195. img: `${QINIU_RESOURCE.url}/image/5ce36cab3d6b23974625900dc4cf39a3.webp`,
  196. txt: 'Node',
  197. link: 'https://nodejs.org',
  198. },
  199. {
  200. img: `${QINIU_RESOURCE.url}/image/0dcabc80c616240edc3111450fbf79aa.webp`,
  201. txt: 'socket.io',
  202. link: 'https://socket.io',
  203. },
  204. {
  205. img: `${QINIU_RESOURCE.url}/image/2009474c455813d487803e2acfcbb4af.webp`,
  206. txt: 'mysql',
  207. link: 'https://www.mysql.com/',
  208. },
  209. {
  210. img: `${QINIU_RESOURCE.url}/image/e66deaf779edb2a94e91f9b0f2995f6d.webp`,
  211. txt: 'redis',
  212. link: 'https://redis.io',
  213. },
  214. {
  215. img: `${QINIU_RESOURCE.url}/image/fd783552a400643c611c62e9200bb429.webp`,
  216. txt: 'Sequelize',
  217. link: 'https://sequelize.org',
  218. },
  219. {
  220. img: `${QINIU_RESOURCE.url}/image/dce3470845321ce654d09ce811837749.webp`,
  221. txt: '腾讯云云直播 CSS',
  222. link: 'https://cloud.tencent.com/product/css',
  223. },
  224. {
  225. img: `${QINIU_RESOURCE.url}/image/074835fbbaf976992e78bc6a585530e6.webp`,
  226. txt: '阿里云轻量服务器',
  227. link: 'https://www.aliyun.com',
  228. },
  229. {
  230. img: `${QINIU_RESOURCE.url}/image/9a934ebf993f5d3b4146f050f7071518.webp`,
  231. txt: '七牛云对象存储',
  232. link: 'https://www.qiniu.com',
  233. },
  234. {
  235. img: `${QINIU_RESOURCE.url}/image/e247f6fd39320051d236f3f844b9056f.webp`,
  236. txt: '支付宝当面付',
  237. link: 'https://opendocs.alipay.com/open/194',
  238. },
  239. {
  240. img: `${QINIU_RESOURCE.url}/image/d5eb237bd54bc4e729186115e89e5935.webp`,
  241. txt: 'Docker',
  242. link: 'https://www.docker.com',
  243. },
  244. {
  245. img: `${QINIU_RESOURCE.url}/image/92a6f3e295634ddd21b6b8034fa3b25f.webp`,
  246. txt: 'Jenkins',
  247. link: 'https://www.jenkins.io',
  248. },
  249. {
  250. img: `${QINIU_RESOURCE.url}/image/354823b72eb805264c940f5232d824fe.webp`,
  251. txt: 'PM2',
  252. link: 'https://github.com/Unitech/pm2',
  253. },
  254. {
  255. img: `${QINIU_RESOURCE.url}/image/d4417f70fa36edbc62b5aa3840cbf25f.webp`,
  256. txt: 'bilibili',
  257. link: 'https://www.bilibili.com',
  258. },
  259. ];