Commit 2cf87124 authored by youjie's avatar youjie

重定向

parent 87b9e1e9
# 生产环境配置 # 生产环境配置
VITE_OTA_API_BASE_URL=http://byotaapi.oytour.com/api/app/ VITE_OTA_API_BASE_URL=http://byotaapi.oytour.com/api/app/
VITE_OTA_API_BASE_URLS=https://byotaapi.oytour.com/api/app/
VITE_ERP_API_BASE_URL=http://byapi.oytour.com/ VITE_ERP_API_BASE_URL=http://byapi.oytour.com/
VITE_FILEUPLOAD_API_BASE_URL=https://upload.oytour.com/ VITE_FILEUPLOAD_API_BASE_URL=https://upload.oytour.com/
VITE_FILEPREVIEW_API_BASE_URL=http://imgfile.oytour.com/ VITE_FILEPREVIEW_API_BASE_URL=http://imgfile.oytour.com/
VITE_APP_BASE_URL=http://ota.oytour.com VITE_APP_BASE_URL=http://ota.oytour.com
VITE_APP_BASE_URLS=https://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
...@@ -15,8 +15,9 @@ export interface HttpResponse<T = any> extends Record<string, any> { ...@@ -15,8 +15,9 @@ export interface HttpResponse<T = any> extends Record<string, any> {
} }
// 创建 axios 实例 // 创建 axios 实例
const baseURL = window.location.href.includes('https://') ? import.meta.env.VITE_OTA_API_BASE_URLS : import.meta.env.VITE_OTA_API_BASE_URL;
const service = axios.create({ const service = axios.create({
baseURL: import.meta.env.VITE_OTA_API_BASE_URL, baseURL: baseURL,
timeout: 1000 * 60 timeout: 1000 * 60
}); });
......
This image diff could not be displayed because it is too large. You can view the blob instead.
...@@ -96,8 +96,8 @@ ...@@ -96,8 +96,8 @@
flex items-center justify-center cursor-pointer loginForm-item" flex items-center justify-center cursor-pointer loginForm-item"
:class="[loginMsg.reType==method.key?'loginForm-itemActive':'']" :class="[loginMsg.reType==method.key?'loginForm-itemActive':'']"
@click="toggleLoginType(method.key)"> @click="toggleLoginType(method.key)">
<img v-if="method.url" :src="method.url" alt="" class="w-[14px] h-[14px]"/> <img v-if="method.url" :src="method.url" alt="" class="w-[16px] h-[14px]"/>
<icon-wechat v-if="method.icon=='icon-wechat'" size="18" class="!text-[#03DA6B]"/> <icon-wechat v-if="!method.url&&method.icon=='icon-wechat'" size="18" class="!text-[#03DA6B]"/>
</div> </div>
</template> </template>
</div> </div>
...@@ -124,6 +124,7 @@ import { Message } from '@arco-design/web-vue' ...@@ -124,6 +124,7 @@ import { Message } from '@arco-design/web-vue'
import loginHeader from "./components/header.vue"; import loginHeader from "./components/header.vue";
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 wx from '@/assets/images/login/login_wx.png'
import eml from '@/assets/images/login/login_eml.png' import eml from '@/assets/images/login/login_eml.png'
import line from '@/assets/images/login/login_line.png' import line from '@/assets/images/login/login_line.png'
import { query } from '@/utils/common' import { query } from '@/utils/common'
...@@ -183,7 +184,7 @@ const loginMethods = ref([ ...@@ -183,7 +184,7 @@ const loginMethods = ref([
{ {
label: 'wechat', label: 'wechat',
key: 2, key: 2,
url: '', url: wx,
icon: 'icon-wechat' icon: 'icon-wechat'
}, },
{ {
......
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
</div> </div>
</div> </div>
<div class="flex justify-center text-white text-[16px]"> <div class="flex justify-center text-white text-[16px]">
<div class="px-[17px] pt-[40px] pb-[20px] cursor-pointer" @click="goHome('/')">{{ t('login.backToHome') }}</div> <div class="px-[17px] pt-[40px] pb-[10px] cursor-pointer" @click="goHome('/')">{{ t('login.backToHome') }}</div>
</div> </div>
</div> </div>
<registerSuccess v-if="currentStep==3" /> <registerSuccess v-if="currentStep==3" />
......
...@@ -240,7 +240,8 @@ const loginWithLine = () => { ...@@ -240,7 +240,8 @@ 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(`${import.meta.env.VITE_APP_BASE_URL}/personalCenter/accountCenter/account/3`); // 替换为你的重定向 URI const URL = window.location.href.includes('https://') ? import.meta.env.VITE_APP_BASE_URLS : import.meta.env.VITE_APP_BASE_URL;
const redirectUri = encodeURIComponent(`${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`;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment