main
zhangqun 2 years ago
parent 56756773f1
commit 364eaea1f9
  1. 1
      src/router/axios.js
  2. 19
      src/util/dispatch.js
  3. 5
      src/views/dispatch/index.vue
  4. 2
      vue.config.js

@ -35,6 +35,7 @@ axios.interceptors.request.use(config => {
//开启 progress bar //开启 progress bar
NProgress.start(); NProgress.start();
//地址为已经配置状态则不添加前缀 //地址为已经配置状态则不添加前缀
console.log(config)
if (!isURL(config.url) && !config.url.startsWith(baseUrl)) { if (!isURL(config.url) && !config.url.startsWith(baseUrl)) {
config.url = baseUrl + config.url config.url = baseUrl + config.url
} }

@ -65,12 +65,12 @@ client.serverConnectStateChanged.on((state) => {
}); });
export function regist() { export function regist() {
var ip = "http://192.168.1.134";//$("txtServerIP").value; var ip = "192.168.1.134";//$("txtServerIP").value;
var port = "8081";////$("txtServerPort").value; var port = "7443";////$("txtServerPort").value;
var businesPort = $("txtbusinesPort").value; var businesPort = '60002';//$("txtbusinesPort").value;
var userName = $("txtUsername").value; var userName = '2000';//$("txtUsername").value;
var password = $("txtPassword").value; var password = '123456';//$("txtPassword").value;
var userType = $("cmbUserType").value; var userType = '2';//$("cmbUserType").value;
// var options = { ip, port, businesPort, userName, password, userType, null: HTMLVideoElement, videoRemoteElement } // var options = { ip, port, businesPort, userName, password, userType, null: HTMLVideoElement, videoRemoteElement }
var resourceUrl = ""; var resourceUrl = "";
@ -78,9 +78,10 @@ export function regist() {
// var resourceUrl = "softswitch"; // var resourceUrl = "softswitch";
// var businessResourceUrl = "dispatch"; // var businessResourceUrl = "dispatch";
var options = { ip, port, businesPort, userName, password, userType, resourceUrl, businessResourceUrl } // var options = { ip, port, businesPort, userName, password, userType, resourceUrl, businessResourceUrl }
// var options = { ip, port, businesPort, userName, password, userType } var options = { ip, port, businesPort, userName, password, userType }
console.log('register')
client.regist(options); client.regist(options);
} }
@ -89,7 +90,7 @@ export function unRegist() {
} }
export function isRegisted() { export function isRegisted() {
alert("已注册: " + client.isRegisted); console.log("已注册: " + client.isRegisted);
} }
// function onForceKickoutClick() { // function onForceKickoutClick() {

@ -393,7 +393,7 @@
<script> <script>
import {getGroupList,deleteUser,addUser} from "@/api/dispatch/dispatch" import {getGroupList,deleteUser,addUser} from "@/api/dispatch/dispatch"
import { client, isRegisted, mylog } from "../../util/dispatch" import { client, regist , isRegisted, mylog } from "../../util/dispatch"
export default { export default {
name: "alarmCenter", name: "alarmCenter",
@ -546,6 +546,9 @@ export default {
mounted() { mounted() {
}, },
created(){ created(){
if(!isRegisted()) {
regist();
}
this.treeData.map(item =>{ this.treeData.map(item =>{
this.defaultExpandIds.push(item.id) this.defaultExpandIds.push(item.id)
}) })

@ -68,7 +68,7 @@ module.exports = {
target: "http://192.168.1.134:8081", target: "http://192.168.1.134:8081",
ws: true, ws: true,
pathRewrite: { pathRewrite: {
"^/dispatchApi": "/api", "^/dispatchApi": "/",
}, },
}, },
}, },

Loading…
Cancel
Save