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) => {
|
||||
if (valid) {
|
||||
if (this.type) {
|
||||
if (this.loginCaptchaBypassEnabled()) {
|
||||
this.verifyChange({status: true});
|
||||
} else {
|
||||
this.$refs.verify.init();
|
||||
}
|
||||
} else {
|
||||
let data = JSON.parse(JSON.stringify(this.formSms));
|
||||
apiLogin.smsLogin(data).then((res) => {
|
||||
@@ -325,9 +329,16 @@ export default {
|
||||
// 开启滑块验证
|
||||
verifyBtnClick() {
|
||||
if (!this.verifyStatus) {
|
||||
if (this.loginCaptchaBypassEnabled()) {
|
||||
this.verifyStatus = true;
|
||||
return;
|
||||
}
|
||||
this.$refs.verify.init();
|
||||
}
|
||||
},
|
||||
loginCaptchaBypassEnabled() {
|
||||
return typeof BASE !== "undefined" && (BASE.LOGIN_CAPTCHA_BYPASS === true || BASE.LOGIN_CAPTCHA_BYPASS === "true");
|
||||
},
|
||||
handleWebLogin(type) {
|
||||
// 第三方登录
|
||||
webLogin(type);
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
<% 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="<%= BASE_URL %>config.local.js"></script>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -10,21 +10,33 @@
|
||||
* 默认.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 {
|
||||
// 网站名称
|
||||
WEBSITE_NAME: process.env.VUE_APP_WEBSITE_NAME || "LiLi IM",
|
||||
// 默认请求IM的API
|
||||
BASE_API_URL: process.env.VUE_APP_API_BASE_URL || "",
|
||||
BASE_API_URL: runtimeApi || process.env.VUE_APP_API_BASE_URL || "",
|
||||
// 默认请求的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
|
||||
BASE_COMMON: process.env.VUE_APP_COMMON || "",
|
||||
BASE_COMMON: apiProd.common || apiDev.common || process.env.VUE_APP_COMMON || "",
|
||||
// 默认请求用户相关API
|
||||
BASE_BUYER: process.env.VUE_APP_BUYER || "",
|
||||
BASE_BUYER: apiProd.buyer || apiDev.buyer || process.env.VUE_APP_BUYER || "",
|
||||
// 默认请求卖家相关的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,8 +132,12 @@ export default {
|
||||
// 登录操作
|
||||
this.$refs.usernameLoginForm.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.loginCaptchaBypassEnabled()) {
|
||||
this.verifyChange({ status: true });
|
||||
} else {
|
||||
this.$refs.verify.init();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
verifyChange(con) {
|
||||
@@ -158,6 +162,9 @@ export default {
|
||||
});
|
||||
this.$refs.verify.show = false;
|
||||
},
|
||||
loginCaptchaBypassEnabled() {
|
||||
return typeof BASE !== "undefined" && (BASE.LOGIN_CAPTCHA_BYPASS === true || BASE.LOGIN_CAPTCHA_BYPASS === "true");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -216,8 +216,12 @@ export default {
|
||||
if (this.loginType == 'passwordLogin') {
|
||||
this.$refs.usernameLoginForm.validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.loginCaptchaBypassEnabled()) {
|
||||
this.verifyChange({ status: true });
|
||||
} else {
|
||||
this.$refs.verify.init();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (this.loginType == 'mobileLogin') {
|
||||
this.$refs['formSms'].validate((valid) => {
|
||||
@@ -268,9 +272,16 @@ export default {
|
||||
// 开启滑块验证
|
||||
verifyBtnClick() {
|
||||
if (!this.verifyStatus) {
|
||||
if (this.loginCaptchaBypassEnabled()) {
|
||||
this.verifyStatus = true;
|
||||
return;
|
||||
}
|
||||
this.$refs.verify.init();
|
||||
}
|
||||
},
|
||||
loginCaptchaBypassEnabled() {
|
||||
return typeof BASE !== "undefined" && (BASE.LOGIN_CAPTCHA_BYPASS === true || BASE.LOGIN_CAPTCHA_BYPASS === "true");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user