Compare commits
No commits in common. "main" and "pc-master" have entirely different histories.
|
@ -0,0 +1,23 @@
|
|||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
18
App.vue
|
@ -1,18 +0,0 @@
|
|||
<script>
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
console.log('App Launch')
|
||||
},
|
||||
onShow: function() {
|
||||
console.log('App Show')
|
||||
},
|
||||
onHide: function() {
|
||||
console.log('App Hide')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/*每个页面公共css */
|
||||
@import "uview-ui/index.scss";
|
||||
</style>
|
|
@ -0,0 +1,26 @@
|
|||
FROM nginx:1.17.9-alpine
|
||||
|
||||
LABEL maintainer="clibing <wmsjhappy@gmail.com>"
|
||||
|
||||
ARG TZ='Asia/Shanghai'
|
||||
|
||||
ENV TZ ${TZ}
|
||||
|
||||
RUN apk upgrade --update \
|
||||
&& apk add bash \
|
||||
&& ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
|
||||
&& echo ${TZ} > /etc/timezone \
|
||||
&& rm -rf /usr/share/nginx/html /var/cache/apk/*
|
||||
|
||||
COPY nginx.vh.default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
COPY dist /usr/share/nginx/html
|
||||
|
||||
RUN chown -R nginx /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
STOPSIGNAL SIGTERM
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
# build
|
||||
|
||||
## with builder
|
||||
```bash
|
||||
docker run --rm -it -v /root/workspace/wszhyWx:/workspace clibing/alpine-build bash
|
||||
cd /workspace
|
||||
npm install --legacy-peer-deps
|
||||
npm run build
|
||||
|
||||
```
|
||||
|
||||
## exec sh in container log
|
||||
```bash
|
||||
> ysws-vue@0.1.0 build
|
||||
> vue-cli-service build
|
||||
|
||||
All browser targets in the browserslist configuration have supported ES module.
|
||||
Therefore we don't build two separate bundles for differential loading.
|
||||
|
||||
|
||||
⠋ Building for production...
|
||||
|
||||
WARNING Compiled with 2 warnings 11:07:23 PM
|
||||
|
||||
warning
|
||||
|
||||
asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
|
||||
This can impact web performance.
|
||||
Assets:
|
||||
img/index-background.6170a105.png (1.88 MiB)
|
||||
fonts/ALIBABA-PUHUITI-MEDIUM.7e8661bc.OTF (6.26 MiB)
|
||||
fonts/ALIBABA-PUHUITI-REGULAR.035db024.OTF (6.6 MiB)
|
||||
fonts/Alimama_ShuHeiTi_Bold.0ac727c9.ttf (1.3 MiB)
|
||||
img/login-bg.d0ccd5e4.png (1.44 MiB)
|
||||
img/background.14e833d2.jpg (616 KiB)
|
||||
js/970.9288c639.js (1.01 MiB)
|
||||
css/chunk-vendors.d93d07ef.css (246 KiB)
|
||||
js/chunk-vendors.b4684c39.js (2.14 MiB)
|
||||
|
||||
warning
|
||||
|
||||
entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
|
||||
Entrypoints:
|
||||
app (2.49 MiB)
|
||||
css/chunk-vendors.d93d07ef.css
|
||||
js/chunk-vendors.b4684c39.js
|
||||
css/app.1d0469df.css
|
||||
js/app.81c6b894.js
|
||||
|
||||
|
||||
File Size Gzipped
|
||||
|
||||
dist/js/chunk-vendors.b4684c39.js 2192.83 KiB 587.48 KiB
|
||||
dist/js/970.9288c639.js 1029.18 KiB 340.26 KiB
|
||||
dist/js/899.9e1072c1.js 60.46 KiB 17.31 KiB
|
||||
dist/js/app.81c6b894.js 44.54 KiB 19.10 KiB
|
||||
dist/js/51.54b739ec.js 28.85 KiB 13.19 KiB
|
||||
dist/js/491.f0009224.js 20.95 KiB 8.37 KiB
|
||||
dist/js/617.9950aee6.js 18.03 KiB 7.03 KiB
|
||||
dist/js/33.4aac9c4b.js 17.99 KiB 6.97 KiB
|
||||
dist/js/573.56d9ffde.js 16.37 KiB 7.74 KiB
|
||||
dist/js/985.5c7740ef.js 14.00 KiB 7.06 KiB
|
||||
dist/css/chunk-vendors.d93d07ef.css 245.69 KiB 43.63 KiB
|
||||
dist/css/app.1d0469df.css 63.51 KiB 30.42 KiB
|
||||
dist/css/51.60c1caae.css 49.92 KiB 32.33 KiB
|
||||
dist/css/33.bc37da49.css 0.72 KiB 0.34 KiB
|
||||
dist/css/491.bc37da49.css 0.72 KiB 0.34 KiB
|
||||
dist/css/573.bc37da49.css 0.72 KiB 0.34 KiB
|
||||
dist/css/617.bc37da49.css 0.72 KiB 0.34 KiB
|
||||
dist/css/899.bc37da49.css 0.72 KiB 0.34 KiB
|
||||
dist/css/985.bc37da49.css 0.72 KiB 0.34 KiB
|
||||
|
||||
Images and other types of assets omitted.
|
||||
Build at: 2023-10-07T15:07:23.981Z - Hash: d30c57e5506e3d29 - Time: 45735ms
|
||||
|
||||
DONE Build complete. The dist directory is ready to be deployed.
|
||||
INFO Check out deployment instructions at https://cli.vuejs.org/guide/deployment.html
|
||||
```
|
||||
|
||||
## exit container
|
||||
|
||||
## build image
|
||||
|
||||
```` bash
|
||||
./build-image.sh
|
||||
````
|
||||
|
||||
|
||||
|
||||
# ysws-vue
|
||||
|
||||
## Project setup
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
@ -0,0 +1,5 @@
|
|||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
BRANCH=$(git branch --show-current)
|
||||
BUILD_DATE=$(date "+%s")
|
||||
COMMIT_SHA1=$(git rev-parse HEAD)
|
||||
docker build -t lihe-control.com/iot-www:${BRANCH}-${COMMIT_SHA1:0:8}-${BUILD_DATE} -f Dockerfile .
|
20
index.html
|
@ -1,20 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<script>
|
||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
||||
CSS.supports('top: constant(a)'))
|
||||
document.write(
|
||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
||||
</script>
|
||||
<title></title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"><!--app-html--></div>
|
||||
<script type="module" src="/main.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "esnext",
|
||||
"baseUrl": "./",
|
||||
"moduleResolution": "node",
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
},
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"scripthost"
|
||||
]
|
||||
}
|
||||
}
|
32
main.js
|
@ -1,32 +0,0 @@
|
|||
import App from './App'
|
||||
|
||||
import uView from "uview-ui";
|
||||
Vue.use(uView);
|
||||
|
||||
// #ifndef VUE3
|
||||
import Vue from 'vue'
|
||||
import './uni.promisify.adaptor'
|
||||
Vue.config.productionTip = false
|
||||
App.mpType = 'app'
|
||||
const app = new Vue({
|
||||
...App
|
||||
})
|
||||
app.$mount()
|
||||
// #endif
|
||||
|
||||
// #ifdef VUE3
|
||||
import { createSSRApp } from 'vue'
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App)
|
||||
return {
|
||||
app
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
|
||||
//接口 this.api
|
||||
import api from '@/api/driverapi.js'
|
||||
Vue.prototype.api = api;
|
||||
//
|
||||
import {myRequest} from "./api/nvuerequest"
|
||||
Vue.prototype.$http=myRequest
|
|
@ -1,72 +0,0 @@
|
|||
{
|
||||
"name" : "greenhouse-wisdom-applet",
|
||||
"appid" : "__UNI__1066059",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules" : {},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
/* android打包配置 */
|
||||
"android" : {
|
||||
"permissions" : [
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
]
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios" : {},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs" : {}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
"quickapp" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin" : {
|
||||
"appid" : "wx05b45a2699f02a2b",
|
||||
"setting" : {
|
||||
"urlCheck" : false
|
||||
},
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-toutiao" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"uniStatistics" : {
|
||||
"enable" : false
|
||||
},
|
||||
"vueVersion" : "2"
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
#charset koi8-r;
|
||||
#access_log /var/log/nginx/host.access.log main;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/index.html $uri/index.htm /index.html;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"name": "zhihuiyun",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.5.0",
|
||||
"core-js": "^3.8.3",
|
||||
"echarts": "^5.4.3",
|
||||
"element-ui": "^2.15.14",
|
||||
"ezuikit-js": "^7.7.7",
|
||||
"flv.js": "^1.6.2",
|
||||
"html2canvas": "^1.4.1",
|
||||
"qrcode": "^1.5.3",
|
||||
"video.js": "^7.21.5",
|
||||
"videojs-contrib-hls": "^5.15.0",
|
||||
"videojs-contrib-hls.js": "^3.2.0",
|
||||
"vue": "^2.7.14",
|
||||
"vue-router": "^3.5.1",
|
||||
"vue-seamless-scroll": "^1.1.23",
|
||||
"vue-video-player": "^6.0.0",
|
||||
"vuex": "^3.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "~5.0.0",
|
||||
"@vue/cli-plugin-router": "~5.0.0",
|
||||
"@vue/cli-plugin-vuex": "~5.0.0",
|
||||
"@vue/cli-service": "~5.0.0",
|
||||
"sass": "^1.32.7",
|
||||
"sass-loader": "^12.0.0",
|
||||
"vue-template-compiler": "^2.6.14"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not dead"
|
||||
]
|
||||
}
|
After Width: | Height: | Size: 4.2 KiB |
|
@ -0,0 +1,18 @@
|
|||
<!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>
|
||||
<script src="../src/assets/js/ek.js"></script>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,159 @@
|
|||
<template>
|
||||
<div id="app" :class="isMobile?'mobile':''">
|
||||
<router-view />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
isMobile:false
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
"$route"(newName, oldName) {
|
||||
var routerNow = this.$route.name;
|
||||
if(routerNow=='videoLive'){
|
||||
this.isMobile=true
|
||||
}else{
|
||||
this.isMobile=false
|
||||
}
|
||||
},
|
||||
},
|
||||
created(){
|
||||
if (sessionStorage.getItem("store") ) { //在页面加载时读取sessionStorage里的状态信息
|
||||
this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(sessionStorage.getItem("store"))))
|
||||
}
|
||||
window.addEventListener("beforeunload",()=>{ //在页面刷新时将vuex里的信息保存到sessionStorage里
|
||||
sessionStorage.setItem("store",JSON.stringify(this.$store.state))
|
||||
})
|
||||
|
||||
},
|
||||
mounted(){
|
||||
let inputList = document.querySelectorAll('input');
|
||||
for (let index = 0; index < inputList.length; index++) {
|
||||
inputList[index].onfocus = this.selectValue();//input放入焦点,全选文本
|
||||
}
|
||||
|
||||
},
|
||||
methods:{
|
||||
//全选文本
|
||||
selectValue(e) {
|
||||
e.currentTarget.select();
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
* {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
outline: none;
|
||||
font-size: 16px;
|
||||
box-sizing: border-box;
|
||||
font-family: Microsoft YaHei;
|
||||
font-weight: 400;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
input::-webkit-outer-spin-button,
|
||||
input::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none !important;
|
||||
margin: 0;
|
||||
}
|
||||
#app{
|
||||
min-width: 1290px;
|
||||
min-height: 900px;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
&.mobile{
|
||||
min-width: unset;
|
||||
min-height: unset;
|
||||
width: auto;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
@font-face {
|
||||
font-family: Oswald;
|
||||
src: url(./assets/ttf/Oswald-Medium.ttf);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: Alibaba PuHuiTi;
|
||||
src: url(./assets/ttf/ALIBABA-PUHUITI-MEDIUM.OTF);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: Alibaba PuHuiTiR;
|
||||
src: url(./assets/ttf/ALIBABA-PUHUITI-REGULAR.OTF);
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: Alimama ShuHeiTiB;
|
||||
src: url(./assets/ttf/Alimama_ShuHeiTi_Bold.ttf);
|
||||
}
|
||||
|
||||
.main-title {
|
||||
width: 100%;
|
||||
height: 41px;
|
||||
background: url(./assets/image/main-title.png) no-repeat center;
|
||||
background-size: 100% 100%;
|
||||
padding-left: 23px;
|
||||
|
||||
span {
|
||||
line-height: 41px;
|
||||
font-size: 20px;
|
||||
font-family: Alibaba PuHuiTi;
|
||||
font-weight: bold;
|
||||
color: #DBE8FF;
|
||||
|
||||
background: linear-gradient(180deg, rgba(49, 190, 255, 1) 0%, rgba(20, 158, 255, 1) 0%, rgba(239, 252, 254, 1) 58.7646484375%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.view-content {
|
||||
width: 100%;
|
||||
height: 327px;
|
||||
border: 1px solid;
|
||||
margin-top: 8px;
|
||||
border-image: linear-gradient(180deg, rgba(142, 179, 221, 0.5) 0%, transparent 100%) 10 10;
|
||||
background: linear-gradient(180deg, rgba(6, 72, 167, 0.5) 0%, rgba(6, 72, 167, 0) 100%);
|
||||
|
||||
}
|
||||
|
||||
.input-50 {
|
||||
.input-title {
|
||||
font-size: 16px;
|
||||
font-family: Alibaba PuHuiTiR;
|
||||
font-weight: 400;
|
||||
color: #FFF9F9;
|
||||
}
|
||||
|
||||
input,
|
||||
.input {
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
background: url(./assets/image/left1-input.png) no-repeat center;
|
||||
background-size: 100% 100%;
|
||||
padding-left: 15px;
|
||||
font-size: 20px;
|
||||
font-family: Alibaba PuHuiTiR;
|
||||
font-weight: 400;
|
||||
color: #648cbb;
|
||||
border: none;
|
||||
line-height: 50px;
|
||||
&.green{
|
||||
color: #3CFDFF;
|
||||
}
|
||||
}
|
||||
|
||||
&.input-100 {
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
|
@ -0,0 +1,720 @@
|
|||
import axios from "axios";
|
||||
// import qs from 'qs'
|
||||
import router from '../router/index'
|
||||
|
||||
function sendGetRequest(url, data) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
axios.get(url, {
|
||||
headers: { //头部参数
|
||||
// 'Content-Type': 'application/json; charset=utf-8',
|
||||
// "Access-Control-Allow-Origin": "*",
|
||||
// "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
|
||||
'token': (localStorage.getItem('token') ? localStorage.getItem('token') : '')
|
||||
},
|
||||
params: data
|
||||
})
|
||||
.then(function (res) { //请求成功,response接收返回参数
|
||||
if (res.data.code == 401) {
|
||||
localStorage.removeItem('token')
|
||||
router.push({
|
||||
name: 'login'
|
||||
})
|
||||
}
|
||||
resolve(res);
|
||||
|
||||
})
|
||||
.catch(function (err) { //请求失败,error接收失败原因
|
||||
reject(err);
|
||||
})
|
||||
});
|
||||
}
|
||||
function sendUploadRequest(url, data) {
|
||||
// 一个状态为resolve(包裹的是数据)
|
||||
// 或者状态为reject (包裹的是错误信息)
|
||||
// 的promise对象
|
||||
return new Promise(function (resolve, reject) {
|
||||
axios.post(url, data, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
// 'Content-Type': 'application/json; charset=utf-8',
|
||||
'token': (localStorage.getItem('token') ? localStorage.getItem('token') : '')
|
||||
}
|
||||
}).then(
|
||||
(res) => {
|
||||
if (res.data.code == 401) {
|
||||
localStorage.removeItem('token')
|
||||
router.push({
|
||||
name: 'login'
|
||||
})
|
||||
}
|
||||
resolve(res);
|
||||
},
|
||||
(err) => {
|
||||
reject(err);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function sendPostRequest(url, data) {
|
||||
// 一个状态为resolve(包裹的是数据)
|
||||
// 或者状态为reject (包裹的是错误信息)
|
||||
// 的promise对象
|
||||
return new Promise(function (resolve, reject) {
|
||||
axios.post(url, data, {
|
||||
headers: {
|
||||
// 'Content-Type': 'application/json; charset=utf-8',
|
||||
'token': (localStorage.getItem('token') ? localStorage.getItem('token') : '')
|
||||
}
|
||||
}).then(
|
||||
(res) => {
|
||||
if (res.data.code == 401) {
|
||||
localStorage.removeItem('token')
|
||||
router.push({
|
||||
name: 'login'
|
||||
})
|
||||
}
|
||||
resolve(res);
|
||||
},
|
||||
(err) => {
|
||||
reject(err);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function sendDelRequest(url, data) {
|
||||
// 一个状态为resolve(包裹的是数据)
|
||||
// 或者状态为reject (包裹的是错误信息)
|
||||
// 的promise对象
|
||||
return new Promise(function (resolve, reject) {
|
||||
axios.delete(url, {
|
||||
headers: { //头部参数
|
||||
// 'Content-Type': 'application/json; charset=utf-8',
|
||||
// "Access-Control-Allow-Origin": "*",
|
||||
// "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
|
||||
'token': (localStorage.getItem('token') ? localStorage.getItem('token') : '')
|
||||
},
|
||||
params: data
|
||||
}).then(
|
||||
(res) => {
|
||||
if (res.data.code == 401) {
|
||||
localStorage.removeItem('token')
|
||||
router.push({
|
||||
name: 'login'
|
||||
})
|
||||
}
|
||||
resolve(res);
|
||||
},
|
||||
(err) => {
|
||||
reject(err);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
function sendPutRequest(url, data) {
|
||||
// 一个状态为resolve(包裹的是数据)
|
||||
// 或者状态为reject (包裹的是错误信息)
|
||||
// 的promise对象
|
||||
return new Promise(function (resolve, reject) {
|
||||
axios.put(url, data, {
|
||||
headers: {
|
||||
// 'Content-Type': 'application/json; charset=utf-8',
|
||||
'token': (localStorage.getItem('token') ? localStorage.getItem('token') : '')
|
||||
}
|
||||
}).then(
|
||||
(res) => {
|
||||
if (res.data.code == 401) {
|
||||
localStorage.removeItem('token')
|
||||
router.push({
|
||||
name: 'login'
|
||||
})
|
||||
}
|
||||
resolve(res);
|
||||
},
|
||||
(err) => {
|
||||
reject(err);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
//总接口域名
|
||||
axios.defaults.baseURL = "/api";
|
||||
axios.defaults.timeout = 30000; // 设置全局默认请求超时时间为10秒
|
||||
|
||||
|
||||
|
||||
// 接口列表
|
||||
export default {
|
||||
//防止没有一个post/get会报错 写一个默认的
|
||||
get(data) {
|
||||
return sendGetRequest("", data);
|
||||
},
|
||||
post(data) {
|
||||
return sendPostRequest("", data);
|
||||
},
|
||||
delete(data) {
|
||||
return sendDelRequest("", data);
|
||||
},
|
||||
|
||||
put(data) {
|
||||
return sendPutRequest("", data);
|
||||
},
|
||||
|
||||
|
||||
//接口开始()
|
||||
//登录
|
||||
login(data) {
|
||||
return sendPostRequest("/user/login", data);
|
||||
},
|
||||
loginOut(data) {
|
||||
return sendGetRequest("/user/logout", data);
|
||||
},
|
||||
|
||||
//管理员根据设备id查询设备信息
|
||||
getSeldevicebyid(data) {
|
||||
return sendGetRequest("/admin/seldevicebyid", data);
|
||||
},
|
||||
//根据用户id查询对应的设备数据
|
||||
getEqbyid(data) {
|
||||
return sendGetRequest("/sel/eqbyid/" + data, '');
|
||||
},
|
||||
//气象站显示
|
||||
geteqetdata(data) {
|
||||
return sendGetRequest(`/getcontrol/geteqetdata?userId=`+data ,"")
|
||||
},
|
||||
//测试施肥机读取设备状态信息 //读取数据 根据文档编号读取 所有数据展示都出自这个接口
|
||||
postReg(data) {
|
||||
return sendPostRequest("/readFs/reg", data);
|
||||
},
|
||||
//测试施肥机读取设备状态信息 //读取数据 根据文档编号读取 所有数据展示都出自这个接口
|
||||
postState(data) {
|
||||
return sendPostRequest("/readFs/state", data);
|
||||
},
|
||||
//测试施肥机写入数据信息 //修改数据 根据文档编号修改 所有数据修改都出自这个接口
|
||||
postWriteFs(data) {
|
||||
return sendPostRequest("/writeFs", data);
|
||||
},
|
||||
getByid(data) {
|
||||
return sendGetRequest("/readFs/byid", data);
|
||||
},
|
||||
//获取实时数据
|
||||
postRtdata(data) {
|
||||
return sendPostRequest("/getFs/rtdata?equipmentId=" + data, '');
|
||||
},
|
||||
//获取实时数据
|
||||
postFsdata(data) {
|
||||
return sendPostRequest("/chart/fsdata?equipmentId=" + data, '');
|
||||
},
|
||||
//获取监控地址
|
||||
getGethls(data) {
|
||||
return sendGetRequest("/camera/gethls", data);
|
||||
},
|
||||
//根据ID查询用户信息
|
||||
getUser(data) {
|
||||
return sendGetRequest('/api/sel/user', data)
|
||||
},
|
||||
|
||||
|
||||
//控制器接口
|
||||
//控制器实时数据
|
||||
getControlRtdata(data) {
|
||||
return sendPostRequest("/getcontrol/rtdata?equipmentId=" + data, '');
|
||||
},
|
||||
//控制器实时数据折线图
|
||||
getControlFsdata(data) {
|
||||
return sendPostRequest("/getcontrol/fsdata?equipmentId=" + data, '');
|
||||
},
|
||||
//控制器数据上传数据获取
|
||||
getControldataUpload(data) {
|
||||
return sendGetRequest('/readControl/dataUpload', data)
|
||||
},
|
||||
//控制器写入数据
|
||||
postControlWrite(data) {
|
||||
return sendPostRequest("/writeJinHuaControl/write", data);
|
||||
},
|
||||
//控制器传感器通道
|
||||
getReadControlSensorChannel(data) {
|
||||
return sendGetRequest('/readControl/sensorChannel', data)
|
||||
},
|
||||
//控制器 顶模和风机
|
||||
getReadControlliShuiControl(data) {
|
||||
return sendGetRequest('/readControl/liShuiControl', data)
|
||||
},
|
||||
//控制器 传感器输入合成
|
||||
getReadControlSensorInputSynthesis(data) {
|
||||
return sendGetRequest('/readControl/sensorInputSynthesis', data)
|
||||
},
|
||||
//控制器 主页查看控制器气象站实时数据
|
||||
getControlRtDatastation(data) {
|
||||
return sendGetRequest('/getcontrol/rtDatastation', data)
|
||||
},
|
||||
//控制器 设备运行状态
|
||||
getControlGetState(data) {
|
||||
return sendGetRequest('/readControl/getState', data)
|
||||
},
|
||||
//控制器 气象站实时数据折线图
|
||||
getControlChartdata(data) {
|
||||
return sendPostRequest('/equip/chartdata?equipmentId=' + data, '')
|
||||
},
|
||||
//首页历史数据/数据分析弹窗
|
||||
selFsAvgdata(data) {
|
||||
return sendPostRequest('/selFs/avgdata',data)
|
||||
},
|
||||
//首页历史数据/数据分析弹窗下载数据
|
||||
selFsAvgdatadownload(data) {
|
||||
return sendPostRequest('/selFs/avgdatadownload',data)
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 根据用户id查询对应的设备大数据信息
|
||||
Bigdata_getAllControl(userid, data) {
|
||||
return sendGetRequest(`/Bigdata/getAllControl?userid=${userid}`, data);
|
||||
},
|
||||
|
||||
// 获取设备当天的温度
|
||||
Bigdata_getTemperature(deviceid, data) {
|
||||
return sendGetRequest(`/Bigdata/getTemperature?deviceid=${deviceid}`, data);
|
||||
},
|
||||
|
||||
// 获取设备一周的温度
|
||||
Bigdata_getWeekTemperature(deviceid, data) {
|
||||
return sendGetRequest(`/Bigdata/getWeekTemperature?deviceid=${deviceid}`, data);
|
||||
},
|
||||
|
||||
// 主页查看控制器实时数据
|
||||
getcontrol_rtdata(equipmentId, data) {
|
||||
return sendPostRequest(`/getcontrol/rtdata?equipmentId=${equipmentId}`, data);
|
||||
},
|
||||
|
||||
// 获取摄像头得地址 Copy
|
||||
camera_gethls(cameraid, channelid, data) {
|
||||
return sendGetRequest(`/camera/gethls?cameraid=${cameraid}&channelid=${channelid}`, data);
|
||||
},
|
||||
|
||||
// 根据用户id查询对应的设备数据 Copy
|
||||
sel_eqbyid(userId, data) {
|
||||
return sendGetRequest(`/sel/eqbyid/${userId}`, data);
|
||||
},
|
||||
|
||||
// 控制器状态值获取 Copy
|
||||
readControl_getState(deviceId, data) {
|
||||
return sendGetRequest(`/readControl/getState?deviceId=${deviceId}`, data);
|
||||
},
|
||||
|
||||
getcontrol_rtDatastation(equipmentId, data) {
|
||||
return sendGetRequest(`/getcontrol/rtDatastation?equipmentId=${equipmentId}`, data)
|
||||
},
|
||||
//控制器根据设备查看权限
|
||||
getcontrol_cpermission(equipmentId, data) {
|
||||
return sendPostRequest(`/getcontrol/cpermission?deviceId=${equipmentId}`, data)
|
||||
},
|
||||
//控制器五防接口
|
||||
readControl_fiveControl(data) {
|
||||
return sendGetRequest(`/readControl/fiveControl`, data);
|
||||
},
|
||||
|
||||
// 查看用户额外权限
|
||||
user_getjurisdiction(userId, data) {
|
||||
return sendGetRequest(`/user/getjurisdiction?userId=${userId}`, data)
|
||||
},
|
||||
|
||||
|
||||
//实时数据页面状态值(查看全部设备)
|
||||
getStatePermissionStatus(data) {
|
||||
return sendGetRequest(`/getcontrol/getStatePermissionStatus`, data)
|
||||
},
|
||||
//获取当前权限能看到的设备
|
||||
getPermissionStatus(data) {
|
||||
return sendGetRequest(`/getcontrol/getPermissionStatus`, data)
|
||||
},
|
||||
//根据id删除status设备
|
||||
delPermissionStatus(id1, id2) {
|
||||
return sendPostRequest(`/getcontrol/delPermissionStatus?deviceId=${id1}&permissionid=${id2}`, '')
|
||||
},
|
||||
//根据id添加status设备
|
||||
addPermissionStatus(id1, id2) {
|
||||
return sendPostRequest(`/getcontrol/addStatepermission?deviceId=${id1}&Permissionid=${id2}`, '')
|
||||
},
|
||||
|
||||
//添加短信报警
|
||||
addWarnMessage(data) {
|
||||
return sendPostRequest(`/shortMessage/setMessage`, data)
|
||||
},
|
||||
//短信报警填写条件
|
||||
selnowmes(data) {
|
||||
return sendGetRequest(`/shortMessage/selnowmes`, data)
|
||||
},
|
||||
//根据设备id查看短信报警
|
||||
messageList(data) {
|
||||
return sendGetRequest(`/shortMessage/selMesById`, data)
|
||||
},
|
||||
|
||||
//根据id删除短信报警
|
||||
delMessage(data) {
|
||||
return sendDelRequest(`/shortMessage/delmesbyid`, data)
|
||||
},
|
||||
//控制器新页面接口
|
||||
//目标值 目标温度/湿度/co2
|
||||
targetValue(data) {
|
||||
return sendGetRequest(`/readControl/targetValue`, data)
|
||||
},
|
||||
//电磁阀1
|
||||
solenoidValve1(data) {
|
||||
return sendGetRequest(`/readControl/solenoidValve1`, data)
|
||||
},
|
||||
//电磁阀2
|
||||
solenoidValve2(data) {
|
||||
return sendGetRequest(`/readControl/solenoidValve2`, data)
|
||||
},
|
||||
//电磁阀3
|
||||
solenoidValve3(data) {
|
||||
return sendGetRequest(`/readControl/solenoidValve3`, data)
|
||||
},
|
||||
//电磁阀4
|
||||
solenoidValve4(data) {
|
||||
return sendGetRequest(`/readControl/solenoidValve4`, data)
|
||||
},
|
||||
//电磁阀5
|
||||
solenoidValve5(data) {
|
||||
return sendGetRequest(`/readControl/solenoidValve5`, data)
|
||||
},
|
||||
//电磁阀6
|
||||
solenoidValve6(data) {
|
||||
return sendGetRequest(`/readControl/solenoidValve6`, data)
|
||||
},
|
||||
//电磁阀7
|
||||
solenoidValve7(data) {
|
||||
return sendGetRequest(`/readControl/solenoidValve7`, data)
|
||||
},
|
||||
//电磁阀8
|
||||
solenoidValve8(data) {
|
||||
return sendGetRequest(`/readControl/solenoidValve8`, data)
|
||||
},
|
||||
//强制通道输出
|
||||
forceChannelOutput(data) {
|
||||
return sendGetRequest(`/readControl/forceChannelOutput`, data)
|
||||
},
|
||||
//天窗
|
||||
readskylight(data) {
|
||||
return sendGetRequest(`/readControl/readskylight`, data)
|
||||
},
|
||||
//空调
|
||||
airconditioner(data) {
|
||||
return sendGetRequest(`/readControl/airconditioner`, data)
|
||||
},
|
||||
|
||||
//固有参数
|
||||
intrinsicParameter(data) {
|
||||
return sendGetRequest(`/readControl/intrinsicParameter`, data)
|
||||
},
|
||||
//厂家内部参数
|
||||
manufacturerparameter(data) {
|
||||
return sendGetRequest(`/readControl/manufacturerparameter`, data)
|
||||
},
|
||||
//高压微雾
|
||||
highpressuremist(data) {
|
||||
return sendGetRequest(`/readControl/highpressuremist`, data)
|
||||
},
|
||||
//内遮阳
|
||||
innercurtain(data) {
|
||||
return sendGetRequest(`/readControl/innercurtain`, data)
|
||||
},
|
||||
//外遮阳
|
||||
externalsunshade(data) {
|
||||
return sendGetRequest(`/readControl/externalsunshade`, data)
|
||||
},
|
||||
//风机湿帘
|
||||
fanwetcurtain(data) {
|
||||
return sendGetRequest(`/readControl/fanwetcurtain`, data)
|
||||
},
|
||||
//补光灯
|
||||
readfilllight(data) {
|
||||
return sendGetRequest(`/readControl/readfilllight`, data)
|
||||
},
|
||||
//内保温
|
||||
interiorthermalinsulation(data) {
|
||||
return sendGetRequest(`/readControl/interiorthermalinsulation`, data)
|
||||
},
|
||||
//立面保温
|
||||
facadeinsulation(data) {
|
||||
return sendGetRequest(`/readControl/facadeinsulation`, data)
|
||||
},
|
||||
//环流风扇
|
||||
readcirculationfan(data) {
|
||||
return sendGetRequest(`/readControl/readcirculationfan`, data)
|
||||
},
|
||||
//报警设置
|
||||
readalarmSetting(data) {
|
||||
return sendGetRequest(`/readControl/alarmSetting`, data)
|
||||
},
|
||||
|
||||
//报警设置
|
||||
readalarmSetting(data) {
|
||||
return sendGetRequest(`/readControl/alarmSetting`, data)
|
||||
},
|
||||
//主页查看施肥机历史数据
|
||||
selFsTime(data) {
|
||||
return sendPostRequest(`/selFs/time`, data)
|
||||
},
|
||||
//主页查看施肥机历史数据
|
||||
loadHistorydata(data) {
|
||||
return sendPostRequest(`/load/historydata`, data)
|
||||
},
|
||||
//查看抓取图片历史数据
|
||||
imageReadtoday(data) {
|
||||
return sendPostRequest(`/image/readtoday`, data)
|
||||
},
|
||||
//下载图片
|
||||
imageUploadImage(data) {
|
||||
return sendPostRequest(`/image/uploadImage`, data)
|
||||
},
|
||||
|
||||
//摄像头操作开始
|
||||
cameraStart(cameraSerialNumber,cameraChannelNumber,num) {
|
||||
return sendPostRequest(`/camera/start?cameraid=${cameraSerialNumber}&channelid=${cameraChannelNumber}&direction=${num}`)
|
||||
},
|
||||
//摄像头操作结束
|
||||
cameraStop(cameraSerialNumber,cameraChannelNumber,num) {
|
||||
return sendPostRequest(`/camera/stop?cameraid=${cameraSerialNumber}&channelid=${cameraChannelNumber}&direction=${num}`)
|
||||
},
|
||||
|
||||
|
||||
//管理模块
|
||||
//根据用户ID获取账户设备
|
||||
selUserbyid(data){
|
||||
return sendGetRequest(`/sel/userbyid/`+data, '')
|
||||
},
|
||||
//根据设备ID获取设备状态值
|
||||
selControlPermissions(data){
|
||||
return sendGetRequest(`/getcontrol/selControlPermissions`, data)
|
||||
},
|
||||
//根据设备ID修改设备状态值
|
||||
putpermission(data){
|
||||
return sendPutRequest(`/getcontrol/putpermission`, data)
|
||||
},
|
||||
//根据权限id修改权限显示或者隐藏
|
||||
updatePermissionState(data){
|
||||
return sendPutRequest(`/getcontrol/updatePermissionState`, data)
|
||||
},
|
||||
|
||||
//根据设备ID获取设备控制值
|
||||
selpermission(data){
|
||||
return sendGetRequest(`/getcontrol/selpermission`, data)
|
||||
},
|
||||
//根据设备ID修改设备控制值
|
||||
putControlpermission(data){
|
||||
return sendPutRequest(`/getcontrol/putControlpermission`, data)
|
||||
},
|
||||
//根据ID修改施肥机数据
|
||||
updatedevice(data){
|
||||
return sendPutRequest(`/device/updatedevice`, data)
|
||||
},
|
||||
|
||||
//根据ID修改施肥机名字
|
||||
updateFsname(data){
|
||||
return sendPutRequest(`/update/fsname`, data)
|
||||
},
|
||||
//根据用户ID添加小程序气象站
|
||||
addphoneeqData(data) {
|
||||
return sendPostRequest(`/getcontrol/addphoneeqData`, data)
|
||||
},
|
||||
//根据用户ID删除小程序气象站
|
||||
delphoneeqData(data) {
|
||||
return sendDelRequest(`/getcontrol/delphoneeqData`, data)
|
||||
},
|
||||
|
||||
//根据用户ID修改小程序气象站
|
||||
updatephoneeqData(data) {
|
||||
return sendPutRequest(`/getcontrol/updatephoneeqData`, data)
|
||||
},
|
||||
//修改大数据信息
|
||||
updateDataDevice(data) {
|
||||
return sendPutRequest(`/getcontrol/updateBigData`, data)
|
||||
},
|
||||
|
||||
//小程序手机控制权限模块查询
|
||||
wxgetpermission(data) {
|
||||
return sendGetRequest(`/getcontrol/wxgetpermission`, data)
|
||||
},
|
||||
//查询所有用户
|
||||
adminAll(data){
|
||||
return sendGetRequest(`/admin/all`, data)
|
||||
},
|
||||
//更新用户信息
|
||||
updateUser(data){
|
||||
return sendPutRequest(`/admin/add/userEquipment`, data)
|
||||
},
|
||||
//添加用户信息
|
||||
addUser(data){
|
||||
return sendPostRequest(`/admin/user`, data)
|
||||
},
|
||||
|
||||
//修改密码
|
||||
updatePwd(data){
|
||||
return sendPutRequest(`/user/update/pwd`, data)
|
||||
},
|
||||
//设备查询
|
||||
seldevice(data){
|
||||
return sendGetRequest(`/admin/seldevice`, data)
|
||||
},
|
||||
//删除设备信息
|
||||
deldevice(data){
|
||||
return sendDelRequest(`/admin/deldevice`, data)
|
||||
},
|
||||
//修改手机控制名称
|
||||
updatewxgetpermission(data){
|
||||
return sendPutRequest(`/getcontrol/updatewxgetpermission`, data)
|
||||
},
|
||||
//管理员/用户页面删除关联设备信息
|
||||
delUserByid(data){
|
||||
return sendDelRequest(`/admin/delUserByid`, data)
|
||||
},
|
||||
//管理员/用户页面添加关联设备信息
|
||||
addUserByid(data){
|
||||
return sendPostRequest(`/admin/addUserByid`, data)
|
||||
},
|
||||
//查询控制器权限
|
||||
selectallPermissions(data){
|
||||
return sendGetRequest(`/getcontrol/selectallPermissions`, data)
|
||||
},
|
||||
//新增标准控制器权限
|
||||
addpermissionall(equipmentId, data) {
|
||||
return sendPostRequest(`/getcontrol/addpermissionall?deviceId=${equipmentId}`, data)
|
||||
},
|
||||
//管理控制器权限删除
|
||||
delpermission(id1, id2) {
|
||||
return sendDelRequest(`/getcontrol/delpermission?deviceId=${id1}&permissionid=${id2}`, '')
|
||||
},
|
||||
//管理控制器权限添加
|
||||
addpermission(id1, id2) {
|
||||
return sendPostRequest(`/getcontrol/addpermission?deviceId=${id1}&permissionid=${id2}`, '')
|
||||
},
|
||||
//管理 设备管理添加设备
|
||||
addDevice(data){
|
||||
return sendPostRequest(`/admin/addDevice`, data)
|
||||
},
|
||||
//查询施肥级ICCID
|
||||
getFsIccid(data){
|
||||
return sendGetRequest(`/readControl/getFsIccid`, data)
|
||||
},
|
||||
//查询控制器权限
|
||||
getIccid(data){
|
||||
return sendGetRequest(`/readControl/getIccid`, data)
|
||||
},
|
||||
//二维码溯源
|
||||
//查看农事作物信息
|
||||
getAgriculturalInformation(data) {
|
||||
return sendGetRequest(`/code/getAgriculturalInformation`, data)
|
||||
},
|
||||
//查看种植计划
|
||||
getplant(data) {
|
||||
return sendGetRequest(`/code/getplant`, data)
|
||||
},
|
||||
//查看农场信息管理
|
||||
getcodeFarmInformationManagement(data) {
|
||||
return sendGetRequest(`/code/getcodeFarmInformationManagement`, data)
|
||||
},
|
||||
|
||||
//上传图片
|
||||
uploadImage(data) {
|
||||
return sendPostRequest(`/code/uploadImage`, data)
|
||||
},
|
||||
//管理页面上传图片
|
||||
manageUploadImage(data) {
|
||||
return sendUploadRequest(`/user/upload`, data)
|
||||
},
|
||||
//施肥机系统导入txt的
|
||||
upLoadFsdataWriteValue(data) {
|
||||
return sendUploadRequest(`/Fsdata/write/value`, data)
|
||||
},
|
||||
//施肥机系统下载txt
|
||||
FsdataReadValuedownload(data) {
|
||||
return sendPostRequest(`/Fsdata/read/value?devicecode=${data}`,'')
|
||||
},
|
||||
//控制器系统导入
|
||||
upLoadControlWriteValue(data) {
|
||||
return sendUploadRequest(`/control/write/value`, data)
|
||||
},
|
||||
//控制器系统下载txt
|
||||
controlReadValuedownload(data) {
|
||||
return sendPostRequest(`/control/read/value?devicecode=${data}`,'')
|
||||
},
|
||||
|
||||
// 智能灌注
|
||||
//主页查看智能灌溉控制器
|
||||
getFi_rtdata(data) {
|
||||
return sendGetRequest(`/getFi/rtdata`, data)
|
||||
},
|
||||
//当天折线图
|
||||
chart_fidata(data) {
|
||||
return sendPostRequest(`/chart/fidata?equipmentId=${data}`,'')
|
||||
},
|
||||
//智能灌溉1
|
||||
readFi_irrigate(url,data) {
|
||||
return sendGetRequest(url, data)
|
||||
},
|
||||
//智能灌溉写入
|
||||
postwriteFi_write(data) {
|
||||
return sendPostRequest("/writeFi/write", data);
|
||||
},
|
||||
//智能灌溉状态值
|
||||
getFI_getState(data) {
|
||||
return sendGetRequest("/getFI/getState", data);
|
||||
},
|
||||
|
||||
//智能灌溉系统参数
|
||||
readControl_getFIIccid(data) {
|
||||
return sendGetRequest("/readControl/getFIIccid", data);
|
||||
},
|
||||
|
||||
//智能灌溉系统导入txt的
|
||||
upLoadFIwritevalue(data) {
|
||||
return sendUploadRequest(`/FI/write/value`, data)
|
||||
},
|
||||
//智能灌溉系统导出下载txt
|
||||
FIreadvaluedownload(data) {
|
||||
return sendPostRequest(`/FI/read/value?devicecode=${data}`,'')
|
||||
},
|
||||
//智能灌溉系统数据上传
|
||||
readFi_datauploadfi(data) {
|
||||
return sendGetRequest("/readFi/datauploadfi", data);
|
||||
},
|
||||
//智能灌溉固有参数
|
||||
readFi_intrinsicparameterfi(data) {
|
||||
return sendGetRequest("/readFi/intrinsicparameterfi", data);
|
||||
},
|
||||
//智能灌溉传感器通道
|
||||
readFi_sensorchannelfi(data) {
|
||||
return sendGetRequest("/readFi/sensorchannelfi", data);
|
||||
},
|
||||
//智能灌溉的名称
|
||||
getFi_getName(data) {
|
||||
return sendGetRequest("/getFi/getName", data);
|
||||
},
|
||||
//修改智能灌溉名称
|
||||
getFi_updateName(data){
|
||||
return sendPutRequest(`/getFi/updateName`, data)
|
||||
},
|
||||
//系统页面备忘录获取
|
||||
readControl_getMemo(data){
|
||||
return sendGetRequest(`/readControl/getMemo`, data)
|
||||
},
|
||||
//系统页面备忘录修改
|
||||
readControl_setMemo(data){
|
||||
return sendPostRequest(`/readControl/setMemo`, data)
|
||||
},
|
||||
//根据设备id查询控制器权限
|
||||
getcontrol_cpermission(data){
|
||||
return sendPostRequest(`/getcontrol/cpermission?deviceId=${data}`, '')
|
||||
},
|
||||
|
||||
|
||||
|
||||
//二维码溯源部分
|
||||
//种植计划
|
||||
code_getplant(data){
|
||||
return sendGetRequest(`/code/getplant`, data)
|
||||
},
|
||||
};
|
|
@ -0,0 +1,45 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
// $.ajax({
|
||||
// url: 'https://api.lihe-control.com/sel/eqbyid/1', // 请求地址
|
||||
// type: 'get', // 请求方式
|
||||
// data: '', //携带到后端的参数
|
||||
// contentType: 'application/x-www-form-urlencoded', // 传参格式(默认为表单) json为application/json
|
||||
// dataType: 'json', //期望后端返回的数据类型
|
||||
// success: function (res) {
|
||||
// console.log('res', res);
|
||||
// }, // 成功的回调函数 res就是后端响应回来的数据
|
||||
// error: function(err) {
|
||||
// console.log('err', err);
|
||||
// } // 失败的回调函数
|
||||
// })
|
||||
|
||||
var xhr = new XMLHttpRequest(); // IE8/9需用window.XDomainRequest兼容
|
||||
|
||||
// 前端设置是否带cookie
|
||||
xhr.withCredentials = true;
|
||||
|
||||
xhr.open('get', 'https://api.lihe-control.com/sel/eqbyid/1', true);
|
||||
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
|
||||
xhr.setRequestHeader('token','eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI4NzRmMmRhNTI3NTU0MDAwYjYxODg0OWUzM2Y1ZGI1YyIsInN1YiI6IjEiLCJpc3MiOiJsaCIsImlhdCI6MTY5NTQzODA3NSwiZXhwIjoxNjk1NDc0MDc1fQ.GeGOTtdr6DAsXl-6bqXATenYrcWKc18hRgmiWFgP2QI')
|
||||
xhr.setRequestHeader("Access-Control-Allow-Methods", "GET, PUT, OPTIONS, POST");
|
||||
xhr.send();
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState == 4 && xhr.status == 200) {
|
||||
console.log(xhr);
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 134 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 616 KiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 9.4 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 275 B |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 1.9 MiB |
After Width: | Height: | Size: 1002 B |
After Width: | Height: | Size: 661 B |
After Width: | Height: | Size: 793 B |
After Width: | Height: | Size: 621 B |
After Width: | Height: | Size: 752 B |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 739 B |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 1023 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 411 B |
After Width: | Height: | Size: 182 B |
After Width: | Height: | Size: 484 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 9.9 KiB |
After Width: | Height: | Size: 738 B |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 594 B |
After Width: | Height: | Size: 702 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 664 B |
After Width: | Height: | Size: 229 B |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 16 KiB |