Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-userProxy
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
hujiebin
hilo-userProxy
Commits
5ee86446
Commit
5ee86446
authored
May 17, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:
parent
53d191e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
main.go
main.go
+2
-3
No files found.
main.go
View file @
5ee86446
...
@@ -49,7 +49,6 @@ type ProtoData struct {
...
@@ -49,7 +49,6 @@ type ProtoData struct {
var
myAddress
=
""
var
myAddress
=
""
var
m
sync
.
RWMutex
var
m
sync
.
RWMutex
var
userChan
=
make
(
map
[
uint64
]
map
[
string
]
chan
ProtoData
)
var
userChan
=
make
(
map
[
uint64
]
map
[
string
]
chan
ProtoData
)
var
logDir
=
"/var/log/hilo/"
/* 其中CheckOringin是一个函数,该函数用于拦截或放行跨域请求。函数返回值为bool类型,即true放行,false拦截。
/* 其中CheckOringin是一个函数,该函数用于拦截或放行跨域请求。函数返回值为bool类型,即true放行,false拦截。
如果请求不是跨域请求可以不赋值,我这里是跨域请求并且为了方便直接返回true
如果请求不是跨域请求可以不赋值,我这里是跨域请求并且为了方便直接返回true
...
@@ -642,7 +641,7 @@ func main() {
...
@@ -642,7 +641,7 @@ func main() {
if
cataLog
==
nil
{
if
cataLog
==
nil
{
mylogrus
.
MyLog
.
Fatalln
(
"No catalog."
)
mylogrus
.
MyLog
.
Fatalln
(
"No catalog."
)
}
}
services
,
_
,
err
:=
cataLog
.
Service
(
"userCenter"
,
""
,
nil
)
services
,
_
,
err
:=
cataLog
.
Service
(
userCenterConsulName
,
""
,
nil
)
if
err
!=
nil
{
if
err
!=
nil
{
mylogrus
.
MyLog
.
Fatalln
(
err
)
mylogrus
.
MyLog
.
Fatalln
(
err
)
}
}
...
@@ -663,7 +662,7 @@ func main() {
...
@@ -663,7 +662,7 @@ func main() {
// 服务发现
// 服务发现
resolver
.
Register
(
bd
)
resolver
.
Register
(
bd
)
go
func
()
{
go
func
()
{
consul
.
RegisterWatcher
(
defaultUserCenterAddr
,
func
(
addr
[]
string
)
{
consul
.
RegisterWatcher
(
userCenterConsulName
,
func
(
addr
[]
string
)
{
if
len
(
addr
)
>
0
{
if
len
(
addr
)
>
0
{
bd
.
UpdateState
(
addr
)
// 更新新的注册名
bd
.
UpdateState
(
addr
)
// 更新新的注册名
}
}
...
...
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