Browse Source

websocket test

master
tangmingyou 4 years ago
parent
commit
d14df0213e
  1. 3
      config/dev.js
  2. 3
      src/api/websocket.js

3
config/dev.js

@ -10,7 +10,8 @@ module.exports = {
h5: {
devServer: {
//host: '0.0.0.0',
host: '192.168.110.53',
//host: '192.168.110.53',
host: '192.168.3.102',
port: 10086,
// 设置代理来解决 H5 请求的跨域问题
proxy: {

3
src/api/websocket.js

@ -172,6 +172,9 @@ export const sendPromise = function(msg) {
;(async function() {
// const token = "15PohpTztq4YkMmErI4H71kJWX2pPqnvOZar9HKOfg1KEy0fd8fUNxnBIwuMDcKQEBPG7b9UC7ja_8FtwvYjnA=="
const token = getStorage('_t')
if (!token) {
return;
}
// console.log('token', token)
const opMap = await fetchOpMap()
websocket.init(token, opMap.data)

Loading…
Cancel
Save