constant.ts 7.9 KB

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