Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
h5
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1fc25867
authored
Sep 24, 2019
by
梁建民
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
ios下载
parent
d438e211
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
22 deletions
src/store/modules/download/index.js
src/util/index.js
view/app.js
src/store/modules/download/index.js
View file @
1fc25867
...
...
@@ -52,8 +52,21 @@ const actions = {
let
data
=
res
.
data
;
if
(
data
.
err_code
==
0
)
{
window
.
location
.
href
=
data
.
data
[
0
].
file_url
;
let
platform
=
Util
.
isUerAgent
();
if
(
platform
==
'ios'
)
{
Toast
({
message
:
'该文件只能在safari浏览器中下载保存,请在safari中打开页面并下载\n'
,
duration
:
2000
});
setTimeout
(()
=>
{
window
.
location
.
href
=
data
.
data
[
0
].
file_url
;
},
2000
)
}
else
{
window
.
location
.
href
=
data
.
data
[
0
].
file_url
;
}
}
else
if
(
data
.
err_code
==
1
)
{
Toast
({
message
:
data
.
err_msg
,
duration
:
2000
...
...
@@ -61,11 +74,14 @@ const actions = {
setTimeout
(
function
()
{
window
.
location
.
href
=
'/v3/login?referer=%2fh5%2fview%2f%23%2fdownoad&from=download'
},
2000
);
}
else
{
Toast
({
message
:
data
.
err_msg
,
duration
:
2000
});
}
}).
catch
(
function
(
err
)
{
...
...
src/util/index.js
View file @
1fc25867
...
...
@@ -104,12 +104,12 @@ export default {
* *
* /
*/
isLogin
(){
var
state_
=
0
;
if
(
this
.
getCookie
(
"Yo4teW_uid"
))
{
state_
=
2
;
//强弱登录态
if
(
this
.
getCookie
(
"Yo4teW_skey"
))
{
state_
=
1
;
//强登录态
isLogin
()
{
var
state_
=
0
;
if
(
this
.
getCookie
(
"Yo4teW_uid"
))
{
state_
=
2
;
//强弱登录态
if
(
this
.
getCookie
(
"Yo4teW_skey"
))
{
state_
=
1
;
//强登录态
}
}
return
state_
...
...
@@ -120,8 +120,8 @@ export default {
* *
* /
*/
loginBack
:
function
()
{
loginBack
:
function
()
{
},
/**
* *
...
...
@@ -129,13 +129,13 @@ export default {
* *
* /
*/
compare
(
property
,
state
)
{
return
function
(
a
,
b
)
{
compare
(
property
,
state
)
{
return
function
(
a
,
b
)
{
var
value1
=
a
[
property
];
var
value2
=
b
[
property
];
if
(
state
)
{
if
(
state
)
{
return
value1
-
value2
;
}
else
{
}
else
{
return
value2
-
value1
;
}
}
...
...
@@ -146,12 +146,12 @@ export default {
* *
* /
*/
distinct
(
array
){
distinct
(
array
)
{
var
arr
=
array
,
result
=
[],
i
,
j
,
len
=
arr
.
length
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
for
(
j
=
i
+
1
;
j
<
len
;
j
++
)
{
if
(
arr
[
i
]
===
arr
[
j
])
{
result
=
[],
i
,
j
,
len
=
arr
.
length
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
for
(
j
=
i
+
1
;
j
<
len
;
j
++
)
{
if
(
arr
[
i
]
===
arr
[
j
])
{
j
=
++
i
;
}
}
...
...
@@ -160,13 +160,29 @@ export default {
return
result
;
},
/**
* 判断终端
* @param
*/
isUerAgent
()
{
var
u
=
navigator
.
userAgent
;
var
platform
=
''
;
if
(
u
.
indexOf
(
'Android'
)
>
-
1
||
u
.
indexOf
(
'Adr'
)
>
-
1
)
{
platform
=
'android'
}
else
if
(
!!
u
.
match
(
/
\(
i
[^
;
]
+;
(
U;
)?
CPU.+Mac OS X/
))
{
platform
=
'ios'
}
else
{
platform
=
''
}
return
platform
;
},
/**
* *
* 数字解密
* *
* /
*/
aggxde
(
str
){
var
str
=
String
(
str
);
aggxde
(
str
)
{
var
str
=
String
(
str
);
if
(
str
&&
str
.
indexOf
(
"font"
)
!=
-
1
)
{
var
sff
=
(
str
.
split
(
'class="'
));
sff
.
shift
();
...
...
@@ -192,9 +208,9 @@ export default {
}
}
return
Number
(
numb
)
}
else
{
}
else
{
return
Number
(
str
)
}
}
}
view/app.js
View file @
1fc25867
This diff is collapsed.
Click to expand it.
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