From 9d408b549b899631db29af772ee4e96f4c49a91c Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期四, 25 十二月 2025 15:53:56 +0800
Subject: [PATCH] 相关推送
---
src/views/login.vue | 48 ++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 46 insertions(+), 2 deletions(-)
diff --git a/src/views/login.vue b/src/views/login.vue
index df7a011..3b6c14a 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -6,7 +6,7 @@
:rules="loginRules"
class="login-form"
>
- <h3 class="title">娴欐睙鐪丱PO鏁板瓧鍖栫鐞嗗钩鍙�</h3>
+ <h3 class="title">闈掑矝澶у闄勫睘鍖婚櫌opo</h3>
<el-form-item prop="username">
<el-input
v-model="loginForm.username"
@@ -96,6 +96,7 @@
data() {
return {
codeUrl: "",
+ authCode: "",
cookiePassword: "",
loginForm: {
username: "",
@@ -137,6 +138,8 @@
created() {
this.getCode();
this.getCookie();
+ this.getAuthCode();
+ // this.avoidLogin();
},
methods: {
tip() {
@@ -151,6 +154,47 @@
this.loginForm.uuid = res.uuid;
}
});
+ },
+ getAuthCode() {
+ this.$dingtalk.runtime.permission.requestAuthCode({
+ corpId: "dingd31f00f4fbc0ff5bf5bf40eda33b7ba0",
+ onSuccess: result => {
+ // 鍦ㄨ繖閲屽鐞嗘巿鏉冩垚鍔熷悗鐨勯�昏緫锛宺esult涓寘鍚巿鏉冪爜绛変俊鎭�
+ // this.authCode = result.codde;
+ this.$message.success("鎴愬姛鑾峰彇鎺堟潈鐮侊細" + result.code);
+ this.avoidLogin(result.code);
+ },
+ onFail: err => {
+ // 鍦ㄨ繖閲屽鐞嗘巿鏉冨け璐ュ悗鐨勯�昏緫
+ this.$message({
+ type: "error",
+ message: err
+ });
+ }
+ });
+ },
+ avoidLogin(authCode) {
+ this.loading = true;
+ // this.$message.error(authCode, "1鍙蜂綅");
+ this.loginForm.authCode = authCode;
+ this.$store
+ .dispatch("Login", this.loginForm)
+ .then(res => {
+ if (this.$store.state.user.code == 200) {
+ this.$router.push({ path: this.redirect || "/" }).catch(() => {});
+ } else {
+ this.loading = false;
+ // this.$message.error(this.$store.state.user.msg);
+ }
+ })
+ .catch(err => {
+ console.log(err);
+ this.loading = false;
+ this.$message.error("鍏嶇櫥闄嗗け璐ヨ鎵嬪姩鎿嶄綔銆�");
+ if (this.captchaOnOff) {
+ this.getCode();
+ }
+ });
},
getCookie() {
const username = Cookies.get("username");
@@ -190,7 +234,7 @@
.push({ path: this.redirect || "/" })
.catch(() => {});
} else {
- this.loading = false;
+ this.loading = false;
this.$message.error(this.$store.state.user.msg);
}
})
--
Gitblit v1.9.3