Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ef72a89f
authored
Dec 14, 2022
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
表单bug
1 parent
205fd88f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
linkwe-pc/src/utils/index.js
linkwe-pc/src/utils/index.js
View file @
ef72a89
import
{
parseTime
}
from
'./common'
import
{
parseTime
}
from
'./common'
import
axios
from
'axios'
// 日期时间格式化
// 日期时间格式化
export
function
dateFormat
(
dateString
,
fmt
=
'yyyy-MM-dd hh:mm:ss'
)
{
export
function
dateFormat
(
dateString
,
fmt
=
'yyyy-MM-dd hh:mm:ss'
)
{
...
@@ -7,7 +8,6 @@ export function dateFormat(dateString, fmt = 'yyyy-MM-dd hh:mm:ss') {
...
@@ -7,7 +8,6 @@ export function dateFormat(dateString, fmt = 'yyyy-MM-dd hh:mm:ss') {
}
}
var
date
=
dateString
var
date
=
dateString
if
(
Object
.
prototype
.
toString
.
call
(
dateString
)
!==
'[object Date]'
)
{
if
(
Object
.
prototype
.
toString
.
call
(
dateString
)
!==
'[object Date]'
)
{
console
.
log
(
dateString
)
date
=
new
Date
(
dateString
.
replace
(
/-/g
,
'/'
))
date
=
new
Date
(
dateString
.
replace
(
/-/g
,
'/'
))
}
}
var
o
=
{
var
o
=
{
...
@@ -668,9 +668,17 @@ export async function getWechatAuthUserInfo(appId) {
...
@@ -668,9 +668,17 @@ export async function getWechatAuthUserInfo(appId) {
// stime 开始时间 etime 结束时间 currentTime指定日期
// stime 开始时间 etime 结束时间 currentTime指定日期
export
function
compareTime
(
stime
,
etime
,
currentTime
)
{
export
function
compareTime
(
stime
,
etime
,
currentTime
)
{
if
(
!
stime
||
!
etime
)
{
return
}
let
thisDate
=
''
if
(
currentTime
)
{
thisDate
=
new
Date
(
currentTime
)
}
else
{
thisDate
=
new
Date
()
}
let
startTime
=
tranDate
(
stime
)
let
startTime
=
tranDate
(
stime
)
let
endTime
=
tranDate
(
etime
)
let
endTime
=
tranDate
(
etime
)
let
thisDate
=
currentTime
||
new
Date
()
let
time
=
let
time
=
thisDate
.
getFullYear
()
+
thisDate
.
getFullYear
()
+
'-'
+
'-'
+
...
@@ -711,6 +719,7 @@ export function getIP() {
...
@@ -711,6 +719,7 @@ export function getIP() {
// reject('')
// reject('')
// }
// }
// })
// })
return
axios
({
return
axios
({
url
:
'https://api.ipify.org/?format=json'
,
url
:
'https://api.ipify.org/?format=json'
,
}).
then
(({
data
})
=>
data
.
ip
||
Promise
.
reject
())
}).
then
(({
data
})
=>
data
.
ip
||
Promise
.
reject
())
...
@@ -729,3 +738,11 @@ export async function getProvinceCityTree() {
...
@@ -729,3 +738,11 @@ export async function getProvinceCityTree() {
}
}
return
area
return
area
}
}
// 判断是否为移动端
export
function
isMobile
()
{
let
flag
=
navigator
.
userAgent
.
match
(
/
(
phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone
)
/i
,
)
return
flag
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment