Commit ef5bc19f by 陆志强

feat: 修复cname登录

parent c9138f5b
......@@ -173,6 +173,16 @@ export default {
// 云平台登录模块初始化
initLoginCenter() {
if (!window.LoginCenter) return
const isCname = !window.location.href.includes(
`//${process.env.CUSTOMER_DOMAIN}`
)
const state = isCname ? document.domain : ''
const wxPcRedirect = isCname
? window.location.href.replace(
/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62}|(:[0-9]{1,4}))+\.?/,
`${process.env.CUSTOMER_DOMAIN}`
)
: window.location.href
// eslint-disable-next-line no-undef
this.loginInstance = LoginCenter({
target: document.body,
......@@ -180,6 +190,8 @@ export default {
uin: this.$route.query.uin,
zIndex: 100000,
backUrl: encodeURIComponent(window.location.href),
wxPcRedirect,
state,
serviceAgreement: `//${process.env.OSS_DOMAIN}/staticPages/agreement_user.html`,
privacyAgreement: `//${process.env.OSS_DOMAIN}/staticPages/agreement_privacy.html`,
successCallback: ({ type, response }) => {
......
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 sign in to comment