Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
boyueCEnd
Project
Project
Details
Activity
Releases
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
游洁
boyueCEnd
Commits
f4387953
Commit
f4387953
authored
Dec 02, 2025
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
abda0016
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
29 deletions
+51
-29
en.ts
src/i18n/locales/en.ts
+3
-3
vi.ts
src/i18n/locales/vi.ts
+2
-2
zh-CN.ts
src/i18n/locales/zh-CN.ts
+3
-3
zh-TW.ts
src/i18n/locales/zh-TW.ts
+2
-2
account.vue
...views/personalCenter/components/accountCenter/account.vue
+41
-19
No files found.
src/i18n/locales/en.ts
View file @
f4387953
import
{
enCountries
}
from
'./countries'
import
{
enCountries
}
from
'./countries'
import
customFieldsEn
from
'./fields/custom-fields-en.json'
import
customFieldsEn
from
'./fields/custom-fields-en.json'
import
page
Fields
En
from
'./page/page-title-en.json'
import
page
Title
En
from
'./page/page-title-en.json'
export
default
{
export
default
{
// 国家名称(基于ISO2代码)
// 国家名称(基于ISO2代码)
...
@@ -256,6 +256,6 @@ export default {
...
@@ -256,6 +256,6 @@ export default {
// Custom form fields
// Custom form fields
...
customFieldsEn
,
...
customFieldsEn
,
// Page
form fields
// Page
title
...
page
Fields
En
,
...
page
Title
En
,
}
}
\ No newline at end of file
src/i18n/locales/vi.ts
View file @
f4387953
import
{
viCountries
}
from
'./countries'
import
{
viCountries
}
from
'./countries'
import
customFieldsVi
from
'./fields/custom-fields-vi.json'
import
customFieldsVi
from
'./fields/custom-fields-vi.json'
import
page
Fields
Vi
from
'./page/page-title-vi.json'
import
page
Title
Vi
from
'./page/page-title-vi.json'
export
default
{
export
default
{
// 国家名称(基于ISO2代码)
// 国家名称(基于ISO2代码)
...
@@ -257,5 +257,5 @@ export default {
...
@@ -257,5 +257,5 @@ export default {
// Trường biểu mẫu tùy chỉnh
// Trường biểu mẫu tùy chỉnh
...
customFieldsVi
,
...
customFieldsVi
,
// Các trang
// Các trang
...
page
Fields
Vi
,
...
page
Title
Vi
,
}
}
\ No newline at end of file
src/i18n/locales/zh-CN.ts
View file @
f4387953
import
{
zhCNCountries
}
from
'./countries'
import
{
zhCNCountries
}
from
'./countries'
import
customFieldsZhCN
from
'./fields/custom-fields-zh-CN.json'
import
customFieldsZhCN
from
'./fields/custom-fields-zh-CN.json'
import
page
Fields
ZhCN
from
'./page/page-title-zh-CN.json'
import
page
Title
ZhCN
from
'./page/page-title-zh-CN.json'
export
default
{
export
default
{
// 国家名称(基于ISO2代码)
// 国家名称(基于ISO2代码)
...
@@ -256,6 +256,6 @@ export default {
...
@@ -256,6 +256,6 @@ export default {
// 自定义表单字段
// 自定义表单字段
...
customFieldsZhCN
,
...
customFieldsZhCN
,
// 页面
表单字段
// 页面
标题
...
page
Fields
ZhCN
,
...
page
Title
ZhCN
,
}
}
\ No newline at end of file
src/i18n/locales/zh-TW.ts
View file @
f4387953
import
{
zhTWCountries
}
from
'./countries'
import
{
zhTWCountries
}
from
'./countries'
import
customFieldsZhTW
from
'./fields/custom-fields-zh-TW.json'
import
customFieldsZhTW
from
'./fields/custom-fields-zh-TW.json'
import
page
Fields
ZhTW
from
'./page/page-title-zh-TW.json'
import
page
Title
ZhTW
from
'./page/page-title-zh-TW.json'
export
default
{
export
default
{
// 国家名称(基于ISO2代码)
// 国家名称(基于ISO2代码)
...
@@ -256,5 +256,5 @@ export default {
...
@@ -256,5 +256,5 @@ export default {
// 自定義表單欄位
// 自定義表單欄位
...
customFieldsZhTW
,
...
customFieldsZhTW
,
// 頁面標題
// 頁面標題
...
page
Fields
ZhTW
,
...
page
Title
ZhTW
,
};
};
\ No newline at end of file
src/views/personalCenter/components/accountCenter/account.vue
View file @
f4387953
...
@@ -96,7 +96,7 @@
...
@@ -96,7 +96,7 @@
<div
class=
"customColor-text-7"
>
{{ t('personal.bindWechatTip') }}
</div>
<div
class=
"customColor-text-7"
>
{{ t('personal.bindWechatTip') }}
</div>
</div>
</div>
<div
class=
"flex-1 flex justify-end items-end"
>
<div
class=
"flex-1 flex justify-end items-end"
>
<a-button
@
click=
"WeChatInfor?unBindWeChatAccount(2):getAppIdRedirectUri()"
<a-button
@
click=
"WeChatInfor?unBindWeChatAccount(2):getAppIdRedirectUri(
providerTypeEnum.WECHAT.value
)"
type=
"primary"
type=
"primary"
size=
"large"
size=
"large"
class=
"acc-button !h-[34px] !rounded-[8px] !text-sm !px-[13px]"
>
class=
"acc-button !h-[34px] !rounded-[8px] !text-sm !px-[13px]"
>
...
@@ -143,7 +143,7 @@
...
@@ -143,7 +143,7 @@
<div
class=
"customColor-text-7"
>
{{ t('personal.bindLineTip') }}
</div>
<div
class=
"customColor-text-7"
>
{{ t('personal.bindLineTip') }}
</div>
</div>
</div>
<div
class=
"flex-1 flex justify-end items-end"
>
<div
class=
"flex-1 flex justify-end items-end"
>
<a-button
@
click=
"LnlineInfor?unBindWeChatAccount(3):
''
"
<a-button
@
click=
"LnlineInfor?unBindWeChatAccount(3):
getAppIdRedirectUri(providerTypeEnum.LINE.value)
"
type=
"primary"
type=
"primary"
size=
"large"
size=
"large"
class=
"acc-button !h-[34px] !rounded-[8px] !text-sm !px-[13px]"
>
class=
"acc-button !h-[34px] !rounded-[8px] !text-sm !px-[13px]"
>
...
@@ -234,23 +234,49 @@ const getPersonalInfor = async () => {
...
@@ -234,23 +234,49 @@ const getPersonalInfor = async () => {
const
response
=
await
UserService
.
memberCenterAsync
(
systemConfig
.
tenantId
)
const
response
=
await
UserService
.
memberCenterAsync
(
systemConfig
.
tenantId
)
userStore
.
updateProfile
(
response
)
userStore
.
updateProfile
(
response
)
}
}
// 获取微信绑定AppID 域名 重定向页面
const
getAppIdRedirectUri
=
async
()
=>
{
// 随机生成 state 参数
const
generateState
=
()
=>
{
return
Math
.
random
().
toString
(
36
).
substring
(
2
);
// 简单的生成随机字符串
}
// line授权
const
loginWithLine
=
()
=>
{
const
channelId
=
openInfo
.
value
.
appId
;
// 替换为你的 LINE Channel ID
const
redirectUri
=
encodeURIComponent
(
openInfo
.
value
.
redirectUri
||
'https://www.oytour.com/#/login'
);
// 替换为你的重定向 URI
const
state
=
generateState
();
// 防止 CSRF 攻击,生成随机的 state 参数
// 构造 LINE 授权 URL
const
lineLoginUrl
=
`https://access.line.me/oauth2/v2.1/authorize?response_type=code&client_id=
${
channelId
}
&redirect_uri=
${
redirectUri
}
&state=
${
state
}
&scope=openid%20profile`
;
// 跳转到 LINE 登录页面
window
.
location
.
href
=
lineLoginUrl
;
}
// 微信授权登录
const
loginWechat
=
()
=>
{
const
redirect_url
=
openInfo
.
value
.
redirectUri
||
'https://www.oytour.com/#/login'
const
url
=
`https://open.weixin.qq.com/connect/qrconnect?appid=
${
appId
}
&redirect_uri=
${
encodeURIComponent
(
redirect_url
)}
&response_type=code&scope=snsapi_login&state=
${
1
}
&wechat_redirect=
${
redirect_url
}
`
;
window
.
location
.
href
=
url
;
}
// 获取绑定AppID 域名 重定向页面
const
getAppIdRedirectUri
=
async
(
providerType
:
string
)
=>
{
// const { AppID, State, OpenRedirectUri } = openInfo.value;
// const { AppID, State, OpenRedirectUri } = openInfo.value;
// let redirect_uri = OpenRedirectUri;
// let redirect_uri = OpenRedirectUri;
// const url = `https://open.weixin.qq.com/connect/qrconnect?appid=${AppID}&redirect_uri=${encodeURIComponent('https://www.oytour.com/#/login')}&response_type=code&scope=snsapi_login&state=${State}&wechat_redirect=${redirect_uri}`;
// const url = `https://open.weixin.qq.com/connect/qrconnect?appid=${AppID}&redirect_uri=${encodeURIComponent('https://www.oytour.com/#/login')}&response_type=code&scope=snsapi_login&state=${State}&wechat_redirect=${redirect_uri}`;
// window.location.href = url;
// window.location.href = url;
// return
loading
.
value
=
true
loading
.
value
=
true
try
{
try
{
// 获取微信绑定AppID 域名
// 获取微信绑定AppID 域名
const
response
=
await
userStore
.
getUserWechatAppIdAsync
(
systemConfig
.
tenantId
?.
toString
()
||
''
,
providerType
Enum
.
WECHAT
.
value
)
const
response
=
await
userStore
.
getUserWechatAppIdAsync
(
systemConfig
.
tenantId
?.
toString
()
||
''
,
providerType
)
if
(
response
.
status
==
'SUCCESS'
)
{
if
(
response
.
status
==
'SUCCESS'
)
{
openInfo
.
value
=
response
.
data
[
0
]
openInfo
.
value
=
response
.
data
[
0
]
const
{
appId
,
redirectUri
}
=
openInfo
.
value
;
if
(
openInfo
.
value
?.
appId
){
const
redirect_url
=
redirectUri
?
redirectUri
:
'https://www.oytour.com/#/login'
console
.
log
(
openInfo
.
value
,
'----------'
)
const
url
=
`https://open.weixin.qq.com/connect/qrconnect?appid=
${
appId
}
&redirect_uri=
${
encodeURIComponent
(
redirect_url
)}
&response_type=code&scope=snsapi_login&state=
${
1
}
&wechat_redirect=
${
redirect_url
}
`
;
if
(
providerType
==
providerTypeEnum
.
WECHAT
.
value
){
window
.
location
.
href
=
url
;
loginWechat
()
}
else
if
(
providerType
==
providerTypeEnum
.
GOOGLE
.
value
){
renderGoogleButton
(
openInfo
.
value
.
appId
)
}
else
if
(
providerType
==
providerTypeEnum
.
LINE
.
value
){
loginWithLine
()
}
}
}
}
}
catch
(
error
:
any
)
{
}
catch
(
error
:
any
)
{
Message
.
error
(
error
.
message
)
Message
.
error
(
error
.
message
)
...
@@ -277,12 +303,12 @@ const useWechatBind = async(code:string) => {
...
@@ -277,12 +303,12 @@ const useWechatBind = async(code:string) => {
}
}
}
}
// 渲染 Google
登录
按钮
// 渲染 Google 按钮
const
renderGoogleButton
=
()
=>
{
const
renderGoogleButton
=
(
client_id
:
string
)
=>
{
try
{
try
{
// 渲染 Google
登录
按钮
// 渲染 Google 按钮
window
.
google
.
accounts
.
id
.
initialize
({
window
.
google
.
accounts
.
id
.
initialize
({
client_id
:
'532164762940-vk65sge5jab1eq8mgbv1srh672ehnkff.apps.googleusercontent.com'
,
client_id
,
// '532164762940-vk65sge5jab1eq8mgbv1srh672ehnkff.apps.googleusercontent.com'
callback
:
handleSignInSuccess
,
callback
:
handleSignInSuccess
,
error_callback
:
handleSignInError
,
error_callback
:
handleSignInError
,
ux_mode
:
'popup'
// 可选:popup/redirect
ux_mode
:
'popup'
// 可选:popup/redirect
...
@@ -293,10 +319,6 @@ const renderGoogleButton = () => {
...
@@ -293,10 +319,6 @@ const renderGoogleButton = () => {
{
theme
:
'outline'
,
size
:
'large'
}
{
theme
:
'outline'
,
size
:
'large'
}
);
);
// window.google.accounts.id.configure({
// language: locale.value // 支持的语言代码
// });
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
'Error rendering Google Sign-In button:'
,
error
);
console
.
error
(
'Error rendering Google Sign-In button:'
,
error
);
}
}
...
@@ -353,7 +375,7 @@ onMounted(async () => {
...
@@ -353,7 +375,7 @@ onMounted(async () => {
await
initGoogleSDK
();
await
initGoogleSDK
();
// 确保 SDK 加载完成后渲染按钮
// 确保 SDK 加载完成后渲染按钮
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
));
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
));
renderGoogleButton
(
)
getAppIdRedirectUri
(
providerTypeEnum
.
GOOGLE
.
value
)
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
...
...
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