Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
NEWYEARPARTY
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
华国豪
NEWYEARPARTY
Commits
8f799d33
Commit
8f799d33
authored
Dec 26, 2019
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化全局配置
parent
2cae4af9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1023 additions
and
834 deletions
+1023
-834
.gitignore
.gitignore
+1
-0
App.vue
src/App.vue
+22
-19
Money.vue
src/components/playGame/Money.vue
+937
-804
main.js
src/main.js
+13
-11
index.js
src/plugin/index.js
+7
-0
signalr.js
src/plugin/signalr.js
+41
-0
store.js
src/store/store.js
+2
-0
No files found.
.gitignore
View file @
8f799d33
...
...
@@ -15,3 +15,4 @@ selenium-debug.log
*.ntvs*
*.njsproj
*.sln
yarn.lock
src/App.vue
View file @
8f799d33
...
...
@@ -44,7 +44,7 @@ export default {
$this
.
MsgBus
.
$emit
(
'nextMusic'
)
}
},
false
);
$this
.
connectServer
()
//
$this.connectServer()
this
.
MsgBus
.
$on
(
'setBarrageShow'
,
function
(
type
)
{
$this
.
barrageIsShow
=
type
})
...
...
@@ -63,6 +63,7 @@ export default {
$this
.
setAudioPlay
(
0
)
},
50
)
})
this
.
getMsg
();
// setInterval(()=>{
// let barrageObj = {
// id: ++this.currentId,
...
...
@@ -74,6 +75,7 @@ export default {
// }
// $this.barrageList.push(barrageObj)
// }, 5000)
//this.sendMsg();
},
methods
:
{
setAudioType
:
function
(
type
)
{
...
...
@@ -87,31 +89,32 @@ export default {
this
.
$refs
.
homeAudio
.
pause
()
}
},
connectServer
()
{
var
$this
=
this
;
var
conn
=
$
.
hubConnection
(
"http://192.168.2.65:7838/signalr"
,
{
qs
:
`i=888888&n=罗超&p=
${
encodeURIComponent
(
"http://imgfile.oytour.com/New/Upload/User/20191018150051176.png"
)}
`
});
$this
.
proxy
=
conn
.
createHubProxy
(
"annualLeaveHub"
);
$this
.
getMsg
();
conn
.
start
()
.
done
(
data
=>
{
$this
.
sendMsg
();
})
.
fail
(
data
=>
{});
},
//
connectServer() {
//
var $this = this;
//
var conn = $.hubConnection("http://192.168.2.65:7838/signalr", {
//
qs: `i=888888&n=罗超&p=${encodeURIComponent(
//
"http://imgfile.oytour.com/New/Upload/User/20191018150051176.png"
//
)}`
//
});
//
$this.proxy = conn.createHubProxy("annualLeaveHub");
//
$this.getMsg();
//
conn
//
.start()
//
.done(data => {
//
$this.sendMsg();
//
})
//
.fail(data => {});
//
},
sendMsg
()
{
var
$this
=
this
;
$this
.
proxy
.
invoke
(
"SendBarrage"
,
'0.0 让我康康是谁在说我坏话?'
).
done
(
msg
=>
{
$this
.
$PROXY
.
invoke
(
"SendBarrage"
,
'0.0 让我康康是谁在说我坏话?'
).
done
(
msg
=>
{
console
.
log
(
msg
)
});
},
getMsg
()
{
var
$this
=
this
;
$this
.
proxy
.
on
(
"barrage"
,
data
=>
{
console
.
log
(
this
.
$PROXY
)
this
.
$PROXY
.
on
(
"barrage"
,
data
=>
{
let
barrage
=
data
let
barrageObj
=
{
id
:
++
this
.
currentId
,
...
...
src/components/playGame/Money.vue
View file @
8f799d33
This diff is collapsed.
Click to expand it.
src/main.js
View file @
8f799d33
...
...
@@ -8,24 +8,26 @@ import 'element-ui/lib/theme-chalk/index.css'
import
socketio
from
'socket.io-client'
import
MsgBus
from
'./assets/js/msgBus'
import
{
vueBaberrage
}
from
'vue-baberrage'
import
plugin
from
'./plugin/index'
import
'signalr'
Vue
.
prototype
.
MsgBus
=
MsgBus
Vue
.
config
.
productionTip
=
false
Vue
.
use
(
ElementUI
)
Vue
.
use
(
vueBaberrage
)
Vue
.
use
(
plugin
)
Vue
.
prototype
.
$socketio
=
socketio
/* 路由发生变化修改页面title */
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
if
(
to
.
meta
.
title
)
{
document
.
title
=
to
.
meta
.
title
}
next
()
})
/* eslint-disable no-new */
if
(
to
.
meta
.
title
)
{
document
.
title
=
to
.
meta
.
title
}
next
()
})
/* eslint-disable no-new */
new
Vue
({
el
:
'#app'
,
router
,
components
:
{
App
},
template
:
'<App/>'
})
el
:
'#app'
,
router
,
components
:
{
App
},
template
:
'<App/>'
})
\ No newline at end of file
src/plugin/index.js
0 → 100644
View file @
8f799d33
import
getHubProxy
from
'./signalr'
export
default
{
install
(
Vue
,
options
)
{
Vue
.
prototype
.
$PROXY
=
getHubProxy
();
}
};
\ No newline at end of file
src/plugin/signalr.js
0 → 100644
View file @
8f799d33
const
HUBNAME
=
'annualLeaveHub'
;
let
PROXY
=
null
;
let
HUB
=
null
;
const
HUB_API
=
'http://localhost:7838/signalr'
;
// 建立连接
export
function
startConnection
()
{
HUB
=
$
.
hubConnection
(
HUB_API
,
{
qs
:
`i=888888&n=罗超&p=
${
encodeURIComponent
(
"http://imgfile.oytour.com/New/Upload/User/20191018150051176.png"
)}
`
})
let
PROXY
=
HUB
.
createHubProxy
(
HUBNAME
)
HUB
.
start
().
done
((
connection
)
=>
{
console
.
log
(
'Now connected, connection ID='
+
connection
.
id
)
}).
fail
(()
=>
{
console
.
log
(
'Could not connect'
);
})
HUB
.
error
(
function
(
error
)
{
console
.
log
(
'SignalR error: '
+
error
)
})
HUB
.
connectionSlow
(
function
()
{
console
.
log
(
'We are currently experiencing difficulties with the connection.'
)
});
HUB
.
disconnected
(
function
()
{
console
.
log
(
'disconnected'
)
});
return
PROXY
}
// 手动创建proxy
export
default
function
getHubProxy
()
{
if
(
!
PROXY
)
{
PROXY
=
startConnection
();
}
// // 注册客户端方法
// clientMethodSets.map((item)=>{
// proxy.on(item.name,item.method)
// })
return
PROXY
}
\ No newline at end of file
src/store/store.js
0 → 100644
View file @
8f799d33
import
Vue
from
'vue'
// import from ''
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment