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
7b04b7f8
Commit
7b04b7f8
authored
Nov 20, 2025
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
授权
parent
d4462fc9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
685 additions
and
90 deletions
+685
-90
index.html
index.html
+3
-0
zh-CN.ts
src/i18n/locales/zh-CN.ts
+1
-0
index.ts
src/router/index.ts
+6
-0
UserService.ts
src/services/UserService.ts
+23
-2
user.ts
src/stores/user.ts
+4
-4
Login.vue
src/views/auth/Login.vue
+96
-83
header.vue
src/views/auth/components/header.vue
+1
-1
register2.vue
src/views/auth/register2.vue
+551
-0
No files found.
index.html
View file @
7b04b7f8
...
...
@@ -4,6 +4,9 @@
<meta
charset=
"UTF-8"
/>
<link
rel=
"icon"
href=
"/favicon.ico"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<script
src=
"https://unpkg.com/vue@3/dist/vue.global.js"
></script>
<link
rel=
"stylesheet"
href=
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
>
<meta
http-equiv=
"Cross-Origin-Opener-Policy"
content=
"same-origin-allow-popups"
>
<title>
C-end
</title>
</head>
<body>
...
...
src/i18n/locales/zh-CN.ts
View file @
7b04b7f8
...
...
@@ -90,6 +90,7 @@ export default {
phoneCode
:
'区号'
,
googleLoginFailed
:
'谷歌登录失败'
,
isReceivePush
:
'「我同意接收优惠与电子报」'
,
loginTypeNotSupport
:
'暂未实现该登录方式'
,
},
common
:
{
language
:
'语言'
,
...
...
src/router/index.ts
View file @
7b04b7f8
...
...
@@ -23,6 +23,12 @@ const router = createRouter({
component
:
()
=>
import
(
"../views/auth/register.vue"
),
meta
:
{
title
:
"login.register"
},
},
{
path
:
"/login2"
,
name
:
"login2"
,
component
:
()
=>
import
(
"../views/auth/register2.vue"
),
meta
:
{
title
:
"login.register"
},
},
{
path
:
"/forgePassword"
,
name
:
"forgePassword"
,
...
...
src/services/UserService.ts
View file @
7b04b7f8
import
OtaRequest
from
'@/api/OtaRequest'
import
OtaRequest
,{
type
HttpResponse
}
from
'@/api/OtaRequest'
/**
* 用户服务 - 处理所有用户相关的 API 请求
...
...
@@ -395,7 +395,7 @@ export interface ResetPasswordResponseDto {
*/
class
UserService
{
/**
*
代理商自助
注册
* 注册
* @param data 注册信息
* @returns 注册响应
*/
...
...
@@ -446,6 +446,27 @@ class UserService {
)
return
response
as
unknown
as
DistributorLoginResultDto
}
/**
* 谷歌登录
* @param credential 谷歌token
* @returns
*/
static
async
GoogleLoginAsync
(
credential
:
string
):
Promise
<
HttpResponse
>
{
const
data
=
{
credential
}
// OtaRequest 的响应拦截器会返回 response.data
const
response
=
await
OtaRequest
.
post
(
'/member-auth/google-auth-bind'
,
data
,
{
headers
:
{
}
}
)
return
response
as
unknown
as
HttpResponse
}
/**
* 刷新访问令牌
...
...
src/stores/user.ts
View file @
7b04b7f8
...
...
@@ -111,8 +111,8 @@ export const useUserStore = defineStore('user', {
*/
async
setUserGoogleLoginAsync
(
credential
:
string
):
Promise
<
UserLoginResult
>
{
try
{
const
response
=
await
Erp
UserService
.
GoogleLoginAsync
(
credential
)
const
response
=
await
UserService
.
GoogleLoginAsync
(
credential
)
console
.
log
(
'Google login response:'
,
response
)
if
(
response
.
data
.
resultCode
===
ApiResult
.
SUCCESS
)
{
this
.
token
=
response
.
data
.
data
.
token
||
''
this
.
userInfo
=
response
.
data
.
data
||
{}
...
...
@@ -124,7 +124,7 @@ export const useUserStore = defineStore('user', {
data
:
response
.
data
.
data
}
}
else
{
ResultMessage
.
Error
(
response
.
data
.
message
||
i18n
.
global
.
t
(
'login.googleLoginFailed'
)
)
ResultMessage
.
Error
(
response
.
data
.
message
||
'谷歌登录失败'
)
return
{
status
:
'ERROR'
,
verify
:
false
...
...
@@ -132,7 +132,7 @@ export const useUserStore = defineStore('user', {
}
}
catch
(
error
:
any
)
{
console
.
error
(
'Google login error:'
,
error
)
ResultMessage
.
Error
(
error
.
message
||
i18n
.
global
.
t
(
'login.googleLoginFailed'
)
)
ResultMessage
.
Error
(
error
.
message
||
'谷歌登录失败'
)
return
{
status
:
'ERROR'
,
verify
:
false
...
...
src/views/auth/Login.vue
View file @
7b04b7f8
This diff is collapsed.
Click to expand it.
src/views/auth/components/header.vue
View file @
7b04b7f8
...
...
@@ -34,7 +34,7 @@ import { useRouter } from 'vue-router'
const
{
t
}
=
useI18n
();
const
systemConfigStore
=
useSystemConfigStore
()
const
currentStep
=
ref
(
inject
(
'currentStep'
))
const
currentStep
=
ref
(
inject
(
'currentStep'
)
??
0
)
const
router
=
useRouter
()
const
goHome
=
(
path
:
string
)
=>
{
...
...
src/views/auth/register2.vue
0 → 100644
View file @
7b04b7f8
This diff is collapsed.
Click to expand it.
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