Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
techbook
Project
Project
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
front-end-dev
techbook
Commits
2e328be8
Commit
2e328be8
authored
Mar 04, 2021
by
zhangyanni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录-去#试一下console
parent
dd42be55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
40 deletions
+40
-40
newPage.vue
src/views/mobile/loginregister/newPage.vue
+40
-40
No files found.
src/views/mobile/loginregister/newPage.vue
View file @
2e328be8
...
...
@@ -19,7 +19,7 @@
})
console
.
log
(
val
)
console
.
log
(
arr
)
window
.
location
.
href
=
document
.
location
.
origin
+
"/newPage?code="
+
arr
[
0
]
+
"&state="
+
arr
[
1
];
//
window.location.href = document.location.origin+"/newPage?code="+arr[0]+"&state="+arr[1];
console
.
log
(
document
.
location
.
origin
)
console
.
log
(
document
.
location
.
origin
+
"/newPage?code="
+
arr
[
0
]
+
"&state="
+
arr
[
1
])
// if(document.location.href.split("#")[0].indexOf("index.html")>-1){
...
...
@@ -28,45 +28,45 @@
// window.location.href = document.location.href.split("/#")[0].split("?")[0]+"/#/newPage?code="+arr[0]+"&state="+arr[1];
// }
var
_this
=
this
;
//
setTimeout(function(){
//
if(arr[0]!=null||arr[0]!=undefined){
//
let params = {
//
code:arr[0],
//
state:arr[1]
//
}
//
api.wechatLoginAxios(params).then((res)=>{
//
if(res.code==0){
//
console.log("调借口了")
//
if(res.result!=null){
//
console.log("进来1")
//
if(_this.publicFun.getUserInfoCookieType()){
//
_this.publicFun.removeCookieType();
//
}
//
_this.publicFun.setUserInfoCookieType(that.Base64.encode(JSON.stringify(res.result)));
//
globalMsg.$emit("getUserInfo");
//
_this.$router.push("/index");
//
_this.publicFun.setUserInfoCookie("selected","index");
//
globalMsg.$emit("sendSelected","index");
//
} else{
//
console.log("进来2")
//
if(res.msg!=null){
//
console.log("进来3")
//
that.$router.push({path:"/bindAccount",query:{id:res.msg}});
//
}else{
//
window.location.href = document.location.origin+"/loginByPhone";
//
}
//
}
//
}else{
//
that.$toast(res.msg);
//
}
//
}).catch((err)=>{
//
that.$toast(err);
//
})
//
}else{
//
// var dataUrl = document.location.href.split("#/")[0]+"#/newPage";
//
// window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx725d0e129f703106&redirect_uri="+encodeURIComponent(dataUrl)+"&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
//
}
//
},2000)
setTimeout
(
function
(){
if
(
arr
[
0
]
!=
null
||
arr
[
0
]
!=
undefined
){
let
params
=
{
code
:
arr
[
0
],
state
:
arr
[
1
]
}
api
.
wechatLoginAxios
(
params
).
then
((
res
)
=>
{
if
(
res
.
code
==
0
){
console
.
log
(
"调借口了"
)
if
(
res
.
result
!=
null
){
console
.
log
(
"进来1"
)
if
(
_this
.
publicFun
.
getUserInfoCookieType
()){
_this
.
publicFun
.
removeCookieType
();
}
_this
.
publicFun
.
setUserInfoCookieType
(
that
.
Base64
.
encode
(
JSON
.
stringify
(
res
.
result
)));
globalMsg
.
$emit
(
"getUserInfo"
);
_this
.
$router
.
push
(
"/index"
);
_this
.
publicFun
.
setUserInfoCookie
(
"selected"
,
"index"
);
globalMsg
.
$emit
(
"sendSelected"
,
"index"
);
}
else
{
console
.
log
(
"进来2"
)
if
(
res
.
msg
!=
null
){
console
.
log
(
"进来3"
)
that
.
$router
.
push
({
path
:
"/bindAccount"
,
query
:{
id
:
res
.
msg
}});
}
else
{
window
.
location
.
href
=
document
.
location
.
origin
+
"/loginByPhone"
;
}
}
}
else
{
that
.
$toast
(
res
.
msg
);
}
}).
catch
((
err
)
=>
{
that
.
$toast
(
err
);
})
}
else
{
// var dataUrl = document.location.href.split("#/")[0]+"#/newPage";
// window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx725d0e129f703106&redirect_uri="+encodeURIComponent(dataUrl)+"&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
}
},
2000
)
}
...
...
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