mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-06-21 17:40:25 +08:00
适配 all-in-one lite 前端运行
This commit is contained in:
@@ -226,7 +226,11 @@ export default {
|
|||||||
this.$refs[name].validate((valid) => {
|
this.$refs[name].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.type) {
|
if (this.type) {
|
||||||
this.$refs.verify.init();
|
if (this.loginCaptchaBypassEnabled()) {
|
||||||
|
this.verifyChange({status: true});
|
||||||
|
} else {
|
||||||
|
this.$refs.verify.init();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
let data = JSON.parse(JSON.stringify(this.formSms));
|
let data = JSON.parse(JSON.stringify(this.formSms));
|
||||||
apiLogin.smsLogin(data).then((res) => {
|
apiLogin.smsLogin(data).then((res) => {
|
||||||
@@ -325,9 +329,16 @@ export default {
|
|||||||
// 开启滑块验证
|
// 开启滑块验证
|
||||||
verifyBtnClick() {
|
verifyBtnClick() {
|
||||||
if (!this.verifyStatus) {
|
if (!this.verifyStatus) {
|
||||||
|
if (this.loginCaptchaBypassEnabled()) {
|
||||||
|
this.verifyStatus = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$refs.verify.init();
|
this.$refs.verify.init();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
loginCaptchaBypassEnabled() {
|
||||||
|
return typeof BASE !== "undefined" && (BASE.LOGIN_CAPTCHA_BYPASS === true || BASE.LOGIN_CAPTCHA_BYPASS === "true");
|
||||||
|
},
|
||||||
handleWebLogin(type) {
|
handleWebLogin(type) {
|
||||||
// 第三方登录
|
// 第三方登录
|
||||||
webLogin(type);
|
webLogin(type);
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
|
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
|
||||||
<script type="text/javascript" src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
|
<script type="text/javascript" src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
<script type="text/javascript" src="<%= BASE_URL %>config.local.js"></script>
|
||||||
<!-- built files will be auto injected -->
|
<!-- built files will be auto injected -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -10,21 +10,33 @@
|
|||||||
* 默认.env 文件中的变量作为开发环境的环境变量。
|
* 默认.env 文件中的变量作为开发环境的环境变量。
|
||||||
* env文件修改的话需要重新编译项目。
|
* env文件修改的话需要重新编译项目。
|
||||||
*/
|
*/
|
||||||
|
const runtimeBase = typeof window !== "undefined" && window.BASE ? window.BASE : {};
|
||||||
|
const apiDev = runtimeBase.API_DEV || {};
|
||||||
|
const apiProd = runtimeBase.API_PROD || {};
|
||||||
|
const runtimeApi = apiProd.common || apiDev.common || "";
|
||||||
|
|
||||||
|
const normalizeUrl = (url) => {
|
||||||
|
if (!url) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return url.endsWith("/") ? url : `${url}/`;
|
||||||
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// 网站名称
|
// 网站名称
|
||||||
WEBSITE_NAME: process.env.VUE_APP_WEBSITE_NAME || "LiLi IM",
|
WEBSITE_NAME: process.env.VUE_APP_WEBSITE_NAME || "LiLi IM",
|
||||||
// 默认请求IM的API
|
// 默认请求IM的API
|
||||||
BASE_API_URL: process.env.VUE_APP_API_BASE_URL || "",
|
BASE_API_URL: runtimeApi || process.env.VUE_APP_API_BASE_URL || "",
|
||||||
// 默认请求的WS
|
// 默认请求的WS
|
||||||
BASE_WS_URL: process.env.VUE_APP_WEB_SOCKET_URL || "",
|
BASE_WS_URL: runtimeBase.IM_WS_URL || process.env.VUE_APP_WEB_SOCKET_URL || "",
|
||||||
// 默认请求公有接口相关 API
|
// 默认请求公有接口相关 API
|
||||||
BASE_COMMON: process.env.VUE_APP_COMMON || "",
|
BASE_COMMON: apiProd.common || apiDev.common || process.env.VUE_APP_COMMON || "",
|
||||||
// 默认请求用户相关API
|
// 默认请求用户相关API
|
||||||
BASE_BUYER: process.env.VUE_APP_BUYER || "",
|
BASE_BUYER: apiProd.buyer || apiDev.buyer || process.env.VUE_APP_BUYER || "",
|
||||||
// 默认请求卖家相关的API
|
// 默认请求卖家相关的API
|
||||||
BASE_SELLER: process.env.VUE_APP_SELLER || "",
|
BASE_SELLER: apiProd.seller || apiDev.seller || process.env.VUE_APP_SELLER || "",
|
||||||
// 点击商品跳转到的地址
|
// 点击商品跳转到的地址
|
||||||
PC_URL: process.env.VUE_APP_PC_URL || "https://pc-b2b2c.pickmall.cn",
|
PC_URL: normalizeUrl(runtimeBase.PC_URL || process.env.VUE_APP_PC_URL || "https://pc-b2b2c.pickmall.cn"),
|
||||||
// 订单跳转商家订单页面
|
// 订单跳转商家订单页面
|
||||||
PC_STORE: process.env.VUE_APP_PC_STORE || 'https://store-b2b2c.pickmall.cn',
|
PC_STORE: normalizeUrl(runtimeBase.PC_STORE || process.env.VUE_APP_PC_STORE || "https://store-b2b2c.pickmall.cn"),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -132,7 +132,11 @@ export default {
|
|||||||
// 登录操作
|
// 登录操作
|
||||||
this.$refs.usernameLoginForm.validate((valid) => {
|
this.$refs.usernameLoginForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$refs.verify.init();
|
if (this.loginCaptchaBypassEnabled()) {
|
||||||
|
this.verifyChange({ status: true });
|
||||||
|
} else {
|
||||||
|
this.$refs.verify.init();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -155,9 +159,12 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
this.$refs.verify.show = false;
|
this.$refs.verify.show = false;
|
||||||
},
|
},
|
||||||
|
loginCaptchaBypassEnabled() {
|
||||||
|
return typeof BASE !== "undefined" && (BASE.LOGIN_CAPTCHA_BYPASS === true || BASE.LOGIN_CAPTCHA_BYPASS === "true");
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -216,7 +216,11 @@ export default {
|
|||||||
if (this.loginType == 'passwordLogin') {
|
if (this.loginType == 'passwordLogin') {
|
||||||
this.$refs.usernameLoginForm.validate((valid) => {
|
this.$refs.usernameLoginForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$refs.verify.init();
|
if (this.loginCaptchaBypassEnabled()) {
|
||||||
|
this.verifyChange({ status: true });
|
||||||
|
} else {
|
||||||
|
this.$refs.verify.init();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (this.loginType == 'mobileLogin') {
|
} else if (this.loginType == 'mobileLogin') {
|
||||||
@@ -268,9 +272,16 @@ export default {
|
|||||||
// 开启滑块验证
|
// 开启滑块验证
|
||||||
verifyBtnClick() {
|
verifyBtnClick() {
|
||||||
if (!this.verifyStatus) {
|
if (!this.verifyStatus) {
|
||||||
|
if (this.loginCaptchaBypassEnabled()) {
|
||||||
|
this.verifyStatus = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$refs.verify.init();
|
this.$refs.verify.init();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
loginCaptchaBypassEnabled() {
|
||||||
|
return typeof BASE !== "undefined" && (BASE.LOGIN_CAPTCHA_BYPASS === true || BASE.LOGIN_CAPTCHA_BYPASS === "true");
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user