Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
visualcloud
/
Vmatrix-client
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1048bf6c
authored
Jul 24, 2019
by
duanguohui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xd: 去除一些打印
parent
73dae00e
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
14 deletions
+15
-14
package-lock.json
+0
-0
src/App.vue
+2
-1
src/api/index.js
+3
-3
src/router/index.js
+2
-2
src/router/index_ pad.js
+2
-2
src/utils/request.js
+3
-3
src/views/tempaltes/index.vue
+3
-3
No files found.
package-lock.json
View file @
1048bf6c
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/App.vue
View file @
1048bf6c
...
@@ -21,10 +21,11 @@ export default {
...
@@ -21,10 +21,11 @@ export default {
$route
:
function
()
{
$route
:
function
()
{
let
isBack
=
this
.
$router
.
isBack
let
isBack
=
this
.
$router
.
isBack
if
(
isBack
)
{
if
(
isBack
)
{
this
.
transitionName
=
'slide-right'
this
.
transitionName
=
'slide-right'
console
.
log
(
this
.
transitionName
,
'pop动画'
)
}
else
{
}
else
{
this
.
transitionName
=
'slide-left'
this
.
transitionName
=
'slide-left'
console
.
log
(
this
.
transitionName
,
'push动画'
)
}
}
// 做完回退动画后,要设置成前进动画,否则下次打开页面动画将还是回退
// 做完回退动画后,要设置成前进动画,否则下次打开页面动画将还是回退
this
.
$router
.
isBack
=
false
this
.
$router
.
isBack
=
false
...
...
src/api/index.js
View file @
1048bf6c
...
@@ -2,7 +2,7 @@ import request from '@/utils/request'
...
@@ -2,7 +2,7 @@ import request from '@/utils/request'
import
{
Toast
}
from
'vant'
;
import
{
Toast
}
from
'vant'
;
function
requestHandle
(
res
)
{
function
requestHandle
(
res
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
console
.
log
(
res
)
//
console.log(res)
if
(
res
.
status
==
200
&&
(
!
res
.
data
.
code
||
res
.
data
.
code
==
0
))
{
if
(
res
.
status
==
200
&&
(
!
res
.
data
.
code
||
res
.
data
.
code
==
0
))
{
resolve
(
res
)
resolve
(
res
)
}
else
{
}
else
{
...
@@ -23,10 +23,10 @@ export function apiRequest( obj = {
...
@@ -23,10 +23,10 @@ export function apiRequest( obj = {
delete
obj
.
params
delete
obj
.
params
}
}
return
request
(
obj
).
then
(
res
=>
{
return
request
(
obj
).
then
(
res
=>
{
console
.
log
(
'then'
)
//
console.log('then')
return
requestHandle
(
res
)
return
requestHandle
(
res
)
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
log
(
'catch'
,
JSON
.
stringify
(
err
))
//
console.log('catch', JSON.stringify(err))
return
requestHandle
(
err
)
return
requestHandle
(
err
)
})
})
...
...
src/router/index.js
View file @
1048bf6c
...
@@ -97,13 +97,13 @@ const router = new Router({
...
@@ -97,13 +97,13 @@ const router = new Router({
})
})
router
.
beforeEach
((
from
,
to
,
next
)
=>
{
router
.
beforeEach
((
from
,
to
,
next
)
=>
{
// 路由拦截
// 路由拦截
console
.
log
(
from
,
to
)
//
console.log(from, to)
if
(
window
.
localStorage
.
getItem
(
'login'
)
||
from
.
path
===
'/login'
)
{
if
(
window
.
localStorage
.
getItem
(
'login'
)
||
from
.
path
===
'/login'
)
{
next
()
next
()
}
else
{
}
else
{
// router.redirect()
// router.redirect()
if
(
to
.
path
===
'/login'
)
{
if
(
to
.
path
===
'/login'
)
{
console
.
log
(
'11212'
)
//
console.log('11212')
next
()
next
()
}
else
{
}
else
{
next
(
'/login?'
+
Date
.
now
())
next
(
'/login?'
+
Date
.
now
())
...
...
src/router/index_ pad.js
View file @
1048bf6c
...
@@ -87,13 +87,13 @@ const router = new Router({
...
@@ -87,13 +87,13 @@ const router = new Router({
})
})
router
.
beforeEach
((
from
,
to
,
next
)
=>
{
router
.
beforeEach
((
from
,
to
,
next
)
=>
{
// 路由拦截
// 路由拦截
console
.
log
(
from
,
to
)
//
console.log(from, to)
if
(
window
.
localStorage
.
getItem
(
'login'
)
||
from
.
path
===
'/login'
)
{
if
(
window
.
localStorage
.
getItem
(
'login'
)
||
from
.
path
===
'/login'
)
{
next
()
next
()
}
else
{
}
else
{
// router.redirect()
// router.redirect()
if
(
to
.
path
===
'/login'
)
{
if
(
to
.
path
===
'/login'
)
{
console
.
log
(
'11212'
)
//
console.log('11212')
next
()
next
()
}
else
{
}
else
{
next
(
'/login?'
+
Date
.
now
())
next
(
'/login?'
+
Date
.
now
())
...
...
src/utils/request.js
View file @
1048bf6c
...
@@ -7,7 +7,7 @@ import {
...
@@ -7,7 +7,7 @@ import {
}
from
'@/utils/auth'
}
from
'@/utils/auth'
// 创建axios实例
// 创建axios实例
console
.
log
(
process
.
env
)
//
console.log(process.env)
const
service
=
axios
.
create
({
const
service
=
axios
.
create
({
baseURL
:
process
.
env
.
VUE_APP_BASE_API
,
// api 的 base_url
baseURL
:
process
.
env
.
VUE_APP_BASE_API
,
// api 的 base_url
timeout
:
10
*
1000
// 请求超时时间, 10秒
timeout
:
10
*
1000
// 请求超时时间, 10秒
...
@@ -61,7 +61,7 @@ service.interceptors.response.use(
...
@@ -61,7 +61,7 @@ service.interceptors.response.use(
// return response.data;
// return response.data;
// }
// }
err
=>
{
err
=>
{
console
.
dir
(
err
);
//
console.dir(err);
if
(
err
&&
err
.
response
)
{
if
(
err
&&
err
.
response
)
{
switch
(
err
.
response
.
status
)
{
switch
(
err
.
response
.
status
)
{
case
400
:
case
400
:
...
@@ -134,7 +134,7 @@ service.interceptors.response.use(
...
@@ -134,7 +134,7 @@ service.interceptors.response.use(
break
break
}
}
}
}
console
.
log
(
err
.
message
)
//
console.log(err.message)
return
Promise
.
reject
(
err
.
response
)
return
Promise
.
reject
(
err
.
response
)
}
}
)
)
...
...
src/views/tempaltes/index.vue
View file @
1048bf6c
...
@@ -62,14 +62,14 @@ export default {
...
@@ -62,14 +62,14 @@ export default {
methods
:
{
methods
:
{
onLoad
()
{
onLoad
()
{
// 异步更新数据
// 异步更新数据
console
.
log
(
'onLoad'
)
//
console.log('onLoad')
this
.
getList
();
this
.
getList
();
this
.
page
++
this
.
page
++
},
},
onRefresh
()
{
onRefresh
()
{
this
.
page
=
0
;
this
.
page
=
0
;
console
.
log
(
'onRefresh'
)
//
console.log('onRefresh')
this
.
getList
(
true
);
this
.
getList
(
true
);
},
},
changeBtn
(
index
)
{
changeBtn
(
index
)
{
...
@@ -104,7 +104,7 @@ export default {
...
@@ -104,7 +104,7 @@ export default {
},
},
getList2
()
{
getList2
()
{
getFilmList
().
then
(
res
=>
{
getFilmList
().
then
(
res
=>
{
console
.
log
(
res
);
//
console.log(res);
this
.
list
=
res
.
data
.
list
;
this
.
list
=
res
.
data
.
list
;
});
});
},
},
...
...
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