Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dt_analysis
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
haoyanbin
dt_analysis
Commits
ebfe0db7
Commit
ebfe0db7
authored
Sep 06, 2023
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
19664050
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
vcode.go
service/vcode.go
+1
-1
common.go
utils/common.go
+11
-0
No files found.
service/vcode.go
View file @
ebfe0db7
...
@@ -37,7 +37,7 @@ func GetVcode(userId, mocId int) string {
...
@@ -37,7 +37,7 @@ func GetVcode(userId, mocId int) string {
}
}
func
createCode
()
string
{
func
createCode
()
string
{
code
:=
utils
.
GetRandStr
()
code
:=
utils
.
GetRandStr
2
()
cid
:=
0
cid
:=
0
...
...
utils/common.go
View file @
ebfe0db7
...
@@ -135,6 +135,17 @@ func GetPointsOrderNo(num int) string {
...
@@ -135,6 +135,17 @@ func GetPointsOrderNo(num int) string {
return
"P"
+
timeStr
+
sup
(
orderNo
,
9
)
return
"P"
+
timeStr
+
sup
(
orderNo
,
9
)
}
}
func
GetRandStr2
()
string
{
charset
:=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
seededRand
:=
rand
.
New
(
rand
.
NewSource
(
time
.
Now
()
.
UnixNano
()))
b
:=
make
([]
byte
,
6
)
for
i
:=
range
b
{
b
[
i
]
=
charset
[
seededRand
.
Intn
(
len
(
charset
))]
}
return
string
(
b
)
}
func
GetRandStr
()
string
{
func
GetRandStr
()
string
{
result
:=
make
([]
byte
,
3
)
result
:=
make
([]
byte
,
3
)
rand
.
Read
(
result
)
rand
.
Read
(
result
)
...
...
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