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
105ac837
Commit
105ac837
authored
Nov 25, 2025
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
6af1a7db
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
14 deletions
+28
-14
zh-CN.ts
src/i18n/locales/zh-CN.ts
+1
-0
user.ts
src/stores/user.ts
+1
-1
common.ts
src/utils/common.ts
+13
-0
Login.vue
src/views/auth/Login.vue
+12
-12
myOrder.vue
src/views/personalCenter/myOrder.vue
+1
-1
No files found.
src/i18n/locales/zh-CN.ts
View file @
105ac837
...
@@ -98,6 +98,7 @@ export default {
...
@@ -98,6 +98,7 @@ export default {
resetSuccess
:
'密码重置成功'
,
resetSuccess
:
'密码重置成功'
,
resetFailed
:
'密码重置失败'
,
resetFailed
:
'密码重置失败'
,
emailRequiredReset
:
'请输入邮箱'
,
emailRequiredReset
:
'请输入邮箱'
,
wechatLoginFailed
:
'微信登录失败'
,
},
},
common
:
{
common
:
{
language
:
'语言'
,
language
:
'语言'
,
...
...
src/stores/user.ts
View file @
105ac837
...
@@ -143,7 +143,7 @@ export const useUserStore = defineStore('user', {
...
@@ -143,7 +143,7 @@ export const useUserStore = defineStore('user', {
}
}
}
catch
(
error
:
any
)
{
}
catch
(
error
:
any
)
{
console
.
error
(
'Google login error:'
,
error
)
console
.
error
(
'Google login error:'
,
error
)
ResultMessage
.
Error
(
error
.
message
)
ResultMessage
.
Error
(
error
.
message
||
i18n
.
global
.
t
(
'login.wechatLoginFailed'
)
)
return
{
return
{
status
:
'ERROR'
,
status
:
'ERROR'
,
verify
:
false
verify
:
false
...
...
src/utils/common.ts
View file @
105ac837
...
@@ -435,3 +435,16 @@ export function enumToOptions<T extends Record<string, string | number>>(
...
@@ -435,3 +435,16 @@ export function enumToOptions<T extends Record<string, string | number>>(
value
:
value
as
T
[
keyof
T
],
value
:
value
as
T
[
keyof
T
],
}))
}))
}
}
export
function
query
(
url
?:
string
){
url
=
url
??
location
.
href
let
str
=
url
.
substr
(
url
.
indexOf
(
'?'
)
+
1
)
const
arr
=
str
.
split
(
'&'
)
let
json
=
{}
as
any
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
let
item
=
arr
[
i
].
split
(
'='
)
json
[
item
[
0
]]
=
item
[
1
]
}
return
json
}
src/views/auth/Login.vue
View file @
105ac837
...
@@ -139,10 +139,11 @@ import f from '@/assets/images/login/login_f.png'
...
@@ -139,10 +139,11 @@ import f from '@/assets/images/login/login_f.png'
import
G
from
'@/assets/images/login/login_G.png'
import
G
from
'@/assets/images/login/login_G.png'
import
tel
from
'@/assets/images/login/login_tel.png'
import
tel
from
'@/assets/images/login/login_tel.png'
import
line
from
'@/assets/images/login/login_line.png'
import
line
from
'@/assets/images/login/login_line.png'
import
{
query
}
from
'@/utils/common'
const
{
t
,
locale
}
=
useI18n
();
const
{
t
}
=
useI18n
();
const
userStore
=
useUserStore
()
const
userStore
=
useUserStore
()
const
systemConfigStore
=
useSystemConfigStore
()
const
systemConfigStore
=
useSystemConfigStore
()
...
@@ -150,6 +151,7 @@ const loading = ref(false)
...
@@ -150,6 +151,7 @@ const loading = ref(false)
const
router
=
useRouter
()
const
router
=
useRouter
()
const
googleButtonContainer
=
ref
(
null
);
const
googleButtonContainer
=
ref
(
null
);
const
loginMsg
=
reactive
({
const
loginMsg
=
reactive
({
tenantId
:
systemConfigStore
.
tenantId
||
null
,
tenantId
:
systemConfigStore
.
tenantId
||
null
,
reType
:
0
,
//登录方式 0账号密码 1谷歌授权 3LINE授权 7FaceBook授权
reType
:
0
,
//登录方式 0账号密码 1谷歌授权 3LINE授权 7FaceBook授权
...
@@ -213,11 +215,6 @@ const openInfo = ref({
...
@@ -213,11 +215,6 @@ const openInfo = ref({
openId
:
''
,
openId
:
''
,
})
})
// 获取微信登录OpenID
const
getOpenIdByCode
=
async
(
code
:
string
)
=>
{
console
.
log
(
code
,
'---------code'
)
// useWechatLogin(code)
}
// 获取微信登录AppID 域名 重定向页面
// 获取微信登录AppID 域名 重定向页面
const
getAppIdRedirectUri
=
async
()
=>
{
const
getAppIdRedirectUri
=
async
()
=>
{
...
@@ -248,7 +245,6 @@ const getAppIdRedirectUri = async () => {
...
@@ -248,7 +245,6 @@ const getAppIdRedirectUri = async () => {
const
useWechatLogin
=
async
(
code
:
string
)
=>
{
const
useWechatLogin
=
async
(
code
:
string
)
=>
{
loading
.
value
=
true
loading
.
value
=
true
try
{
try
{
// 获取授权码
const
response
=
await
userStore
.
setUserWechatLoginAsync
(
loginMsg
.
tenantId
?.
toString
()
||
''
,
code
,
loginMsg
.
distributorId
,
loginMsg
.
parentId
,
loginMsg
.
redirectUri
)
const
response
=
await
userStore
.
setUserWechatLoginAsync
(
loginMsg
.
tenantId
?.
toString
()
||
''
,
code
,
loginMsg
.
distributorId
,
loginMsg
.
parentId
,
loginMsg
.
redirectUri
)
if
(
response
.
status
==
'SUCCESS'
)
{
if
(
response
.
status
==
'SUCCESS'
)
{
Message
.
success
(
t
(
'login.loginSuccess'
))
Message
.
success
(
t
(
'login.loginSuccess'
))
...
@@ -389,7 +385,7 @@ const handleLogin = async () => {
...
@@ -389,7 +385,7 @@ const handleLogin = async () => {
// 初始化
// 初始化
const
init
=
async
()
=>
{
const
init
=
async
()
=>
{
// 如果已经登录且是正常
代理商,直接跳转到仪表盘
// 如果已经登录且是正常
用户,直接跳转到首页
if
(
userStore
.
getUserToken
&&
userStore
.
getUser
)
{
if
(
userStore
.
getUserToken
&&
userStore
.
getUser
)
{
router
.
replace
(
'/'
)
router
.
replace
(
'/'
)
}
}
...
@@ -398,15 +394,19 @@ const init = async () => {
...
@@ -398,15 +394,19 @@ const init = async () => {
init
()
init
()
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
const
queryParams
=
query
()
const
code
=
queryParams
.
code
if
(
code
)
{
console
.
log
(
queryParams
,
'---------code'
)
useWechatLogin
(
code
)
}
try
{
try
{
await
initGoogleSDK
();
await
initGoogleSDK
();
// 确保 SDK 加载完成后渲染按钮
// 确保 SDK 加载完成后渲染按钮
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
));
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
));
renderGoogleButton
()
renderGoogleButton
()
const
code
=
router
.
query
?.
code
||
null
if
(
code
)
{
getOpenIdByCode
(
code
)
}
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
error
(
'SDK 初始化失败:'
,
error
);
console
.
error
(
'SDK 初始化失败:'
,
error
);
...
...
src/views/personalCenter/myOrder.vue
View file @
105ac837
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
<div
class=
"flex justify-between items-center text-base relative"
>
<div
class=
"flex justify-between items-center text-base relative"
>
<div
class=
"flex"
>
<div
class=
"flex"
>
<div
v-for=
"(item,index) in orderList"
<div
v-for=
"(item,index) in orderList"
class=
"myOrder-status px-[13px] py-[22px] cursor-pointer relative
text-base
"
class=
"myOrder-status px-[13px] py-[22px] cursor-pointer relative"
:class=
"[currentStatus==item.value?'active font-medium':'font-light']"
:class=
"[currentStatus==item.value?'active font-medium':'font-light']"
@
click=
"changeStatus(item.value)"
>
{{
item
.
label
}}
@
click=
"changeStatus(item.value)"
>
{{
item
.
label
}}
<div
class=
"myOrder-status-border absolute left-0 bottom-0 w-full flex justify-center"
>
<div
class=
"myOrder-status-border absolute left-0 bottom-0 w-full flex justify-center"
>
...
...
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