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
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
15 deletions
+16
-15
package-lock.json
+0
-0
src/App.vue
+3
-2
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
...
...
@@ -17,14 +17,15 @@ export default {
keepAlive
:
false
}
},
watch
:
{
watch
:
{
$route
:
function
()
{
let
isBack
=
this
.
$router
.
isBack
if
(
isBack
)
{
this
.
transitionName
=
'slide-right'
console
.
log
(
this
.
transitionName
,
'pop动画'
)
}
else
{
this
.
transitionName
=
'slide-left'
console
.
log
(
this
.
transitionName
,
'push动画'
)
}
// 做完回退动画后,要设置成前进动画,否则下次打开页面动画将还是回退
this
.
$router
.
isBack
=
false
...
...
src/api/index.js
View file @
1048bf6c
...
...
@@ -2,7 +2,7 @@ import request from '@/utils/request'
import
{
Toast
}
from
'vant'
;
function
requestHandle
(
res
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
console
.
log
(
res
)
//
console.log(res)
if
(
res
.
status
==
200
&&
(
!
res
.
data
.
code
||
res
.
data
.
code
==
0
))
{
resolve
(
res
)
}
else
{
...
...
@@ -23,10 +23,10 @@ export function apiRequest( obj = {
delete
obj
.
params
}
return
request
(
obj
).
then
(
res
=>
{
console
.
log
(
'then'
)
//
console.log('then')
return
requestHandle
(
res
)
}).
catch
(
err
=>
{
console
.
log
(
'catch'
,
JSON
.
stringify
(
err
))
//
console.log('catch', JSON.stringify(err))
return
requestHandle
(
err
)
})
...
...
src/router/index.js
View file @
1048bf6c
...
...
@@ -97,13 +97,13 @@ const router = new Router({
})
router
.
beforeEach
((
from
,
to
,
next
)
=>
{
// 路由拦截
console
.
log
(
from
,
to
)
//
console.log(from, to)
if
(
window
.
localStorage
.
getItem
(
'login'
)
||
from
.
path
===
'/login'
)
{
next
()
}
else
{
// router.redirect()
if
(
to
.
path
===
'/login'
)
{
console
.
log
(
'11212'
)
//
console.log('11212')
next
()
}
else
{
next
(
'/login?'
+
Date
.
now
())
...
...
src/router/index_ pad.js
View file @
1048bf6c
...
...
@@ -87,13 +87,13 @@ const router = new Router({
})
router
.
beforeEach
((
from
,
to
,
next
)
=>
{
// 路由拦截
console
.
log
(
from
,
to
)
//
console.log(from, to)
if
(
window
.
localStorage
.
getItem
(
'login'
)
||
from
.
path
===
'/login'
)
{
next
()
}
else
{
// router.redirect()
if
(
to
.
path
===
'/login'
)
{
console
.
log
(
'11212'
)
//
console.log('11212')
next
()
}
else
{
next
(
'/login?'
+
Date
.
now
())
...
...
src/utils/request.js
View file @
1048bf6c
...
...
@@ -7,7 +7,7 @@ import {
}
from
'@/utils/auth'
// 创建axios实例
console
.
log
(
process
.
env
)
//
console.log(process.env)
const
service
=
axios
.
create
({
baseURL
:
process
.
env
.
VUE_APP_BASE_API
,
// api 的 base_url
timeout
:
10
*
1000
// 请求超时时间, 10秒
...
...
@@ -61,7 +61,7 @@ service.interceptors.response.use(
// return response.data;
// }
err
=>
{
console
.
dir
(
err
);
//
console.dir(err);
if
(
err
&&
err
.
response
)
{
switch
(
err
.
response
.
status
)
{
case
400
:
...
...
@@ -134,7 +134,7 @@ service.interceptors.response.use(
break
}
}
console
.
log
(
err
.
message
)
//
console.log(err.message)
return
Promise
.
reject
(
err
.
response
)
}
)
...
...
src/views/tempaltes/index.vue
View file @
1048bf6c
...
...
@@ -62,14 +62,14 @@ export default {
methods
:
{
onLoad
()
{
// 异步更新数据
console
.
log
(
'onLoad'
)
//
console.log('onLoad')
this
.
getList
();
this
.
page
++
},
onRefresh
()
{
this
.
page
=
0
;
console
.
log
(
'onRefresh'
)
//
console.log('onRefresh')
this
.
getList
(
true
);
},
changeBtn
(
index
)
{
...
...
@@ -104,7 +104,7 @@ export default {
},
getList2
()
{
getFilmList
().
then
(
res
=>
{
console
.
log
(
res
);
//
console.log(res);
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