Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
libai
/
footseen-large-website
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3d774a40
authored
Jun 20, 2022
by
libai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试
parent
b9218d04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
14 deletions
yazhaiTest/lib/login.js
yazhaiTest/lib/login.js
View file @
3d774a40
...
@@ -5,7 +5,7 @@ function loginGo(){
...
@@ -5,7 +5,7 @@ function loginGo(){
html
+=
' <div style="display: none;" class="login-box1">'
;
html
+=
' <div style="display: none;" class="login-box1">'
;
html
+=
' <div class="login-title">登入</div>'
;
html
+=
' <div class="login-title">登入</div>'
;
html
+=
' <div class="phone-login-btn"></div>'
;
html
+=
' <div class="phone-login-btn"></div>'
;
html
+=
' <div class="google-login-btn"
data-type="icon" id="buttonDiv"
></div>'
;
html
+=
' <div class="google-login-btn"
id="g_id_onload"data-client_id="534183685500-ag0vai0jh6todldi4rg6lvp0gcsojk0n.apps.googleusercontent.com" data-callback="handleCredentialResponse">
></div>'
;
html
+=
' <div class="more-login"><img src="https://www.footseen.xyz/yazhaiTest/images/more-login.png" alt=""></div>'
;
html
+=
' <div class="more-login"><img src="https://www.footseen.xyz/yazhaiTest/images/more-login.png" alt=""></div>'
;
html
+=
' <div class="more-login-box">'
;
html
+=
' <div class="more-login-box">'
;
html
+=
' <div class="more-login-icon"><img src="https://www.footseen.xyz/yazhaiTest/images/login-icon2.png" alt=""></div>'
;
html
+=
' <div class="more-login-icon"><img src="https://www.footseen.xyz/yazhaiTest/images/login-icon2.png" alt=""></div>'
;
...
@@ -126,19 +126,31 @@ function loginGo(){
...
@@ -126,19 +126,31 @@ function loginGo(){
html
+=
'</div>'
;
html
+=
'</div>'
;
$
(
".login-content"
).
html
(
html
);
$
(
".login-content"
).
html
(
html
);
function
handleCredentialResponse
(
response
)
{
function
handleCredentialResponse
(
response
)
{
console
.
log
(
"Encoded JWT ID token: "
+
response
.
credential
);
// decodeJwtResponse() is a custom function defined by you
}
// to decode the credential response.
window
.
onload
=
function
()
{
const
responsePayload
=
decodeJwtResponse
(
response
.
credential
);
google
.
accounts
.
id
.
initialize
({
client_id
:
"534183685500-ag0vai0jh6todldi4rg6lvp0gcsojk0n.apps.googleusercontent.com"
,
console
.
log
(
"ID: "
+
responsePayload
.
sub
);
callback
:
handleCredentialResponse
console
.
log
(
'Full Name: '
+
responsePayload
.
name
);
});
console
.
log
(
'Given Name: '
+
responsePayload
.
given_name
);
google
.
accounts
.
id
.
renderButton
(
console
.
log
(
'Family Name: '
+
responsePayload
.
family_name
);
document
.
getElementById
(
"buttonDiv"
),
console
.
log
(
"Image URL: "
+
responsePayload
.
picture
);
{
theme
:
"outline"
,
size
:
"390px"
,
}
// customization attributes
console
.
log
(
"Email: "
+
responsePayload
.
email
);
);
}
google
.
accounts
.
id
.
prompt
();
// also display the One Tap dialog
// function handleCredentialResponse(response) {
}
// console.log("Encoded JWT ID token: " + response.credential);
// }
// window.onload = function () {
// google.accounts.id.initialize({
// client_id: "534183685500-ag0vai0jh6todldi4rg6lvp0gcsojk0n.apps.googleusercontent.com",
// callback: handleCredentialResponse
// });
// google.accounts.id.renderButton(
// document.getElementById("buttonDiv"),
// { theme: "outline", size: "390px", } // customization attributes
// );
// google.accounts.id.prompt(); // also display the One Tap dialog
// }
var
html
=
[];
var
html
=
[];
html
+=
'<div style="display: none;" class=nav-login-btn>登入/註冊</div>'
;
html
+=
'<div style="display: none;" class=nav-login-btn>登入/註冊</div>'
;
...
...
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