Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
walk_daka_h5
Overview
Overview
Details
Activity
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
穆启卓
walk_daka_h5
Commits
af1b30e2
Commit
af1b30e2
authored
Mar 29, 2019
by
穆启卓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小细节
parent
e1496465
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
46 additions
and
81 deletions
+46
-81
Free.vue
src/components/Free.vue
+1
-1
Reborn.vue
src/components/Reborn.vue
+1
-1
api.js
src/components/axios/api.js
+30
-61
fetch.js
src/components/axios/fetch.js
+2
-2
url.js
src/components/axios/url.js
+1
-1
main.js
src/main.js
+1
-1
Author.vue
src/views/Author.vue
+9
-13
UserCenter.vue
src/views/UserCenter.vue
+1
-1
No files found.
src/components/Free.vue
View file @
af1b30e2
...
...
@@ -342,7 +342,7 @@
if
(
window
[
"userData"
])
{
this
.
userData
=
window
[
"userData"
];
}
else
{
let
localUserData
=
localStorage
.
getItem
(
"
read
_userData"
);
let
localUserData
=
localStorage
.
getItem
(
"
walk
_userData"
);
if
(
localUserData
)
{
window
[
"userData"
]
=
JSON
.
parse
(
localUserData
);
this
.
userData
=
window
[
"userData"
];
...
...
src/components/Reborn.vue
View file @
af1b30e2
...
...
@@ -270,7 +270,7 @@
if
(
window
[
"userData"
])
{
this
.
userData
=
window
[
"userData"
];
}
else
{
let
localUserData
=
localStorage
.
getItem
(
"
read
_userData"
);
let
localUserData
=
localStorage
.
getItem
(
"
walk
_userData"
);
if
(
localUserData
)
{
window
[
"userData"
]
=
JSON
.
parse
(
localUserData
);
this
.
userData
=
window
[
"userData"
];
...
...
src/components/axios/api.js
View file @
af1b30e2
This diff is collapsed.
Click to expand it.
src/components/axios/fetch.js
View file @
af1b30e2
...
...
@@ -2,7 +2,7 @@ import axios from 'axios';//引入axios
export
function
fetch
(
options
)
{
// if (!window['userData']) {
// let user_data_str = localStorage.getItem('
read
_userData');
// let user_data_str = localStorage.getItem('
walk
_userData');
// if (user_data_str) {
// window['userData'] = JSON.parse(user_data_str);
// }
...
...
@@ -34,7 +34,7 @@ export function fetch(options) {
// console.log(error);
// if (error.response.status == 401) {
// localStorage.setItem('last_url', location.hash.slice(1));
// localStorage.setItem('
read
_userData', '');
// localStorage.setItem('
walk
_userData', '');
// location.replace('#/Author');
// // this.$router.push({name:"Author"})
// } else {
...
...
src/components/axios/url.js
View file @
af1b30e2
...
...
@@ -77,7 +77,7 @@ export default {
daka_records_detail
:
`
${
api
}
/api/v1/daka_records/detail`
,
// 25 规则详情
daka_rule
:
`
${
api
}
/api/v1/daka_rule`
,
// 26 红包 /api/v1/withdraw_img
// 26 红包 /api/v1/withdraw_img
withdraw_img
:
`
${
api
}
/api/v1/withdraw_img`
,
// 27 提现明细 /api/v1/withdraw_log
withdraw_log
:
`
${
api
}
/api/v1/withdraw_log`
,
...
...
src/main.js
View file @
af1b30e2
...
...
@@ -17,7 +17,7 @@ window.wx = wx;
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
// document.title = to.meta.title //修改各个页面的title
var
uid
=
localStorage
.
getItem
(
'
read
_userData'
);
var
uid
=
localStorage
.
getItem
(
'
walk
_userData'
);
if
(
location
.
search
.
match
(
/inviter/
))
{
let
searchs
=
location
.
search
.
split
(
'&'
);
let
search_obj
=
{};
...
...
src/views/Author.vue
View file @
af1b30e2
...
...
@@ -7,6 +7,11 @@
// var url = getToUrl();
export
default
{
name
:
"Author"
,
data
()
{
return
{
uid
:
""
};
},
created
()
{
document
.
title
=
"微信授权中"
;
var
code
=
this
.
GetUrlParame
(
"code"
);
// 截取code
...
...
@@ -14,18 +19,14 @@
if
(
!
code
)
{
let
local_hash
=
location
.
hash
;
window
.
localStorage
.
setItem
(
"local_hash"
,
local_hash
);
let
redirect_uri
=
encodeURIComponent
(
`
${
location
.
origin
}${
location
.
pathname
}
`
);
location
.
replace
(
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx9af64967a0d40159&redirect_uri=
${
redirect_uri
}
&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
);
let
redirect_uri
=
encodeURIComponent
(
`
${
location
.
origin
}${
location
.
pathname
}
`
);
location
.
replace
(
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx9af64967a0d40159&redirect_uri=
${
redirect_uri
}
&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
);
}
else
{
console
.
log
(
"拿到code"
,
code
);
console
.
log
(
"请求登录"
);
let
inviter
=
localStorage
.
getItem
(
"inviter"
);
var
uid
=
localStorage
.
getItem
(
'
read
_userData'
);
var
uid
=
localStorage
.
getItem
(
'
walk
_userData'
);
if
(
uid
&&
inviter
==
JSON
.
parse
(
uid
).
id
)
{
inviter
=
""
;
}
...
...
@@ -46,7 +47,7 @@
}
let
result
=
res
.
data
;
if
(
result
.
code
==
0
)
{
localStorage
.
setItem
(
"
read
_userData"
,
JSON
.
stringify
(
result
.
data
));
localStorage
.
setItem
(
"
walk
_userData"
,
JSON
.
stringify
(
result
.
data
));
sessionStorage
.
setItem
(
"new_user"
,
result
.
data
.
new_user
);
let
last_url
=
localStorage
.
getItem
(
"last_url"
)
||
"/"
;
let
url
=
location
.
href
.
split
(
"#"
)[
0
];
...
...
@@ -65,11 +66,6 @@
});
}
},
data
()
{
return
{
uid
:
""
};
},
methods
:
{
// 截取code
GetUrlParame
(
parameName
)
{
...
...
src/views/UserCenter.vue
View file @
af1b30e2
...
...
@@ -36,7 +36,7 @@
Title
},
created
()
{
let
userData
=
localStorage
.
getItem
(
"
read
_userData"
)
let
userData
=
localStorage
.
getItem
(
"
walk
_userData"
)
if
(
userData
)
{
this
.
userData
=
JSON
.
parse
(
userData
)
}
...
...
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