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
54f9d787
Commit
54f9d787
authored
Jan 16, 2026
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重定向页面
parent
9b3ff8f5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
10 deletions
+11
-10
.env.development
.env.development
+1
-0
.env.production
.env.production
+5
-4
UserService.ts
src/services/UserService.ts
+0
-1
Login.vue
src/views/auth/Login.vue
+3
-3
account.vue
src/views/personalCenter/accountPage/account.vue
+2
-2
No files found.
.env.development
View file @
54f9d787
...
@@ -3,6 +3,7 @@ VITE_OTA_API_BASE_URL=http://localhost:19002/api/app/
...
@@ -3,6 +3,7 @@ VITE_OTA_API_BASE_URL=http://localhost:19002/api/app/
VITE_ERP_API_BASE_URL=http://192.168.5.204/
VITE_ERP_API_BASE_URL=http://192.168.5.204/
VITE_FILEUPLOAD_API_BASE_URL=http://192.168.5.214:8120/
VITE_FILEUPLOAD_API_BASE_URL=http://192.168.5.214:8120/
VITE_FILEPREVIEW_API_BASE_URL=http://192.168.5.214:8130/
VITE_FILEPREVIEW_API_BASE_URL=http://192.168.5.214:8130/
VITE_APP_BASE_URL=http://localhost:8002
# 开发环境特定配置
# 开发环境特定配置
VITE_APP_TITLE=Ttenjoy (开发)
VITE_APP_TITLE=Ttenjoy (开发)
VITE_APP_VERSION=1.0.0-dev
VITE_APP_VERSION=1.0.0-dev
...
...
.env.production
View file @
54f9d787
# 生产环境配置
# 生产环境配置
VITE_OTA_API_BASE_URL=http://192.168.5.204:19001/api/app/
VITE_OTA_API_BASE_URL=http://byotaapi.oytour.com/api/app/
VITE_ERP_API_BASE_URL=http://192.168.5.214:8700/
VITE_ERP_API_BASE_URL=http://byapi.oytour.com/
VITE_FILEUPLOAD_API_BASE_URL=http://192.168.5.214:8120/
VITE_FILEUPLOAD_API_BASE_URL=https://upload.oytour.com/
VITE_FILEPREVIEW_API_BASE_URL=http://192.168.5.214:8130/
VITE_FILEPREVIEW_API_BASE_URL=http://imgfile.oytour.com/
VITE_APP_BASE_URL=ota.oytour.com
# 其他生产环境配置
# 其他生产环境配置
VITE_APP_TITLE=Ttenjoy
VITE_APP_TITLE=Ttenjoy
VITE_APP_VERSION=1.0.0
VITE_APP_VERSION=1.0.0
\ No newline at end of file
src/services/UserService.ts
View file @
54f9d787
...
@@ -268,7 +268,6 @@ export interface GeneralResponseDto {
...
@@ -268,7 +268,6 @@ export interface GeneralResponseDto {
*/
*/
export
interface
WechatAppIdResponseDto
{
export
interface
WechatAppIdResponseDto
{
appId
?:
string
appId
?:
string
redirectUri
?:
string
}
}
/**
/**
...
...
src/views/auth/Login.vue
View file @
54f9d787
...
@@ -222,7 +222,7 @@ const generateState = () => {
...
@@ -222,7 +222,7 @@ const generateState = () => {
// line授权登录
// line授权登录
const
loginWithLine
=
()
=>
{
const
loginWithLine
=
()
=>
{
const
channelId
=
openInfo
.
value
.
appId
;
// 替换为你的 LINE Channel ID
const
channelId
=
openInfo
.
value
.
appId
;
// 替换为你的 LINE Channel ID
const
redirectUri
=
encodeURIComponent
(
openInfo
.
value
.
redirectUri
||
'http://localhost:8002/login/3'
);
// 替换为你的重定向 URI
const
redirectUri
=
encodeURIComponent
(
`
${
import
.
meta
.
env
.
VITE_APP_BASE_URL
}
/login/3`
);
// 替换为你的重定向 URI
const
state
=
generateState
();
// 防止 CSRF 攻击,生成随机的 state 参数
const
state
=
generateState
();
// 防止 CSRF 攻击,生成随机的 state 参数
// 构造 LINE 授权 URL
// 构造 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`
;
const
lineLoginUrl
=
`https://access.line.me/oauth2/v2.1/authorize?response_type=code&client_id=
${
channelId
}
&redirect_uri=
${
redirectUri
}
&state=
${
state
}
&scope=openid%20profile`
;
...
@@ -252,7 +252,7 @@ const useLineLogin = async(code:string) => {
...
@@ -252,7 +252,7 @@ const useLineLogin = async(code:string) => {
}
}
// 微信授权登录
// 微信授权登录
const
loginWechat
=
()
=>
{
const
loginWechat
=
()
=>
{
const
redirect_url
=
openInfo
.
value
.
redirectUri
||
'http://localhost:8002/login/2'
const
redirect_url
=
`
${
import
.
meta
.
env
.
VITE_APP_BASE_URL
}
/login/2`
const
url
=
`https://open.weixin.qq.com/connect/qrconnect?appid=
${
openInfo
.
value
.
appId
}
&redirect_uri=
${
encodeURIComponent
(
redirect_url
)}
&response_type=code&scope=snsapi_login&state=
${
1
}
&wechat_redirect=
${
redirect_url
}
`
;
const
url
=
`https://open.weixin.qq.com/connect/qrconnect?appid=
${
openInfo
.
value
.
appId
}
&redirect_uri=
${
encodeURIComponent
(
redirect_url
)}
&response_type=code&scope=snsapi_login&state=
${
1
}
&wechat_redirect=
${
redirect_url
}
`
;
window
.
location
.
href
=
url
;
window
.
location
.
href
=
url
;
}
}
...
@@ -329,7 +329,7 @@ const loginHandler = async ({ values, errors }: any) => {
...
@@ -329,7 +329,7 @@ const loginHandler = async ({ values, errors }: any) => {
const
loginWithGoogle
=
()
=>
{
const
loginWithGoogle
=
()
=>
{
// 手动构建授权URL(适用于无第三方库的简单场景)
// 手动构建授权URL(适用于无第三方库的简单场景)
const
clientId
=
openInfo
.
value
.
appId
//'532164762940-vk65sge5jab1eq8mgbv1srh672ehnkff.apps.googleusercontent.com';
const
clientId
=
openInfo
.
value
.
appId
//'532164762940-vk65sge5jab1eq8mgbv1srh672ehnkff.apps.googleusercontent.com';
const
redirectUri
=
encodeURIComponent
(
openInfo
.
value
.
redirectUri
||
'http://localhost:8002/login/1'
);
// 必须与Google控制台配置的一致
const
redirectUri
=
encodeURIComponent
(
`
${
import
.
meta
.
env
.
VITE_APP_BASE_URL
}
/login/1`
);
// 必须与Google控制台配置的一致
const
scope
=
encodeURIComponent
(
'profile email'
);
// 请求的权限范围
const
scope
=
encodeURIComponent
(
'profile email'
);
// 请求的权限范围
const
authUrl
=
`https://accounts.google.com/o/oauth2/v2/auth?client_id=
${
clientId
}
&redirect_uri=
${
redirectUri
}
&response_type=code&scope=
${
scope
}
&access_type=offline`
;
const
authUrl
=
`https://accounts.google.com/o/oauth2/v2/auth?client_id=
${
clientId
}
&redirect_uri=
${
redirectUri
}
&response_type=code&scope=
${
scope
}
&access_type=offline`
;
window
.
location
.
href
=
authUrl
;
window
.
location
.
href
=
authUrl
;
...
...
src/views/personalCenter/accountPage/account.vue
View file @
54f9d787
...
@@ -240,7 +240,7 @@ const loginWithLine = () => {
...
@@ -240,7 +240,7 @@ const loginWithLine = () => {
// https://www.oytour.com/#/login/2/3
// https://www.oytour.com/#/login/2/3
console
.
log
(
openInfo
.
value
,
'----------'
)
console
.
log
(
openInfo
.
value
,
'----------'
)
// return
// return
const
redirectUri
=
encodeURIComponent
(
openInfo
.
value
.
redirectUri
||
'http://localhost:8002/personalCenter/accountCenter/account/3'
);
// 替换为你的重定向 URI
const
redirectUri
=
encodeURIComponent
(
`
${
import
.
meta
.
env
.
VITE_APP_BASE_URL
}
/personalCenter/accountCenter/account/3`
);
// 替换为你的重定向 URI
const
state
=
generateState
();
// 防止 CSRF 攻击,生成随机的 state 参数
const
state
=
generateState
();
// 防止 CSRF 攻击,生成随机的 state 参数
// 构造 LINE 授权 URL
// 构造 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`
;
const
lineLoginUrl
=
`https://access.line.me/oauth2/v2.1/authorize?response_type=code&client_id=
${
channelId
}
&redirect_uri=
${
redirectUri
}
&state=
${
state
}
&scope=openid%20profile`
;
...
@@ -267,7 +267,7 @@ const useLineBind = async(code:string) => {
...
@@ -267,7 +267,7 @@ const useLineBind = async(code:string) => {
}
}
// 微信授权
// 微信授权
const
loginWechat
=
()
=>
{
const
loginWechat
=
()
=>
{
const
redirect_url
=
openInfo
.
value
.
redirectUri
||
'https://www.oytour.com/#/login/2'
||
'http://localhost:8002/personalCenter/accountCenter/account/2'
const
redirect_url
=
`
${
import
.
meta
.
env
.
VITE_APP_BASE_URL
}
/personalCenter/accountCenter/account/2`
const
url
=
`https://open.weixin.qq.com/connect/qrconnect?appid=
${
openInfo
.
value
.
appId
}
&redirect_uri=
${
encodeURIComponent
(
redirect_url
)}
&response_type=code&scope=snsapi_login&state=
${
1
}
&wechat_redirect=
${
redirect_url
}
`
;
const
url
=
`https://open.weixin.qq.com/connect/qrconnect?appid=
${
openInfo
.
value
.
appId
}
&redirect_uri=
${
encodeURIComponent
(
redirect_url
)}
&response_type=code&scope=snsapi_login&state=
${
1
}
&wechat_redirect=
${
redirect_url
}
`
;
window
.
location
.
href
=
url
;
window
.
location
.
href
=
url
;
}
}
...
...
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