lj 5 years ago
parent
commit
df0c6e18f9
8 changed files with 144 additions and 307 deletions
  1. 3 3
      config/index.js
  2. BIN
      dist_mq.zip
  3. 34 25
      src/components/Index.vue
  4. 86 256
      src/components/UserManger.vue
  5. 5 5
      src/main.js
  6. 2 2
      src/pages/EquipList.vue
  7. 9 11
      src/pages/Monitor.vue
  8. 5 5
      src/router/index.js

+ 3 - 3
config/index.js

@@ -12,8 +12,8 @@ module.exports = {
     assetsPublicPath: '/',
     proxyTable: {
       '/api': {
-        // target: 'http://192.168.1.8:8000/',
-        target: 'http://192.168.1.4:8000/',//杨
+        target: 'http://192.168.1.8:8000/',
+        // target: 'http://192.168.1.4:8000/',//杨
         changeOrigin: true,
         pathRewrite: {
           '^/api': '' //重写接口
@@ -22,7 +22,7 @@ module.exports = {
     },
 
     // Various Dev Server settings
-    host: '192.168.1.7', // can be overwritten by process.env.HOST
+    host: '192.168.1.6', // can be overwritten by process.env.HOST
     port: 8000, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: false,
     errorOverlay: true,

BIN
dist_mq.zip


+ 34 - 25
src/components/Index.vue

@@ -1,28 +1,36 @@
 <template>
   <el-container style="height: 100%">
     <el-header class="header" v-show="flag">
-      <div class="logInfo">
-        <img :src="'api' + logo" alt="" />
-        <h3>{{ header }}</h3>
+      <div v-if="userinfo.logo">
+        <img
+          :src="userinfo.logo"
+          alt=""
+          style="position: absolute; left: 20px; top: 20px; width: 136px"
+        />
       </div>
       <!-- 用户 -->
       <div class="userinfo">
-        <img :src="userphoto" class="userheadImg" alt="" />{{ username }}
+        欢迎您,{{ username }}
       </div>
       <!-- 标题 -->
       <div class="sysName">
         <h2 v-if="userinfo.user_header">{{ userinfo.user_header }}</h2>
-        <h2 v-else>苗情监测应用系统 实时监测作物生长状态</h2>
-        <p>
-          The application system of seedling condition monitoring monitors the
-          crop growth status in real time
-        </p>
+        <h2 v-else>苗情监测应用系统</h2>
+        <p>Plants Growth Status Monitoring System</p>
+      </div>
+      <div class="site" v-if="userinfo.site">
+        <i class="iconfont icon-jidi"></i>
+        <span>{{ userinfo.site }}</span>
       </div>
       <span class="header_btn" @click="hCheckFun">[隐藏]</span>
     </el-header>
     <el-header class="header2" v-show="!flag">
       <h3 v-if="userinfo.user_header">{{ userinfo.user_header }}</h3>
       <h3 v-else>苗情监测应用系统</h3>
+      <div class="site" v-if="userinfo.site">
+        <i class="iconfont icon-jidi"></i>
+        <span>{{ userinfo.site }}</span>
+      </div>
       <span class="header_btn" @click="hCheckFun">[展开]</span>
     </el-header>
     <el-container style="overflow: auto">
@@ -36,7 +44,7 @@
         >
           <el-menu-item index="/index/monitor">
             <i :class="iconObj[20]"></i>
-            <span slot="title">苗情应用系统</span>
+            <span slot="title">苗情监测应用系统</span>
           </el-menu-item>
           <el-menu-item index="/index/list">
             <i :class="iconObj[22]"></i>
@@ -65,8 +73,6 @@ export default {
         23: "iconfont icon-xitong",
       },
       flag: true,
-      header: "",
-      logo: "",
       active: 1,
       userinfo: {},
       username: "",
@@ -74,26 +80,16 @@ export default {
     };
   },
   created: function () {
-    this.getUserInfo();
     this.getuserinfo();
   },
   methods: {
-    getUserInfo() {
-      this.$axios({
-        method: "POST",
-        url: "/api/logoheader",
-      }).then((res) => {
-        this.header = res.data.header;
-        this.logo = res.data.logo;
-      });
-    },
     hCheckFun() {
       this.flag = !this.flag;
     },
     getuserinfo() {
       this.$axios({
         method: "post",
-        url: "/api/userinfo_",
+        url: "userinfo_",
       }).then((res) => {
         this.username = res.data.username;
         this.userphoto = res.data.userphoto;
@@ -101,7 +97,7 @@ export default {
       });
       this.$axios({
         method: "get",
-        url: "/api/user_detail",
+        url: "user_detail",
       }).then((res) => {
         this.userinfo = res.data;
         localStorage.setItem("have_type", this.userinfo.have_type); // 0管理员  1用户
@@ -140,7 +136,7 @@ export default {
       color: #295206;
       font-weight: 800;
       text-shadow: #fff 1px 0 0, #fff 0 1px 0, #fff -1px 0 0, #fff 0 -1px 0;
-      font-size: 20px;
+      font-size: 26px;
     }
     p {
       color: #295206;
@@ -174,6 +170,19 @@ export default {
   background-color: #397b0c;
   color: #fff;
 }
+.site {
+  position: absolute;
+  right: 90px;
+  bottom: 10px;
+  z-index: 888;
+  font-size: 14px;
+  color: #ffffff;
+  span {
+    color: #fff;
+    letter-spacing: 1px;
+    font-size: 13px;
+  }
+}
 .header_btn {
   position: absolute;
   color: #999;

+ 86 - 256
src/components/UserManger.vue

@@ -12,7 +12,10 @@
           <i slot="suffix" class="el-input__icon el-icon-search"></i>
         </el-input>
       </div>
-      <el-button v-if="have_type == 0 || staff == 1" type="success" size="mini"
+      <el-button
+        v-if="have_type == 0 || staff == 1 || have_type == 2"
+        type="success"
+        size="mini"
         ><a style="color: #fff" href="systemmanage_user_add"
           >添加新用户</a
         ></el-button
@@ -36,17 +39,22 @@
           <div class="detail">
             <p>
               模块类型
-              <span v-if="item.user_type == '1'">农林植保平台</span>
-              <span v-if="item.user_type == '2'">环境监测平台</span>
-              <span v-if="item.user_type == '3'">气象预警平台</span>
-              <span v-if="item.user_type == '4'">溯源平台</span>
-              <span v-if="item.user_type == '5'">可视农业</span>
-              <span v-if="item.user_type == '6'">监测平台</span>
+              <span v-if="item.user_type == '1'">农业植保监测系统</span>
+              <span v-if="item.user_type == '2'">农业气象监测系统</span>
+              <span v-if="item.user_type == '3'">环境灾害预警系统</span>
+              <span v-if="item.user_type == '4'">农产品溯源系统</span>
+              <span v-if="item.user_type == '5'">可视农业应用系统</span>
+              <span v-if="item.user_type == '6'">苗情监测应用系统</span>
             </p>
             <p>
               用户类型
               <span v-if="item.user_have_type == '1'">普通用户</span>
-              <span v-if="item.user_have_type == '0'">管理员</span>
+              <span v-if="item.user_have_type == '0'">模块管理员</span>
+              <span v-if="item.user_have_type == '2'">项目管理员</span>
+            </p>
+            <p>
+              适配用户
+              <span>{{ item.user_have || "无" }}</span>
             </p>
             <p>
               站点名称
@@ -60,7 +68,7 @@
               >
             </p>
             <p>
-              标题
+              系统标题
               <span>{{ item.user_header || "--" }}</span>
             </p>
             <p>
@@ -71,21 +79,36 @@
             </p>
           </div>
           <div class="btn">
-            <el-button type="success" @click="edit(item)" plain
+            <el-button size="small" type="success" @click="edit(item)" plain
               >用户编辑</el-button
             >
+            <template
+              v-if="(have_type == 0 || staff == 1 || have_type == 2) && (currusername != item.username)"
+            >
+              <el-button
+                size="small"
+                v-if="item.user_have_type == '1' || item.user_have_type == '2'"
+                type="success"
+                @click="allotEquip(item.id, item.username)"
+                plain
+                >分配设备</el-button
+              >
+              <el-button
+                size="small"
+                v-if="item.user_have_type == '1' || item.user_have_type == '2'"
+                type="success"
+                @click="delUser(item.id, item.username)"
+                plain
+                >删除用户</el-button
+              >
+            </template>
             <el-button
+              size="small"
               type="success"
               @click="resetPassword(item.id, item.username)"
               plain
               >重置密码</el-button
             >
-            <!-- <a @click="edit(item)">
-							<i class="iconfont icon-iconfontedit"></i>编辑
-						</a>
-						<a @click="resetPassword(item.uid, item.username)">
-							<i class="iconfont icon-mima"></i>密码
-						</a> -->
           </div>
         </el-card>
       </el-col>
@@ -127,9 +150,6 @@
             v-model="resetPassForm.username"
           ></el-input>
         </el-form-item>
-        <el-form-item v-if="userType != 1" label="原始密码 : " prop="oldPass">
-          <el-input type="password" v-model="resetPassForm.oldPass"></el-input>
-        </el-form-item>
         <el-form-item label="新密码 : " prop="pass">
           <el-input type="password" v-model="resetPassForm.pass"></el-input>
         </el-form-item>
@@ -157,7 +177,7 @@
         <el-form-item label="用户名 : ">
           <el-input v-model="editUserForm.username" disabled></el-input>
         </el-form-item>
-        <el-form-item label="标题 : ">
+        <el-form-item label="系统标题 : ">
           <el-input
             maxlength="11"
             v-model="editUserForm.user_header"
@@ -170,6 +190,7 @@
             :auto-upload="false"
             :show-file-list="false"
             :on-change="changeUpload"
+            :before-upload="beforeAvatarUpload"
           >
             <img
               v-if="editUserForm.logo"
@@ -201,27 +222,6 @@
         <el-button type="primary" @click="editUserSubm">确认</el-button>
       </span>
     </el-dialog>
-    <!-- vueCropper 剪裁图片实现-->
-    <el-dialog title="图片剪裁" :visible.sync="cropperVisible" append-to-body>
-      <div class="cropper-content">
-        <div style="width: 100%; height: 500px">
-          <vueCropper
-            ref="cropper"
-            :img="photo.img"
-            autoCrop
-            centerBox
-            fixed
-            :fixedNumber="photo.fixedNumber"
-            :outputSize="photo.size"
-            :outputType="photo.outputType"
-          ></vueCropper>
-        </div>
-      </div>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="cropperVisible = false">取 消</el-button>
-        <el-button type="primary" @click="finish">确认</el-button>
-      </div>
-    </el-dialog>
   </div>
 </template>
 
@@ -275,7 +275,6 @@ export default {
       resetPassForm: {
         username: "",
         uid: "",
-        oldPass: "",
         pass: "",
         checkPass: "",
       },
@@ -290,26 +289,6 @@ export default {
         cs_user: false, //1为普通用户
         user_group_id: "", //用户组id
       },
-      cropperVisible: false,
-      // 裁剪组件的基础配置option
-      photo: {
-        img: "", // 裁剪图片的地址
-        info: true, // 裁剪框的大小信息
-        outputSize: 0.8, // 裁剪生成图片的质量
-        outputType: "jpeg", // 裁剪生成图片的格式
-        // canScale: false, // 图片是否允许滚轮缩放
-        // autoCrop: true, // 是否默认生成截图框
-        // autoCropWidth: 300, // 默认生成截图框宽度
-        // autoCropHeight: 200, // 默认生成截图框高度
-        // fixedBox: true, // 固定截图框大小 不允许改变
-        fixed: true, // 是否开启截图框宽高固定比例
-        fixedNumber: [230, 165], // 截图框的宽高比例
-        full: true, // 是否输出原图比例的截图
-        canMoveBox: false, // 截图框能否拖动
-        original: false, // 上传图片按照原始比例渲染
-        centerBox: false, // 截图框是否被限制在图片里面
-        infoTrue: true, // true 为展示真实输出图片宽高 false 展示看到的截图框宽高
-      },
       cityData,
       cityValue: [],
       props: {
@@ -332,7 +311,6 @@ export default {
       },
       //重置密码格规则
       resetPassFormRules: {
-        oldPass: [{ required: true, message: "请填原始密码", trigger: "blur" }],
         pass: [
           { validator: validatePass, trigger: "blur" },
           { required: true, message: "请填写新密码", trigger: "blur" },
@@ -344,6 +322,7 @@ export default {
       },
       have_type: "",
       staff: "",
+      currusername:''
     };
   },
   computed: {
@@ -357,70 +336,24 @@ export default {
     this.getList();
     this.have_type = localStorage.getItem("have_type"); // 0管理员  1用户
     this.staff = localStorage.getItem("staff"); // 1是admin
+    this.currusername = localStorage.getItem("username"); // 1是admin
   },
   methods: {
     getList() {
       this.$axios({
         method: "POST",
-        url: "/api/user_list",
+        url: "user_list",
         data: this.qs.stringify({
           typelist: 6,
           page: this.page,
           uname: this.username,
+          page_size: 8,
         }),
       }).then((res) => {
         this.userList = res.data.userlist;
         this.totalNum = res.data.nums;
       });
     },
-    getUserGroup() {
-      this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=pest.warning_record.rolemanage_view",
-        data: this.qs.stringify({
-          add_role: "all",
-        }),
-      }).then((res) => {
-        if (res.data.message == "") {
-          this.userGroupList = res.data.data.data;
-        }
-      });
-    },
-    recharge(id) {
-      this.$confirm("是否向该用户充值一年费用?", "信息", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.$axios({
-            method: "POST",
-            url: "/api/api_gateway?method=user.login.user_add_package_time",
-            data: this.qs.stringify({
-              uid: id,
-            }),
-          }).then((res) => {
-            if (res.data.message == "") {
-              this.$message({
-                type: "success",
-                message: "充值成功!",
-              });
-              this.getList();
-            } else {
-              this.$message({
-                type: "error",
-                message: "充值失败!",
-              });
-            }
-          });
-        })
-        .catch(() => {
-          this.$message({
-            type: "info",
-            message: "充值取消!",
-          });
-        });
-    },
     // 编辑用户信息
     edit(role) {
       this.editUserForm = JSON.parse(JSON.stringify(role));
@@ -431,43 +364,29 @@ export default {
         this.editUserForm.user_area,
       ];
     },
-    // 上传按钮   限制图片大小
-    changeUpload(file, fileList) {
-      const isLt4M = file.size / 1024 / 1024 < 4;
-      if (!isLt4M) {
-        this.$message.error("上传文件大小不能超过 4MB!");
-        return false;
+    beforeAvatarUpload(file) {
+      console.log(file);
+      const isJPG = file.type === "image/jpeg" || file.type === "image/png";
+      const isLt2M = file.size / 1024 / 1024 < 2;
+      if (!isJPG) {
+        this.$message.error("上传头像图片只能是 JPG 和 PNG格式!");
       }
-      // 上传成功后将图片地址赋值给裁剪框显示图片
-      this.$nextTick(() => {
-        this.photo.img = URL.createObjectURL(file.raw);
-        this.cropperVisible = true;
-      });
+      if (!isLt2M) {
+        this.$message.error("上传头像图片大小不能超过 2MB!");
+      }
+      return isJPG && isLt2M;
     },
-    // 点击裁剪,这一步是可以拿到处理后的地址
-    finish() {
-      // 获取截图的base64 数据
-      this.$refs.cropper.getCropBlob((data) => {
-        var form = new FormData();
-        let resFile = this.blobToFile(data, "filename.jpg");
-        form.append("img_file", resFile);
-
-        this.cropperVisible = false;
-        this.$axios({
-          method: "POST",
-          url: "/api/base_photo",
-          data: form,
-        }).then((res) => {
-          this.editUserForm.logo = res.data.src;
-        });
+    changeUpload(file, fileList) {
+      var form = new FormData();
+      form.append("img_file", file.raw);
+      this.$axios({
+        method: "POST",
+        url: "base_photo",
+        data: form,
+      }).then((res) => {
+        this.editUserForm.logo = res.data.src;
       });
     },
-    //转成file
-    blobToFile(Blob, fileName) {
-      Blob.lastModifiedDate = new Date();
-      Blob.name = fileName;
-      return Blob;
-    },
     handleChange(value) {
       console.log(value);
       console.log(this.cityValue);
@@ -483,50 +402,13 @@ export default {
         this.editUserForm.user_area = value[1];
       }
     },
-    login(uid, username) {
-      //一键登录
-      this.$confirm("一键登录将登录此用户,是否继续?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-          this.$axios({
-            method: "POST",
-            url: "/api/api_gateway?method=user.login.auto_login",
-            data: this.qs.stringify({
-              uid,
-            }),
-          }).then((res) => {
-            if (res.data.message == "") {
-              this.$message({
-                type: "success",
-                message: "操作成功!",
-              });
-              localStorage.setItem("username", username); //修改当前登录的用户名
-              this.reload(); //整体刷新
-              this.$EventBus.$on("firstPage", (data) => {
-                //默认显示菜单第一项
-                this.$router.push(`${data}`);
-              });
-            } else {
-              this.$message({
-                type: "warning",
-                message: res.data.message,
-              });
-            }
-          });
-        })
-        .catch(() => {
-          this.$message({
-            type: "info",
-            message: "取消一键登录!",
-          });
-        });
+    // 分配设备
+    allotEquip(id, name) {
+      window.location.href = "allot?uname=" + name;
     },
-    //用户禁用
-    forbidUse(id, state, txt) {
-      this.$confirm(txt, "提示", {
+    // 删除普通用户
+    delUser(id, name) {
+      this.$confirm("删除用户, 是否继续?", "警告", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
@@ -534,25 +416,25 @@ export default {
         .then(() => {
           this.$axios({
             method: "POST",
-            url: "/api/api_gateway?method=user.login.users_statu_updata",
+            url: "del_user",
             data: this.qs.stringify({
-              uid: id,
-              state: state,
+              userid: id,
             }),
           }).then((res) => {
-            if (res.data.message == "") {
+            if (res.data == 1) {
+              this.getList();
+            } else {
               this.$message({
-                type: "success",
-                message: "操作成功!",
+                type: "error",
+                message: res.data,
               });
-              this.getList();
             }
           });
         })
         .catch(() => {
           this.$message({
             type: "info",
-            message: "禁用取消!",
+            message: "已取消删除",
           });
         });
     },
@@ -568,7 +450,7 @@ export default {
         if (!valid) return;
         this.$axios({
           method: "POST",
-          url: "/api/systemmanage_user_list",
+          url: "systemmanage_user_list",
           data: this.qs.stringify({
             id: this.resetPassForm.id,
             req: "resetpwd",
@@ -598,41 +480,7 @@ export default {
     addUser() {
       this.addUserDialogVisible = true;
     },
-    //监听用户类型改变
-    userTypeChange(val) {
-      if (val == 3) {
-        this.editIsShow = true;
-      } else {
-        this.editIsShow = false;
-      }
-    },
-    //监听省/市/区
-    pcdChange(val) {
-      let addr_type = "";
-      switch (val) {
-        case "1":
-          addr_type = "province";
-          break;
-        case "2":
-          addr_type = "city";
-          break;
-        case "3":
-          addr_type = "district";
-          break;
-      }
-      this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=device.device_manage.device_addr",
-        data: this.qs.stringify({
-          addr_type,
-        }),
-      }).then((res) => {
-        if (res.data.message == "") {
-          this.areaList = res.data.data;
-          this.editUserForm.user_area = "";
-        }
-      });
-    },
+
     //添加用户提交
     addUserSubm() {
       this.$refs.addUserFormRef.validate((valid) => {
@@ -640,7 +488,7 @@ export default {
         let cs_user = this.addUserForm.cs_user ? "1" : "";
         this.$axios({
           method: "POST",
-          url: "/api/api_gateway?method=user.login.regiest",
+          url: "api_gateway?method=user.login.regiest",
           data: this.qs.stringify({
             username: this.addUserForm.username,
             mobile: this.addUserForm.mobile,
@@ -672,7 +520,7 @@ export default {
         if (!valid) return;
         this.$axios({
           method: "POST",
-          url: "/api/user_detail",
+          url: "user_detail",
           data: this.qs.stringify(this.editUserForm),
         }).then((res) => {
           if (res.data == 1) {
@@ -697,24 +545,6 @@ export default {
       this.getList();
     },
   },
-  filters: {
-    formatUserType(value) {
-      switch (value) {
-        case 1:
-          return "超级管理员";
-          break;
-        case 2:
-          return "经销商";
-          break;
-        case 3:
-          return "农林政府单位";
-          break;
-        case 4:
-          return "普通用户";
-          break;
-      }
-    },
-  },
 };
 </script>
 
@@ -764,12 +594,12 @@ export default {
     justify-content: space-around;
     button {
       // flex: 1;
-      margin: 0 8px;
+      // margin: 0 8px;
       border: 1px solid #17bb89;
       color: #17bb89;
-      // border-radius: 4px;
-      // font-size: 12px;
-      // padding: 5px 5px;
+      // // border-radius: 4px;
+      // // font-size: 12px;
+      // // padding: 5px 5px;
       background: #fff;
       cursor: pointer;
       i {

+ 5 - 5
src/main.js

@@ -17,11 +17,11 @@ Vue.prototype.qs = qs //全局注册,使用方法为:this.qs
 //导入全局样式
 import './assets/css/global.css'
 
-// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
-// axios.defaults.timeout = 30000;
-// axios.defaults.baseURL = 'http://39.106.113.84:8000/' //线下杨明明
-// axios.defaults.withCredentials = true //axios请求时携带session
-// axios.defaults.crossDomain = true 
+axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
+axios.defaults.timeout = 30000;
+axios.defaults.baseURL = 'http://39.106.113.84:8000/' //线下杨明明
+axios.defaults.withCredentials = true //axios请求时携带session
+axios.defaults.crossDomain = true 
 
 
 Vue.config.productionTip = false

+ 2 - 2
src/pages/EquipList.vue

@@ -91,7 +91,7 @@ export default {
     getList() {
       this.$axios({
         method: "POST",
-        url: "/api/list_camera",
+        url: "list_camera",
         data: this.qs.stringify({
           f_id: this.queryInfo.f_id,
           page: this.queryInfo.page,
@@ -120,7 +120,7 @@ export default {
           if (value) {
             this.$axios({
               method: "POST",
-              url: "/api/equiplist",
+              url: "equiplist",
               data: this.qs.stringify({
                 req: "rename",
                 eid: id,

+ 9 - 11
src/pages/Monitor.vue

@@ -334,8 +334,6 @@ export default {
       //设备名字
       if (value.device_name) {
         return `${value.device_name}-${value.jktype}`;
-      } else {
-        return `${value.device_id}-${value.jktype}`;
       }
     },
   },
@@ -347,7 +345,7 @@ export default {
     getJkList() {
       this.$axios({
         method: "POST",
-        url: "/api/list_camera",
+        url: "list_camera",
         data: this.qs.stringify({ page: this.currPage, equip_type: 1 }),
       }).then((res) => {
         this.Idlist = res.data.data;
@@ -358,7 +356,7 @@ export default {
     getJkList2() {
       this.$axios({
         method: "POST",
-        url: "/api/list_camera",
+        url: "list_camera",
         data: this.qs.stringify({ page: this.currPage }),
       }).then((res) => {
         this.Idlist = res.data.data;
@@ -385,7 +383,7 @@ export default {
         if (ctrl == "takephoto") {
           this.$axios({
             method: "POST",
-            url: "/api/camera_takephoto",
+            url: "camera_takephoto",
             data: this.qs.stringify({
               device_id: id,
               ctrl: ctrl,
@@ -403,7 +401,7 @@ export default {
           //上下左右、放大、缩小
           this.$axios({
             method: "POST",
-            url: "/api/ctrl_camera",
+            url: "ctrl_camera",
             data: this.qs.stringify({
               device_id: id,
               ctrl: ctrl,
@@ -426,7 +424,7 @@ export default {
       if (id != "") {
         this.$axios({
           method: "POST",
-          url: "/api/ctrl_camera",
+          url: "ctrl_camera",
           data: this.qs.stringify({
             device_id: id,
             ctrl: "stop",
@@ -445,7 +443,7 @@ export default {
           console.log(item);
           //避免右侧监控数量少于divNum
           this.$axios({
-            url: "/api/addr_camera",
+            url: "addr_camera",
             method: "POST",
             data: this.qs.stringify({
               device_id: this.Idlist[item - 1].device_id,
@@ -485,7 +483,7 @@ export default {
         this.videotape = videotape;
         console.log(this.divName);
         this.$axios({
-          url: "/api/addr_camera",
+          url: "addr_camera",
           method: "POST",
           data: this.qs.stringify({ device_id: device_id, jk_type: jktype }),
         }).then((res) => {
@@ -589,7 +587,7 @@ export default {
           checked(end.getSeconds());
         this.$axios({
           method: "POST",
-          url: "/api/nvr_view",
+          url: "nvr_view",
           data: this.qs.stringify({
             e_id: this.id,
           }),
@@ -624,7 +622,7 @@ export default {
         }
         this.$axios({
           method: "POST",
-          url: "/api/add_camera",
+          url: "add_camera",
           data: this.qs.stringify(this.addEquipForm),
         }).then((res) => {
           if (res.data == 1) {

+ 5 - 5
src/router/index.js

@@ -1,6 +1,6 @@
 import Vue from 'vue'
 import Router from 'vue-router'
-const Login = () => import('@/components/Login')
+// const Login = () => import('@/components/Login')
 const Index = () => import('@/components/Index')
 const Monitor = () => import('@/pages/Monitor')
 const EquipList = () => import('@/pages/EquipList')
@@ -12,10 +12,10 @@ export default new Router({
       path: '',
       redirect: '/index/monitor'
     },
-    {
-      path: '/login',
-      component: Login
-    },
+    // {
+    //   path: '/login',
+    //   component: Login
+    // },
     {
       path: '/index',
       component: Index,