shuisheng 1 jaar geleden
bovenliggende
commit
b52ff5dc9a

+ 1 - 0
.gitignore

@@ -3,3 +3,4 @@ dist
 components.d.ts
 .eslintcache
 .DS_Store
+deploy/index.js

+ 2 - 2
deploy/static-build.sh

@@ -6,7 +6,7 @@
 # Email: 2274751790@qq.com
 # FilePath: /billd-live/deploy/static-build.sh
 # Github: https://github.com/galaxy-s10
-# LastEditTime: 2024-01-25 10:39:21
+# LastEditTime: 2024-02-20 11:51:28
 # LastEditors: shuisheng
 ###
 
@@ -73,4 +73,4 @@ else
   echo 开始构建$ENV环境:
 fi
 
-npx cross-env VUE_APP_RELEASE_PROJECT_NAME=$JOBNAME VUE_APP_RELEASE_PROJECT_ENV=$ENV webpack --config ./script/config/webpack.common.ts --env production
+npx cross-env VUE_APP_RELEASE_PROJECT_NAME=$JOBNAME VUE_APP_RELEASE_PROJECT_ENV=$ENV npm run deploy:prod

+ 8 - 3
package.json

@@ -8,13 +8,16 @@
   "author": "shuisheng <2274751790@qq.com>",
   "scripts": {
     "build": "webpack --config ./script/config/webpack.common.ts --env production",
-    "cz": "cz",
+    "build:beta": "webpack --config ./script/config/webpack.common.ts --env production",
+    "build:prod": "webpack --config ./script/config/webpack.common.ts --env production",
     "copy": "ts-node ./deploy/handleGiteeJenkins.mjs",
+    "cz": "cz",
+    "deploy:beta": "node ./deploy/index.js --beta",
+    "deploy:prod": "node ./deploy/index.js --prod",
     "lint": "eslint --config ./.eslintrc.js . --ext .js,.jsx,.ts,.tsx,.vue --cache",
     "lint:fix": "eslint --config ./.eslintrc.js . --ext .js,.jsx,.ts,.tsx,.vue --cache --fix",
     "prepare": "husky install",
     "prettier": "prettier --write .",
-    "push": "cz && standard-version",
     "release": "standard-version",
     "start": "cross-env webpack serve --config ./script/config/webpack.common.ts --env development",
     "start:beta": "cross-env VUE_APP_RELEASE_PROJECT_ENV=beta VUE_APP_RELEASE_PROJECT_NAME=billd-live webpack serve --config ./script/config/webpack.common.ts --env development",
@@ -34,6 +37,7 @@
   "dependencies": {
     "@vicons/ionicons5": "^0.12.0",
     "axios": "^1.2.1",
+    "billd-deploy": "^1.0.21",
     "billd-html-webpack-plugin": "^1.0.5",
     "billd-scss": "^0.0.8",
     "billd-utils": "^0.0.22",
@@ -44,6 +48,7 @@
     "naive-ui": "^2.34.4",
     "pinia": "^2.0.33",
     "pinia-plugin-persistedstate": "^3.2.0",
+    "qiniu": "^7.11.0",
     "qrcode": "^1.5.3",
     "socket.io-client": "^4.7.2",
     "socket.io-msgpack-parser": "^3.0.2",
@@ -123,4 +128,4 @@
     "webpackbar": "^5.0.2",
     "windicss-webpack-plugin": "^1.7.7"
   }
-}
+}

File diff suppressed because it is too large
+ 472 - 23
pnpm-lock.yaml


+ 3 - 0
script/constant.ts

@@ -12,5 +12,8 @@ export const windicssEnable = false; // 是否开启windicss
 export const htmlWebpackPluginTitle = 'billd-live'; // htmlWebpackPlugin的标题
 
 export const outputStaticUrl = (isProduction: boolean) => {
+  if (isProduction) {
+    return 'https://resource.hsslive.cn/billd-live/client/';
+  }
   return '/';
 };

+ 43 - 43
src/constant.ts

@@ -1,41 +1,33 @@
 import { MediaTypeEnum } from '@/interface';
-import { domain } from '@/spec-config';
+import { prodDomain } from '@/spec-config';
 
 import { LiveRoomTypeEnum } from './types/ILiveRoom';
 
 export const QQ_CLIENT_ID = `101958191`;
 export const QQ_OAUTH_URL = `https://graph.qq.com/oauth2.0`;
-export const QQ_REDIRECT_URI = `https://live.${domain}/oauth/qq_login`;
+export const QQ_REDIRECT_URI = `https://live.${prodDomain}/oauth/qq_login`;
 
 export const WECHAT_GZH_APPID = `wxbd243c01ac5ad1b7`; // 公众号
 export const WECHAT_GZH_OAUTH_URL = `https://open.weixin.qq.com/connect/oauth2/authorize?`;
 
-export const WECHAT_REDIRECT_URI = `https://live.${domain}/oauth/wechat_login`;
+export const WECHAT_REDIRECT_URI = `https://live.${prodDomain}/oauth/wechat_login`;
 
-export const QRCODE_LOGIN_URI = `https://live.${domain}/qrcodeLogin`;
+export const QRCODE_LOGIN_URI = `https://live.${prodDomain}/qrcodeLogin`;
 
 export const AUTHOR_GITHUB = `https://github.com/galaxy-s10`;
 
 export const WEBSOCKET_URL =
   process.env.NODE_ENV === 'development'
     ? `ws://localhost:4300`
-    : `wss://srs-pull.${domain}`;
+    : `wss://srs-pull.${prodDomain}`;
 
 export const AXIOS_BASEURL =
   process.env.NODE_ENV === 'development'
     ? `/api`
-    : `https://live-api.${domain}`;
+    : `https://live-api.${prodDomain}`;
 
 export const COOKIE_DOMAIN =
-  process.env.NODE_ENV === 'development' ? undefined : `.${domain}`;
-
-export const COMMON_URL = {
-  apifox: `https://apifox.com/apidoc/shared-c7556b54-17b2-494e-a039-572d83f103ed/`,
-  admin: `https://live-admin.${domain}`,
-  mobileApk: `https://resource.${domain}/billd-live/image/app-release.apk`,
-  bilibiliCollectiondetail: `https://space.bilibili.com/381307133/channel/collectiondetail?sid=1458070&ctype=0`,
-  payCoursesArticle: `https://www.${domain}/article/151`,
-};
+  process.env.NODE_ENV === 'development' ? undefined : `.${prodDomain}`;
 
 export const THEME_COLOR = '#ffd700';
 
@@ -47,9 +39,9 @@ export const SRS_CB_URL_PARAMS = {
   randomId: 'randomid',
 };
 
-export const QINIU_LIVE = {
-  domain: `resource.${domain}`,
-  url: `https://resource.${domain}/`,
+export const QINIU_RESOURCE = {
+  domain: `resource.${prodDomain}`,
+  url: `https://resource.${prodDomain}`,
   bucket: 'hssblog',
   prefix: {
     'billd-live/image/': 'billd-live/image/',
@@ -57,6 +49,14 @@ export const QINIU_LIVE = {
   },
 };
 
+export const COMMON_URL = {
+  apifox: `https://apifox.com/apidoc/shared-c7556b54-17b2-494e-a039-572d83f103ed/`,
+  admin: `https://live-admin.${prodDomain}`,
+  mobileApk: `${QINIU_RESOURCE.url}/billd-live/image/app-release.apk`,
+  bilibiliCollectiondetail: `https://space.bilibili.com/381307133/channel/collectiondetail?sid=1458070&ctype=0`,
+  payCoursesArticle: `https://www.${prodDomain}/article/151`,
+};
+
 export const DEFAULT_AUTH_INFO = {
   ALL_AUTH: {
     id: 1,
@@ -206,127 +206,127 @@ export const liveRoomTypeEnumMap = {
 
 export const sliderList = [
   {
-    img: `https://resource.${domain}/billd-live/image/a4039f86e5352bcfccaddecc4b72a1df.webp`,
+    img: `${QINIU_RESOURCE.url}/billd-live/image/a4039f86e5352bcfccaddecc4b72a1df.webp`,
     txt: 'SRS',
     link: 'https://ossrs.net',
   },
   {
-    img: `https://resource.${domain}/image/c3c342f6852706e0b70d011e8753d2d6.webp`,
+    img: `${QINIU_RESOURCE.url}/image/c3c342f6852706e0b70d011e8753d2d6.webp`,
     txt: 'FFmpeg',
     link: 'https://ffmpeg.org',
   },
   {
-    img: `https://resource.${domain}/image/0214acde5f5f5e3caf278ce446cc4414.webp`,
+    img: `${QINIU_RESOURCE.url}/image/0214acde5f5f5e3caf278ce446cc4414.webp`,
     txt: 'WebRTC',
     link: 'https://github.com/webrtc',
   },
   {
-    img: `https://resource.${domain}/billd-live/image/1277df4371045310acbc4bf2fc0811b8.webp`,
+    img: `${QINIU_RESOURCE.url}/billd-live/image/1277df4371045310acbc4bf2fc0811b8.webp`,
     txt: 'Vue3',
     link: 'https://vuejs.org',
   },
   {
-    img: `https://resource.${domain}/image/dd907463af7fdec395e5f6d088b0308b.webp`,
+    img: `${QINIU_RESOURCE.url}/image/dd907463af7fdec395e5f6d088b0308b.webp`,
     txt: 'Pinia',
     link: 'https://pinia.vuejs.org',
   },
   {
-    img: `https://resource.${domain}/image/9d54ed9673f2ca4ffc78fc6348f2b736.png`,
+    img: `${QINIU_RESOURCE.url}/image/9d54ed9673f2ca4ffc78fc6348f2b736.png`,
     txt: 'TypeScript',
     link: 'https://www.typescriptlang.org',
   },
   {
-    img: `https://resource.${domain}/image/a6473eed036e5d35ca2c9f7118c974cd.webp`,
+    img: `${QINIU_RESOURCE.url}/image/a6473eed036e5d35ca2c9f7118c974cd.webp`,
     txt: 'Vite4',
     link: 'https://vitejs.dev',
   },
   {
-    img: `https://resource.${domain}/image/627105f0e5674018cb03c8da036ae5d5.webp`,
+    img: `${QINIU_RESOURCE.url}/image/627105f0e5674018cb03c8da036ae5d5.webp`,
     txt: 'Webpack5',
     link: 'https://webpack.js.org',
   },
   {
-    img: `https://resource.${domain}/billd-live/image/5304af2ea6864369df3ba895d20e3d14.png`,
+    img: `${QINIU_RESOURCE.url}/billd-live/image/5304af2ea6864369df3ba895d20e3d14.png`,
     txt: 'swc',
     link: 'https://swc.rs',
   },
   {
-    img: `https://resource.${domain}/image/dd8ffe33c22723381a3664684eaca237.png`,
+    img: `${QINIU_RESOURCE.url}/image/dd8ffe33c22723381a3664684eaca237.png`,
     txt: 'esbuild',
     link: 'https://esbuild.github.io',
   },
   {
-    img: `https://resource.${domain}/image/f6b9f5cfade1d96634dddb0b89b056be.png`,
+    img: `${QINIU_RESOURCE.url}/image/f6b9f5cfade1d96634dddb0b89b056be.png`,
     txt: 'Pnpm',
     link: 'https://pnpm.io',
   },
   {
-    img: `https://resource.${domain}/image/89fadfed21f1dd6389dfeb227b3d1ca6.webp`,
+    img: `${QINIU_RESOURCE.url}/image/89fadfed21f1dd6389dfeb227b3d1ca6.webp`,
     txt: 'naive-ui',
     link: 'https://www.naiveui.com',
   },
   {
-    img: `https://resource.${domain}/image/5ce36cab3d6b23974625900dc4cf39a3.webp`,
+    img: `${QINIU_RESOURCE.url}/image/5ce36cab3d6b23974625900dc4cf39a3.webp`,
     txt: 'Node',
     link: 'https://nodejs.org',
   },
   {
-    img: `https://resource.${domain}/image/0dcabc80c616240edc3111450fbf79aa.webp`,
+    img: `${QINIU_RESOURCE.url}/image/0dcabc80c616240edc3111450fbf79aa.webp`,
     txt: 'socket.io',
     link: 'https://socket.io',
   },
   {
-    img: `https://resource.${domain}/image/2009474c455813d487803e2acfcbb4af.webp`,
+    img: `${QINIU_RESOURCE.url}/image/2009474c455813d487803e2acfcbb4af.webp`,
     txt: 'mysql',
     link: 'https://www.mysql.com/',
   },
   {
-    img: `https://resource.${domain}/image/e66deaf779edb2a94e91f9b0f2995f6d.webp`,
+    img: `${QINIU_RESOURCE.url}/image/e66deaf779edb2a94e91f9b0f2995f6d.webp`,
     txt: 'redis',
     link: 'https://redis.io',
   },
   {
-    img: `https://resource.${domain}/image/fd783552a400643c611c62e9200bb429.webp`,
+    img: `${QINIU_RESOURCE.url}/image/fd783552a400643c611c62e9200bb429.webp`,
     txt: 'Sequelize',
     link: 'https://sequelize.org',
   },
   {
-    img: `https://resource.${domain}/image/dce3470845321ce654d09ce811837749.webp`,
+    img: `${QINIU_RESOURCE.url}/image/dce3470845321ce654d09ce811837749.webp`,
     txt: '腾讯云云直播 CSS',
     link: 'https://cloud.tencent.com/product/css',
   },
   {
-    img: `https://resource.${domain}/image/074835fbbaf976992e78bc6a585530e6.webp`,
+    img: `${QINIU_RESOURCE.url}/image/074835fbbaf976992e78bc6a585530e6.webp`,
     txt: '阿里云轻量服务器',
     link: 'https://www.aliyun.com',
   },
   {
-    img: `https://resource.${domain}/image/9a934ebf993f5d3b4146f050f7071518.webp`,
+    img: `${QINIU_RESOURCE.url}/image/9a934ebf993f5d3b4146f050f7071518.webp`,
     txt: '七牛云对象存储',
     link: 'https://www.qiniu.com',
   },
   {
-    img: `https://resource.${domain}/image/e247f6fd39320051d236f3f844b9056f.webp`,
+    img: `${QINIU_RESOURCE.url}/image/e247f6fd39320051d236f3f844b9056f.webp`,
     txt: '支付宝当面付',
     link: 'https://opendocs.alipay.com/open/194',
   },
   {
-    img: `https://resource.${domain}/image/d5eb237bd54bc4e729186115e89e5935.webp`,
+    img: `${QINIU_RESOURCE.url}/image/d5eb237bd54bc4e729186115e89e5935.webp`,
     txt: 'Docker',
     link: 'https://www.docker.com',
   },
   {
-    img: `https://resource.${domain}/image/92a6f3e295634ddd21b6b8034fa3b25f.webp`,
+    img: `${QINIU_RESOURCE.url}/image/92a6f3e295634ddd21b6b8034fa3b25f.webp`,
     txt: 'Jenkins',
     link: 'https://www.jenkins.io',
   },
   {
-    img: `https://resource.${domain}/image/354823b72eb805264c940f5232d824fe.webp`,
+    img: `${QINIU_RESOURCE.url}/image/354823b72eb805264c940f5232d824fe.webp`,
     txt: 'PM2',
     link: 'https://github.com/Unitech/pm2',
   },
   {
-    img: `https://resource.${domain}/image/d4417f70fa36edbc62b5aa3840cbf25f.webp`,
+    img: `${QINIU_RESOURCE.url}/image/d4417f70fa36edbc62b5aa3840cbf25f.webp`,
     txt: 'bilibili',
     link: 'https://www.bilibili.com',
   },

+ 2 - 2
src/network/webRTC.ts

@@ -1,7 +1,7 @@
 import { getRandomString } from 'billd-utils';
 
 import { LiveLineEnum, MediaTypeEnum } from '@/interface';
-import { domain } from '@/spec-config';
+import { prodDomain } from '@/spec-config';
 import { AppRootState, useAppStore } from '@/store/app';
 import { useNetworkStore } from '@/store/network';
 import { WsCandidateType, WsMsgTypeEnum } from '@/types/websocket';
@@ -559,7 +559,7 @@ export class WebRTCClass {
             //   urls: 'stun:stun.l.google.com:19302',
             // },
             {
-              urls: `turn:live.${domain}:3478`,
+              urls: `turn:live.${prodDomain}:3478`,
               username: 'hss',
               credential: '123456',
             },

+ 1 - 1
src/spec-config.ts

@@ -1 +1 @@
-export const domain = 'hsslive.cn';
+export const prodDomain = 'hsslive.cn';

+ 2 - 0
src/utils/showBilldVersion.ts

@@ -1,3 +1,4 @@
+import BilldDeploy from 'billd-deploy/package.json';
 import BilldHtmlWebpackPlugin from 'billd-html-webpack-plugin/package.json';
 import BilldScss from 'billd-scss/package.json';
 import BilldUtils from 'billd-utils/package.json';
@@ -5,5 +6,6 @@ import BilldUtils from 'billd-utils/package.json';
 console.table({
   'billd-utils': BilldUtils.version,
   'billd-scss': BilldScss.version,
+  'billd-deploy': BilldDeploy.version,
   'billd-html-webpack-plugin': BilldHtmlWebpackPlugin.version,
 });

+ 4 - 4
src/views/h5/index.vue

@@ -79,9 +79,9 @@ import { onMounted, onUnmounted, ref } from 'vue';
 import { useI18n } from 'vue-i18n';
 
 import { fetchAreaLiveRoomList } from '@/api/area';
+import { QINIU_RESOURCE } from '@/constant';
 import { IArea, IAreaLiveRoom } from '@/interface';
 import router, { mobileRouterName, routerName } from '@/router';
-import { domain } from '@/spec-config';
 import { useAppStore } from '@/store/app';
 import {
   LiveRoomIsShowEnum,
@@ -97,19 +97,19 @@ const swiperList = ref([
   {
     id: 1,
     txt: '广告位1',
-    bgi: `https://resource.${domain}/billd-live/image/ecdece08eb3eda2f37433cb7c748766f.webp`,
+    bgi: `${QINIU_RESOURCE.url}/billd-live/image/ecdece08eb3eda2f37433cb7c748766f.webp`,
     url: '',
   },
   {
     id: 2,
     txt: '广告位2',
-    bgi: `https://resource.${domain}/billd-live/image/b2e3459e7d4a70463cd201ee468491a1.webp`,
+    bgi: `${QINIU_RESOURCE.url}/billd-live/image/b2e3459e7d4a70463cd201ee468491a1.webp`,
     url: '',
   },
   {
     id: 3,
     txt: '广告位3',
-    bgi: `https://resource.${domain}/billd-live/image/71d01ff0bd34c57586500e425e21938f.webp`,
+    bgi: `${QINIU_RESOURCE.url}/billd-live/image/71d01ff0bd34c57586500e425e21938f.webp`,
     url: '',
   },
 ]);

+ 2 - 2
src/views/pull/index.vue

@@ -418,7 +418,7 @@ import { fetchGoodsList } from '@/api/goods';
 import { fetchGetWsMessageList } from '@/api/wsMessage';
 import {
   MODULE_CONFIG_SWITCH,
-  QINIU_LIVE,
+  QINIU_RESOURCE,
   liveRoomTypeEnumMap,
 } from '@/constant';
 import { emojiArray } from '@/emoji';
@@ -785,7 +785,7 @@ async function uploadChange() {
       msgLoading.value = true;
       msgIsFile.value = WsMessageMsgIsFileEnum.yes;
       const res = await useUpload({
-        prefix: QINIU_LIVE.prefix['billd-live/msg-image/'],
+        prefix: QINIU_RESOURCE.prefix['billd-live/msg-image/'],
         file: fileList[0],
       });
       if (res?.resultUrl) {

+ 6 - 2
src/views/push/index.vue

@@ -393,7 +393,11 @@ import {
 } from 'vue';
 import { useRoute } from 'vue-router';
 
-import { QINIU_LIVE, liveRoomTypeEnumMap, mediaTypeEnumMap } from '@/constant';
+import {
+  QINIU_RESOURCE,
+  liveRoomTypeEnumMap,
+  mediaTypeEnumMap,
+} from '@/constant';
 import { emojiArray } from '@/emoji';
 import { commentAuthTip, loginTip } from '@/hooks/use-login';
 import { usePush } from '@/hooks/use-push';
@@ -640,7 +644,7 @@ async function uploadChange() {
       msgLoading.value = true;
       msgIsFile.value = WsMessageMsgIsFileEnum.yes;
       const res = await useUpload({
-        prefix: QINIU_LIVE.prefix['billd-live/msg-image/'],
+        prefix: QINIU_RESOURCE.prefix['billd-live/msg-image/'],
         file: fileList[0],
       });
       if (res?.resultUrl) {

+ 2 - 2
src/views/team/index.vue

@@ -121,7 +121,7 @@ import {
 import { openToTarget } from 'billd-utils';
 import { ref } from 'vue';
 
-import { domain } from '@/spec-config';
+import { prodDomain } from '@/spec-config';
 
 const list = ref([
   {
@@ -145,7 +145,7 @@ const list = ref([
       },
     ],
     social: [{ github: 'https://www.github.com/galaxy-s10' }],
-    website: `https://www.${domain}`,
+    website: `https://www.${prodDomain}`,
   },
 ]);
 </script>

Some files were not shown because too many files changed in this diff