Browse Source

webpack

release_0.0.2
yuan_yi 3 years ago
parent
commit
f638047ae7
  1. 38
      code/VideoAccess-VCMP/api/app/lib/controllers/camera/create.js
  2. 7
      code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js
  3. 19
      code/VideoAccess-VCMP/api/app/lib/utils/rtmp2others.js
  4. 2
      code/VideoAccess-VCMP/web/config.js
  5. 148
      code/VideoAccess-VCMP/web/package.json

38
code/VideoAccess-VCMP/api/app/lib/controllers/camera/create.js

@ -0,0 +1,38 @@
'use strict';
async function createYingshi (ctx) {
try {
const { models } = ctx.fs.dc
const { userId, token } = ctx.fs.api
const { id, name, cloudControl, highDefinition, memoryCard,
voice, kindId, abilityId, rtmp, } = ctx.request.body
let storageData = {
type: 'yingshi', name, cloudControl, highDefinition, memoryCard,
voice, longitude, latitude, kindId, abilityId, rtmp,
}
if (id) {
storageData.createTime = moment().format()
storageData.createUserId = userId
await models.Camera.update(storageData, {
where: {
id,
}
})
} else {
await models.Camera.create(storageData)
}
ctx.status = 204;
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {}
}
}
module.exports = {
};

7
code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js

@ -149,11 +149,16 @@ async function detail (ctx) {
const otherUrls = await rtmp2others(cameraRes.rtmp)
const corUser = await ctx.app.fs.authRequest.get(`user/${cameraRes.createUserId}/message`, { query: { token } })
ctx.status = 200;
ctx.body = {
...cameraRes.dataValues,
station: bindStations,
videoUrl: otherUrls
videoUrl: otherUrls,
createUser: {
namePresent: corUser[0].namePresent
}
}
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);

19
code/VideoAccess-VCMP/api/app/lib/utils/rtmp2others.js

@ -4,11 +4,20 @@ async function rtmp2others (rtmp) {
return {
liveUrl: {
rtmp: 'xx',
hls: 'xx',
flv: 'xx',
ezopen: 'xx',
onvif: 'xx',
hd: {// 高清
rtmp: 'xx',
hls: 'xx',
flv: 'xx',
ezopen: 'xx',
onvif: 'xx',
},
sd: {// 标清
rtmp: 'xx',
hls: 'xx',
flv: 'xx',
ezopen: 'xx',
onvif: 'xx',
}
},
replayUrl: {
cloud: 'xx',

2
code/VideoAccess-VCMP/web/config.js

@ -12,7 +12,7 @@ dev && console.log('\x1B[33m%s\x1b[0m', '请遵循并及时更新 readme.md,
// // 启动参数
args.option(['p', 'port'], '启动端口');
args.option(['u', 'api-url'], 'webapi的URL');
args.option('apiAuthUrl', 'apiAuthUrl');
args.option('apiAuthUrl', 'IOT 鉴权 api');
const flags = args.parse(process.argv);

148
code/VideoAccess-VCMP/web/package.json

@ -1,76 +1,76 @@
{
"name": "fs-anxincloud-4.0",
"version": "1.0.0",
"description": "anxincloud-4.0",
"main": "server.js",
"scripts": {
"test": "mocha",
"start-vite": "cross-env NODE_ENV=developmentVite npm run start-params",
"start": "cross-env NODE_ENV=development npm run start-params",
"start-params": "node server -p 5000 -u http://10.8.30.82:4000 --apiAuthUrl http://10.8.30.82:4200",
"deploy": "export NODE_ENV=production&& npm run build && node server",
"build-dev": "export NODE_ENV=development&&webpack --config webpack.config.js",
"build": "export NODE_ENV=production&&webpack --config webpack.config.prod.js"
},
"keywords": [
"app"
],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.14.6",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-proposal-object-rest-spread": "^7.14.7",
"@babel/plugin-transform-runtime": "^7.14.5",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.14.7",
"@babel/preset-react": "^7.14.5",
"babel-loader": "^8.2.2",
"babel-plugin-import": "^1.13.3",
"connected-react-router": "^6.8.0",
"css-loader": "^3.5.0",
"express": "^4.17.1",
"file-loader": "^6.0.0",
"html-webpack-plugin": "^4.5.0",
"immutable": "^4.0.0-rc.12",
"less": "^3.12.2",
"less-loader": "^7.0.2",
"nprogress": "^0.2.0",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"react-redux": "^7.2.1",
"react-router-dom": "^5.2.0",
"react-router-redux": "^4.0.8",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"style-loader": "^2.0.0",
"vite": "^2.9.5",
"webpack": "^5.3.2",
"webpack-bundle-analyzer": "^4.1.0",
"webpack-cli": "^4.2.0",
"webpack-dev-middleware": "^4.0.2",
"webpack-dev-server": "^3.11.2",
"webpack-hot-middleware": "^2.25.0"
},
"dependencies": {
"@douyinfe/semi-ui": "^2.8.0",
"@fs/attachment": "^1.0.0",
"@peace/components": "0.0.35",
"@peace/utils": "^0.0.48",
"@vitejs/plugin-react": "^1.3.1",
"@vitejs/plugin-react-refresh": "^1.3.6",
"args": "^5.0.1",
"copy-to-clipboard": "^3.3.1",
"cross-env": "^7.0.3",
"fs-web-server-scaffold": "^1.0.6",
"koa-better-http-proxy": "^0.2.5",
"koa-proxy": "^1.0.0-alpha.3",
"koa-view": "^2.1.4",
"moment": "^2.29.3",
"npm": "^7.20.6",
"perfect-scrollbar": "^1.5.5",
"socket.io-client": "^4.5.0",
"socket.io-parser": "^4.2.0",
"superagent": "^6.1.0"
}
"name": "fs-anxincloud-4.0",
"version": "1.0.0",
"description": "anxincloud-4.0",
"main": "server.js",
"scripts": {
"test": "mocha",
"start-vite": "cross-env NODE_ENV=developmentVite npm run start-params",
"start": "cross-env NODE_ENV=development npm run start-params",
"start-params": "node server -p 5000 -u http://10.8.30.82:4000 --apiAuthUrl http://10.8.30.82:4200",
"deploy": "export NODE_ENV=production&& npm run build && node server",
"build-dev": "cross-env NODE_ENV=development&&webpack --config webpack.config.js",
"build": "export NODE_ENV=production&&webpack --config webpack.config.prod.js"
},
"keywords": [
"app"
],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.14.6",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/plugin-proposal-object-rest-spread": "^7.14.7",
"@babel/plugin-transform-runtime": "^7.14.5",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.14.7",
"@babel/preset-react": "^7.14.5",
"babel-loader": "^8.2.2",
"babel-plugin-import": "^1.13.3",
"connected-react-router": "^6.8.0",
"css-loader": "^3.5.0",
"express": "^4.17.1",
"file-loader": "^6.0.0",
"html-webpack-plugin": "^4.5.0",
"immutable": "^4.0.0-rc.12",
"less": "^3.12.2",
"less-loader": "^7.0.2",
"nprogress": "^0.2.0",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"react-redux": "^7.2.1",
"react-router-dom": "^5.2.0",
"react-router-redux": "^4.0.8",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"style-loader": "^2.0.0",
"vite": "^2.9.5"
},
"dependencies": {
"@douyinfe/semi-ui": "^2.8.0",
"@fs/attachment": "^1.0.0",
"@peace/components": "0.0.35",
"@peace/utils": "^0.0.48",
"@vitejs/plugin-react": "^1.3.1",
"@vitejs/plugin-react-refresh": "^1.3.6",
"args": "^5.0.1",
"copy-to-clipboard": "^3.3.1",
"cross-env": "^7.0.3",
"fs-web-server-scaffold": "^1.0.6",
"koa-better-http-proxy": "^0.2.5",
"koa-proxy": "^1.0.0-alpha.3",
"koa-view": "^2.1.4",
"moment": "^2.29.3",
"npm": "^7.20.6",
"perfect-scrollbar": "^1.5.5",
"socket.io-client": "^4.5.0",
"socket.io-parser": "^4.2.0",
"superagent": "^6.1.0",
"webpack": "^5.3.2",
"webpack-bundle-analyzer": "^4.1.0",
"webpack-cli": "^4.2.0",
"webpack-dev-middleware": "^4.0.2",
"webpack-dev-server": "^3.11.2",
"webpack-hot-middleware": "^2.25.0"
}
}
Loading…
Cancel
Save