Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-common
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-common
Commits
0a7221e9
Commit
0a7221e9
authored
Jul 17, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
错误弹窗
parent
85a34f78
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
code.go
myerr/code.go
+2
-0
msg.go
txop/msg/msg.go
+20
-0
No files found.
myerr/code.go
View file @
0a7221e9
...
...
@@ -160,6 +160,8 @@ type BusinessData struct {
Timestamp
int64
`json:"timestamp"`
//官网充值地址
CheckOutUrl
string
`json:"checkOutUrl"`
Title
string
`json:"title"`
Detail
string
`json:"detail"`
}
func
NewBusiness
(
err
*
BusinessError
)
*
BusinessError
{
...
...
txop/msg/msg.go
View file @
0a7221e9
...
...
@@ -60,6 +60,26 @@ func GetErrByLanguage(model *domain.Model, msgId common.MsgIdType, lang string,
return
myerr
.
NewBusinessCodeNoCheck
(
myErr
.
GetCode
(),
msg
,
myerr
.
BusinessData
{})
}
// 生成弹窗错误
func
NewAlertErrByLanguage
(
model
*
domain
.
Model
,
msgId1
,
msgId2
common
.
MsgIdType
,
lang
string
,
args1
[]
interface
{},
args2
[]
interface
{})
*
myerr
.
BusinessError
{
var
title
,
content
string
if
resMul
,
_
:=
res_m
.
GetResMultiTextBy
(
model
,
msgId1
,
lang
);
resMul
!=
nil
{
if
len
(
args1
)
>
0
{
title
=
fmt
.
Sprintf
(
resMul
.
Content
,
args1
...
)
}
else
{
title
=
resMul
.
Content
}
}
if
resMul
,
_
:=
res_m
.
GetResMultiTextBy
(
model
,
msgId2
,
lang
);
resMul
!=
nil
{
if
len
(
args1
)
>
0
{
content
=
fmt
.
Sprintf
(
resMul
.
Content
,
args2
...
)
}
else
{
content
=
resMul
.
Content
}
}
return
myerr
.
NewBusinessCodeNoCheck
(
1020
,
""
,
myerr
.
BusinessData
{
Title
:
title
,
Detail
:
content
})
}
func
GetResMultiTextBy
(
model
*
domain
.
Model
,
msgId
uint
,
Language
mysql
.
Str
)
(
string
,
error
)
{
r
:=
res_m
.
ResMultiText
{}
if
err
:=
model
.
DB
()
.
Where
(
&
res_m
.
ResMultiText
{
...
...
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