Commit cc117438 by 潘建波

【NEW】首次提交

0 parents
node_modules
/dist
\ No newline at end of file
No preview for this file type
<!--
* @Author: your name
* @Date: 2021-12-24 14:07:46
* @LastEditTime: 2021-12-24 14:28:25
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /sdc-face/API20211215/api.md
-->
## SDC相机接口存在的问题
### 1.
\ No newline at end of file
/*
* @Author: your name
* @Date: 2021-12-24 14:16:06
* @LastEditTime: 2021-12-24 14:21:47
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /sdc-face/API20211215/vue.config.js
*/
module.exports = {
outputDir:process.env.outputDir || 'dist',
// 由于浏览器有跨域限制,这里cli 工具提供了 启动本地代理服务器 请求
devServer:{
open:false, // 是否打开浏览器;
hotOnly:true, // 是否热更新;
proxy:{
'/SDCAPI':{ // 路径中有 /api 的请求都会走这个代理 , 可以自己定义一个,下面移除即可
target:'http://huayan.320.io/', // 目标代理接口地址,实际跨域要访问的接口,这个地址会替换掉 axios.defaults.baseURL
secure:false,
changeOrigin:true, // 开启代理,在本地创建一个虚拟服务端
ws:true, // 是否启用 websockets;
pathRewrite:{ // 去掉 路径中的 /api 的这一截
'^/api':''
}
},
'/test':{
target:'http://v.juhe.cn/joke', // 目标代理接口地址,实际跨域要访问的接口,这个地址会替换掉 axios.defaults.baseURL
secure:false,
changeOrigin:true,
ws:true,
pathRewrite:{
'^/test':'',
}
}
},
}
}
\ No newline at end of file
1.获取基础数据配置
方法:GET
路由:/SDCAPI/V1.0/VionSoftware/do/getBaseParm
返回参数:
{
"chn":2, // 当前使用通道号
"frame":10, // 当前使用帧率
"resolutionW":3160, // 当前分辨率宽高
"resolutionH":2840,
"canUseChn":[1,2] //当前可用的通道号列表
}
2.设置基础数据配置
方法:POST
路由:/SDCAPI/V1.0/VionSoftware/do/setBaseParam
请求参数:
{
"chn":2, // 通道号
"frame":10, // 帧率
"resolutionW":3160, // 分辨率宽高
"resolutionH":2840
}
响应:
{
"ecode": "200",
"enote": "OK"
}
1.获取服务配置接口
GET :http://192.168.1.117:8081/SDCAPI/V1.0/VionSoftware/do/webclient/deviceBasicInfo
返回:
{
"data": {
"business": {
"model": {
"file": "face_back_body_40_1_3000.trt",
"id": 1
},
"result": {
"face": {
"save": 1,
"sendbodyfeature": 1,
"sendbodynum": 1,
"sendface": 1,
"sendfacefeature": 1
},
"inout": {
"save": 0,
"sendinterval": 600
}
},
"runtype": 6,
"status": 1
},
"commonconfig": {
"httpUploadAddr": "",
"keepaliveinterval": 0,
"keepaliveswitch": 0,
"uploadjpginterval": 0,
"uploadjpgnum": 0,
"uploadjpgswitch": 0,
"workEndTime": 0,
"workStartTime": 0
},
"licence": {
"cpuid": "",
"lastdate": "2000-01-01",
"max_resouce_num": 1
}
},
"describe": "doGetBasicInfo",
"success": 1
}
2.获取存储配置
GET: http://192.168.66.2:8080/SDCAPI/V1.0/VionSoftware/do/webclient/getBusiness
返回:
{
"success":1,
"describe":"业务查询成功",
"business":
{
"runtype": 1, //类型1-7 目前只支持三种 1.进出客流 4.区域 6.人脸
"status": 0, //0:关闭 1:开启
"model":
{
"id": "1", //序号
"file": "model_vertical_small.cm3" //model文件名称
},
"result":
{
"inout": // 进出客流&区域客流
{
"sendinterval": 60, //发送结果的时间间隔,取值范围{1,6,60,120,600},单位是秒
"save": 0, //是否保存数据,0:不保存 1:保存
},
"face": //人脸客流
{
"sendface": 1, //0:不输出人脸图片 1:输出人脸图片
"sendbodynum": 1, //0:部输出人体图片 1:输出一张人体图片
"save": 0, //是否保存数据,0:不保存 1:保存
}
}
}
}
3.设置存储配置
POST :http://192.168.1.117:8081/SDCAPI/V1.0/VionSoftware/do/webclient/modBusiness
请求参数:
{
"channelid": 1
"business":
{
"runtype": 1, //类型1-7 目前只支持三种 1.进出客流 4.区域 6.人脸
"status": 0, //0:关闭 1:开启
"model":
{
"id": "1", //序号
"file": "model_vertical_small.cm3" //model文件名称
},
"result":
{
"inout": // 进出客流&区域客流
{
"sendinterval": 60, //发送结果的时间间隔,取值范围{1,6,60,120,600},单位是秒
"save": 0, //是否保存数据,0:不保存 1:保存
},
"face": //人脸客流
{
"sendface": 1, //0:不输出人脸图片 1:输出人脸图片
"sendbodynum": 1, //0:部输出人体图片 1:输出一张人体图片
"save": 0, //是否保存数据,0:不保存 1:保存
}
}
}
}
4. 设置工作时间
POST :http://192.168.1.117:8081/SDCAPI/V1.0/VionSoftware/do/webclient/setWorkTime
请求参数:
{
"channelid": 1
"worktime":{
"startTime":1222,
"endTime":122 ,
}
}
返回:
{
"success": 1,
"describe": "setWorkTime OK",
"errcode": 0,
"command": "setWorkTime"
}
5. 设置中心配置参数
POST :http://192.168.1.117:8081/SDCAPI/V1.0/VionSoftware/do/webclient/setCenterParam
请求参数:
{
"channelid": 1
"centerconfig":{
"httpUploadAddr":"",
"keepaliveinterval":10,
"keepaliveswitch":1,
"uploadjpginterval":10,
"uploadjpgnum":2,
"uploadjpgswitch":0
}
}
返回:
{
"success": 1,
"describe": "setCenterParam OK",
"errcode": 0,
"command": "setCenterParam"
}
\ No newline at end of file
1.获取算法配置
POST : http://192.168.1.117:8081/SDCAPI/V1.0/VionSoftware/do/webclient/getAlgConfig
请求参数:
{
"channelid": 1
}
返回结果:
{
"success":1,
"describe":"算法设置查询成功",
"channelid": 1, //
"runtype": 1, //类型1-7 目前只支持三种 1.进出客流 4.区域 6.人脸
"algconfig":
{
"resource":
{
"total_resouce_free": 20,//总资源剩余 [0,100]
"resouce_usage": 20, //资源使用率,[0,100]
},
"roi":
{
"imagepath": "../../../TEMP/1462519844378479.jpg", //画ROI的那张截图路径
"imagesize_H": 1280,
"imagesize_W": 1280,
"cameraheight": 500, //单位cm
"angle": 0, //角度
"mode": 0, //选择模式, 0:宽松 1:严格
"directioncount": 0,//方向个数
"linecount": 0, //进门线个数
"rectcount": 0, //检测框个数
"directionxysets"://方向线坐标
[
{
"beginx":123,
"beginy":456,
"endx": 223,
"endy": 556
},
...
],
"linexysets"://进门线坐标initRect
[
{ //一条进门线
"coordinates":
[ //每条进门线含有N个坐标点
{ //一个坐标点
"x":123,
"y":456
}
...
]
},
...
],
"recxysets"://检测框坐标
[
{ //一个检测框
"coordinates":
[ //每个检测框含有N个坐标点
{ //一个坐标点
"x":123,
"y":456
}
...
]
},
...
],
},
"config": //算法基本参数
{
"inout"://进出客流
{
"zoomscale": 3, //人头尺寸 [0.5,4] step=0.01 alg:x100 表示传入算法时,该值要*100
"zoomscalemin": 20, //最小人头尺寸 [0,1000] step=5
"zoomscalemax": 300, //最大人头尺寸 [0,1000] step=5
"sensitivity1": 20, //敏感度1 [0,100] step=1
"sensitivity2": 40, //敏感度2 [0,100] step=1
"sensitivity3": 20, //敏感度3 [0,100] step=1
"displaymode": 1, //模式选择 0:录像 1:经典 2:调试 3:展示
"tracethreshold": 3, //轨迹跟踪阀值 [1,5] step=0.1 alg:x100
"preframenum": 30, //轨迹预测帧数 [1,100] step=1
"trackmotionthreshold": 1, //轨迹移动阀值 [0,10] step=0.1 alg:x100
"trackshapethreshold": 0.5, //轨迹形态阀值 [0,1] step=0.1 alg:x100
"incoefficient": 0, //走入参数 [0,2] step=0.1 alg:x100
"outcoefficient": 0, //走出参数 [0,2] step=0.1 alg:x100
},
"area"://区域客流
{
"zoomscale": 3, //人头尺寸 [0.5,4] step=0.01 alg:x100 表示传入算法时,该值要*100
"zoomscalemin": 20, //最小人头尺寸 [0,1000] step=5
"zoomscalemax": 300, //最大人头尺寸 [0,1000] step=5
"sensitivity1": 20, //敏感度1 [0,100] step=1
"sensitivity2": 40, //敏感度2 [0,100] step=1
"sensitivity3": 20, //敏感度3 [0,100] step=1
"displaymode": 1, //模式选择 0:录像 1:经典 2:调试 3:展示
"tracethreshold": 3, //轨迹跟踪阀值 [1,5] step=0.1 alg:x100
"trackmotionthreshold": 1, //轨迹移动阀值 [0,10] step=0.1 alg:x100
"areacoefficient": 1, //区域参数 [0.1,10] step=0.01 alg:x100
},
"face"://人脸客流
{
"zoomscale": 3, //人头尺寸 [0.5,4] step=0.01 alg:x100 表示传入算法时,该值要*100
"zoomscalemin": 20, //最小人头尺寸 [0,1000] step=5
"zoomscalemax": 300, //最大人头尺寸 [0,1000] step=5
"sensitivity1": 20, //敏感度1 [0,100] step=1
"sensitivity2": 40, //敏感度2 [0,100] step=1
"sensitivity3": 20, //敏感度3 [0,100] step=1
"displaymode": 1, //模式选择 0:录像 1:经典 2:调试 3:展示
"tracethreshold": 3, //轨迹跟踪阀值 [1,5] step=0.1 alg:x100
"preframenum": 30, //轨迹预测帧数 [1,100] step=1
"trackmotionthreshold": 1, //轨迹移动阀值 [0,10] step=0.1 alg:x100
"trackshapethreshold": 0.5, //轨迹形态阀值 [0,1] step=0.1 alg:x100
"removesimilarity":75, //去重相似度 [10,100] step=0.01 alg:x100
"removetime":15, //去重时间 [0,1200] step=1
"facelum":0.5, //人脸亮度 [0,1] step=0.01 alg:x100
"facequalitythreshold": 3.5, //人脸质量阀值 [0,5] step=0.1 alg:x100
"maxage":70, //最大年龄 [1,100] step=1
"minage":1, //最小年龄 [1,100] step=1
"genderthreshold":0.5, //男女阀值 [0,1] step=0.01 alg:x100
"facecaptureinterval":3, //人脸抓取间隔 [1,20] step=1
"incoefficient": 1, //走入参数 [0.1,10] step=0.01 alg:x100
"outcoefficient": 1, //走出参数 [0.1,10] step=0.01 alg:x100
}
}
}
}
2.设置算法配置
POST :http://192.168.1.117:8081/SDCAPI/V1.0/VionSoftware/do/webclient/modAlgConfig
参数:
{
"channelid": 1,
"runtype": 1, //类型1-7 目前只支持三种 1.进出客流 4.区域 6.人脸
"roi":
{
"imagepath": "../../../TEMP/1462519844378479.jpg", //画ROI的那张截图路径
"imagesize_H": 1280,
"imagesize_W": 1280,
"cameraheight": 500, //单位cm
"angle": 0, //角度
"mode": 0, //选择模式, 0:宽松 1:严格
"directioncount": 0,//方向个数
"linecount": 0, //进门线个数
"rectcount": 0, //检测框个数
"directionxysets"://方向线坐标
[
{
"beginx":123,
"beginy":456,
"endx": 223,
"endy": 556
},
...
],
"linexysets"://进门线坐标
[
{ //一条进门线
"coordinates":
[ //每条进门线含有N个坐标点
{ //一个坐标点
"x":123,
"y":456
}
...
]
},
...
],
"recxysets"://检测框坐标
[
{ //一个检测框
"coordinates":
[ //每个检测框含有N个坐标点
{ //一个坐标点
"x":123,
"y":456
}
...
]
},
...
]
},
"config": //算法基本参数
{
"inout"://进出客流
{
"zoomscale": 3, //人头尺寸 [0.5,4] step=0.01 alg:x100 表示传入算法时,该值要*100
"zoomscalemin": 20, //最小人头尺寸 [0,1000] step=5
"zoomscalemax": 300, //最大人头尺寸 [0,1000] step=5
"sensitivity1": 20, //敏感度1 [0,100] step=1
"sensitivity2": 40, //敏感度2 [0,100] step=1
"sensitivity3": 20, //敏感度3 [0,100] step=1
"displaymode": 1, //模式选择 0:录像 1:经典 2:调试 3:展示
"tracethreshold": 3, //轨迹跟踪阀值 [1,5] step=0.1 alg:x100
"preframenum": 30, //轨迹预测帧数 [1,100] step=1
"trackmotionthreshold": 1, //轨迹移动阀值 [0,10] step=0.1 alg:x100
"trackshapethreshold": 0.5, //轨迹形态阀值 [0,1] step=0.1 alg:x100
"incoefficient": 0, //走入参数 [0,2] step=0.1 alg:x100
"outcoefficient": 0, //走出参数 [0,2] step=0.1 alg:x100
},
"area"://区域客流
{
"zoomscale": 3, //人头尺寸 [0.5,4] step=0.01 alg:x100 表示传入算法时,该值要*100
"zoomscalemin": 20, //最小人头尺寸 [0,1000] step=5
"zoomscalemax": 300, //最大人头尺寸 [0,1000] step=5
"sensitivity1": 20, //敏感度1 [0,100] step=1
"sensitivity2": 40, //敏感度2 [0,100] step=1
"sensitivity3": 20, //敏感度3 [0,100] step=1
"displaymode": 1, //模式选择 0:录像 1:经典 2:调试 3:展示
"tracethreshold": 3, //轨迹跟踪阀值 [1,5] step=0.1 alg:x100
"trackmotionthreshold": 1, //轨迹移动阀值 [0,10] step=0.1 alg:x100
"areacoefficient": 1, //区域参数 [0.1,10] step=0.01 alg:x100
},
"face"://人脸客流
{
"zoomscale": 3, //人头尺寸 [0.5,4] step=0.01 alg:x100 表示传入算法时,该值要*100
"zoomscalemin": 20, //最小人头尺寸 [0,1000] step=5
"zoomscalemax": 300, //最大人头尺寸 [0,1000] step=5
"sensitivity1": 20, //敏感度1 [0,100] step=1
"sensitivity2": 40, //敏感度2 [0,100] step=1
"sensitivity3": 20, //敏感度3 [0,100] step=1
"displaymode": 1, //模式选择 0:录像 1:经典 2:调试 3:展示
"tracethreshold": 3, //轨迹跟踪阀值 [1,5] step=0.1 alg:x100
"preframenum": 30, //轨迹预测帧数 [1,100] step=1
"trackmotionthreshold": 1, //轨迹移动阀值 [0,10] step=0.1 alg:x100
"trackshapethreshold": 0.5, //轨迹形态阀值 [0,1] step=0.1 alg:x100
"removesimilarity":75, //去重相似度 [10,100] step=0.01 alg:x100
"removetime":15, //去重时间 [0,1200] step=1
"facelum":0.5, //人脸亮度 [0,1] step=0.01 alg:x100
"facequalitythreshold": 3.5, //人脸质量阀值 [0,5] step=0.1 alg:x100
"maxage":70, //最大年龄 [1,100] step=1
"minage":1, //最小年龄 [1,100] step=1
"genderthreshold":0.5, //男女阀值 [0,1] step=0.01 alg:x100
"facecaptureinterval":3, //人脸抓取间隔 [1,20] step=1
"incoefficient": 1, //走入参数 [0.1,10] step=0.01 alg:x100
"outcoefficient": 1, //走出参数 [0.1,10] step=0.01 alg:x100
}
}
}
响应:
{
"success":1,
"describe":"算法参数修改成功",//可选
"errcode": 23, //可选
"command": "modChannel" //可选
}
1.上传算法授权文件
POST: http://192.168.1.117:8081/SDCAPI/V1.0/VionSoftware/do/webclient/uploadLicense
参数:
{"license":"AppName=VionSoftware
AppVersion=1.0.5
Vendor=vionvision
LicenseType=trial
ExpiredDays=60
AuthorizationDate=2021-9-13
Functions=255
DeviceCount=1
DeviceIDs=67E8EA4E6AD290D2750AFC1DC54CC2B8
SerialNumber=7gAAPwgAAPfEXwAAAB7ixAAA7QAAAIMKfwAAAL0AAABjAAAAVgAAABsAVKwAAE8K+wAAACEAAACfAAAAtwAAAOIAuQDUAEwKAKQAPQAAAADHAAAAmAAAAOIA2gAAlL0KAAB4AAAAAGZTdwAAAGhVlwAAzwAAANAKCjVEF6lZAKmQ196xAAC87CEAAH4AAAANCgAAvAAAABYAAAAAAMwAAAA9AOUAAACTCgAAbgAAAMYw+Xl7ACwAAAAAAF6DMYwGCgAApgAAADwAAAAAAIoAAABmAKsAAACVCgAAhQAAAPdmlGzJAACGsgMAAA8AAACzCkj/PBa3AF93JJA72vP3QQ=="}
响应:
{
"success": 1,
"describe": "uploadLicense OK",
"errcode": 0,
"command": "uploadLicense"
}
\ No newline at end of file
# sdc-face
## Project setup
```
yarn install
```
### Compiles and hot-reloads for development
```
yarn serve
```
### Compiles and minifies for production
```
yarn build
```
### Lints and fixes files
```
yarn lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
{
"name": "sdc-face",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.19.0",
"core-js": "^3.6.5",
"element-ui": "^2.12.0",
"fabric": "^4.6.0",
"vue": "^2.6.11",
"vue-router": "^3.5.3"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential"
],
"rules": {
"indent": "off",
"no-console": "off",
"no-unused-vars": "off",
"no-use-before-define": "off",
"no-undef": "off",
"no-irregular-whitespace": "off",
"no-debugger": "off",
"vue/no-unused-components": "off"
},
"parserOptions": {
"parser": "babel-eslint"
},
"overrides": [
{
"files": [
"**/__tests__/*.{j,t}s?(x)"
],
"env": {
"mocha": true
}
}
]
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
No preview for this file type
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<!--
* @Author: your name
* @Date: 2021-12-16 10:55:51
* @LastEditTime: 2021-12-26 10:24:08
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /sdc-face/src/App.vue
-->
<template>
<div id="app">
<div class="tabbox">
<el-menu
:default-active="activeIndex"
class="menus"
mode="horizontal"
active-text-color="#409EFF"
router
@select="handleSelect"
>
<el-menu-item index="/">
<template slot="title">
<i class="el-icon-setting"></i>
<span>算法配置</span>
</template>
</el-menu-item>
<el-menu-item index="/system">
<template slot="title">
<i class="el-icon-s-grid"></i>
<span>通用配置</span>
</template></el-menu-item>
<el-menu-item index="/datashow" >
<template slot="title">
<i class="el-icon-pie-chart"></i>
<span>数据管理</span>
</template>
</el-menu-item>
</el-menu>
</div>
<router-view></router-view>
</div>
</template>
<script>
export default {
name: "App",
data(){
return {
activeIndex:'/'
}
},
methods:{
handleSelect(){
}
}
};
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
width: 1200px;
margin: 0 auto;
}
.menus{
text-align: center;
}
</style>
/*
* @Author: panda
* @Date: 2021-12-18 13:48:39
* @LastEditTime: 2021-12-24 17:30:03
* @LastEditors: Please set LastEditors
* @Description: api列表
* @FilePath: /sdc-face/src/api/apilist.js
*/
import api from './index'
const baseUrl = "http://huayan.320.io:80"
export default {
//截图
captureImage(params){
let url = baseUrl + "/SDCAPI/V1.0/VionSoftware/do/webclient/cutpic"
return api.get(url, params);
},
// 获取算法参数
getAlgo(params, header) {
let url = baseUrl + "/SDCAPI/V1.0/VionSoftware/do/webclient/getAlgConfig"
return api.post(url, params);
},
//设置算法参数
setAlgo(params, headers) {
let url = baseUrl + '/SDCAPI/V1.0/VionSoftware/do/webclient/modAlgConfig'
return api.post(url, params, headers);
},
//获取服务配置
getDeviceBasicInfo(params, id) {
let url = baseUrl + '/SDCAPI/V1.0/VionSoftware/do/webclient/deviceBasicInfo'
return api.get(url, params);
},
//设置中心配置参数
setCenterParam(params) {
let url = baseUrl + '/SDCAPI/V1.0/VionSoftware/do/webclient/setCenterParam'
return api.post(url, params);
},
//获取存储配置
getBusiness(params, id) {
let url = baseUrl + '/SDCAPI/V1.0/VionSoftware/do/webclient/getBusiness'
return api.get(url, params);
},
//设置存储配置
setModBusiness(params, id) {
let url = baseUrl + '/SDCAPI/V1.0/VionSoftware/do/webclient/modBusiness'
return api.post(url, params);
},
//设置工作时间
setWorking(params, id) {
let url = baseUrl + '/SDCAPI/V1.0/VionSoftware/do/webclient/setWorkTime'
return api.post(url, params);
}
}
\ No newline at end of file
/*
* @Author: panda
* @Date: 2021-12-18 13:45:24
* @LastEditTime: 2021-12-24 15:47:12
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /sdc-face/src/api/axios.js
*/
import axios from "axios";
import router from "../router/index";
import { Message, Loading } from "element-ui";
let loading;
//内存中正在请求的数量
let loadingNum = 0;
function startLoading() {
if (loadingNum == 0) {
loading = Loading.service({
lock: true,
text: "拼命加载中...",
background: "rgba(255,255,255,0.5)"
});
}
//请求数量加1
loadingNum++;
}
function endLoading() {
//请求数量减1
loadingNum--;
if (loadingNum <= 0) {
loading.close();
}
}
// 创建 axios 实例
let service = axios.create({
// headers: {'Content-Type': 'application/Text'},
timeout: 600000
});
// 添加请求拦截器
service.interceptors.request.use(
config => {
// startLoading();
let atoken = localStorage.getItem("atoken");
if (atoken) {
// 判断是否存在token,如果存在的话,则每个http header都加上token
config.headers.authorization = atoken;
} else {
}
if (config.method == "get") {
config.params = {
_t: Date.parse(new Date()) / 1000,
...config.params
};
}
return config;
},
err => {
// 请求错误处理
return Promise.reject(err);
}
);
// 添加响应拦截器
service.interceptors.response.use(response => {
// endLoading();
if (response.data && response.data.ecode && response.data.ecode == 401) {
Message.warning({ message: "用户登录过期,请重新登录!" });
localStorage.removeItem("atoken");
router.replace({
path: "/"
});
// location.reload();
} else {
let { data } = response;
// data.response = response;
return data;
}
err => {
// endLoading();
if (err && err.response) {
Message.error({ message: err.response.data.enote });
} else {
Message.error({ message: "连接服务器失败!" });
}
return Promise.reject(err);
};
});
/**
* 创建统一封装过的 axios 实例
* @return {AxiosInstance}
*/
export default function() {
return service;
}
/*
* @Author: your name
* @Date: 2021-12-18 13:40:09
* @LastEditTime: 2021-12-18 13:46:30
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /sdc-face/src/api/index.js
*/
import axios from "./axios";
let instance = axios();
export default {
get(url, params, headers) {
let options = {};
if (params) {
options.params = params;
}
if (headers) {
options.headers = headers;
}
return instance.get(url, options);
},
post(url, data, headers, params) {
let options = {};
if (params) {
options.params = params;
}
if (headers) {
options.headers = headers;
}
return instance.post(url, data, options);
},
put(url, params, headers) {
let options = {};
if (headers) {
options.headers = headers;
}
return instance.put(url, params, options);
},
post2(url, params, headers) {
let options = {};
if (headers) {
options.headers = headers;
}
return instance.post(url, params, options);
},
delete(url, params, headers) {
let options = {};
if (params) {
options.data = params
}
if (headers) {
options.headers = headers;
}
return instance.delete(url, options);
}
};
/*
* @Author: your name
* @Date: 2021-12-18 13:47:29
* @LastEditTime: 2021-12-18 14:02:49
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /sdc-face/src/api/install.js
*/
import apiList from "./apiList";
const install = function(Vue) {
if (install.installed) {
return;
}
install.installed = true;
Object.defineProperties(Vue.prototype, {
$api: {
get() {
return apiList;
}
}
});
};
export default {
install
};
.el-menu--horizontal>.el-menu-item{
width: 33%;
font-size: 20px;
}
.el-slider__input{
width: 105px!important;
}
.el-form-item__label{
padding-top:5px!important;
}
.el-slider__runway.show-input{
margin-right: 108px!important;
}
.el-form-item--small .el-form-item__content, .el-form-item--small .el-form-item__label {
line-height: 40px;
}
.advancedbox .el-slider__input{
width: 75px!important;
}
.advancedbox .el-input-number--mini .el-input-number__decrease, .el-input-number--mini .el-input-number__increase{
width: 20px;
}
.advancedbox .el-input-number--mini .el-input__inner {
padding: 0;
}
.advancedbox .el-slider__runway.show-input{
margin-right: 78px!important;
}
.advancedbox .el-button{
width: 100%;
text-align: center;
padding: 7px 5px;
}
.advancedbox .el-form-item--mini.el-form-item, .el-form-item--small.el-form-item{
margin-bottom: -5px!important;
overflow: hidden;
}
.advancedbox .el-form-item .el-form-item--small{
overflow: hidden!important;
}
.algobox .el-form-item__label{
font-size: 12px;
}
\ No newline at end of file
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
/*
* @Author: panda
* @Date: 2021-12-16 10:55:51
* @LastEditTime: 2021-12-18 14:24:05
* @LastEditors: Please set LastEditors
* @Description: 入口
* @FilePath: /sdc-face/src/main.js
*/
import Vue from 'vue'
import App from './App.vue'
import router from "./router";
import ElementUI from "element-ui";
import api from "./api/install";
import './assets/css/public.css'
import "element-ui/lib/theme-chalk/index.css";
Vue.config.productionTip = false
Vue.use(ElementUI, { size: "small", zIndex: 3000 });
Vue.use(api);
new Vue({
router,
render: h => h(App),
}).$mount('#app')
/*
* @Author: panda
* @Date: 2021-12-18 12:56:14
* @LastEditTime: 2021-12-18 14:10:17
* @LastEditors: Please set LastEditors
* @Description: 路由设置
* @FilePath: /sdc-face/src/router/index.js
*/
import Vue from "vue";
import VueRouter from "vue-router";
import AlgoSetting from '../views/Algo'
import SystemSetting from '../views/System'
import DataShow from '../views/DataShow'
Vue.use(VueRouter);
const defalutrouter = [{
name:'algoset',
path:"/",
component:AlgoSetting
},{
name:'systemset',
path:"/system",
component:SystemSetting
},{
name:'datashow',
path:"/datashow",
component:DataShow
}]
const router = new VueRouter({
// mode: "history",
// base: process.env.BASE_URL,
routes: defalutrouter
});
export default router;
\ No newline at end of file
<!--
* @Author: panda
* @Date: 2021-12-18 13:00:42
* @LastEditTime: 2021-12-18 13:00:42
* @LastEditors: Please set LastEditors
* @Description: 数据展示
* @FilePath: /sdc-face/src/views/DataShow/index.vue
-->
<template>
<div>
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>
\ No newline at end of file
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!