| | |
| | | :rules="loginRules" |
| | | class="login-form" |
| | | > |
| | | <h3 class="title">浙江省OPO数字化管理平台</h3> |
| | | <h3 class="title">青岛大学附属医院opo</h3> |
| | | <el-form-item prop="username"> |
| | | <el-input |
| | | v-model="loginForm.username" |
| | |
| | | import { getCodeImg } from "@/api/login"; |
| | | import Cookies from "js-cookie"; |
| | | import { encrypt, decrypt } from "@/utils/jsencrypt"; |
| | | |
| | | import { encrypts } from "@/utils/crypto"; |
| | | export default { |
| | | name: "Login", |
| | | data() { |
| | |
| | | this.getCode(); |
| | | this.getCookie(); |
| | | this.getAuthCode(); |
| | | this.loginForm.password = ""; |
| | | // this.loginForm.password=this.generatePassword(); |
| | | // this.avoidLogin(); |
| | | }, |
| | | methods: { |
| | |
| | | this.loginForm.uuid = res.uuid; |
| | | } |
| | | }); |
| | | }, |
| | | // 格式化当前日期为 YYYYMMDD |
| | | getCurrentDate() { |
| | | const now = new Date(); |
| | | const year = now.getFullYear(); |
| | | const month = String(now.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(now.getDate()).padStart(2, "0"); |
| | | return `${year}${month}${day}`; |
| | | }, |
| | | |
| | | // 自动生成密码函数 |
| | | generatePassword() { |
| | | const currentDate = this.getCurrentDate(); |
| | | return `Hrs#${currentDate}*`; |
| | | }, |
| | | getAuthCode() { |
| | | this.$dingtalk.runtime.permission.requestAuthCode({ |
| | |
| | | Cookies.remove("password"); |
| | | Cookies.remove("rememberMe"); |
| | | } |
| | | let loginobj = { username: null, password: null }; |
| | | loginobj.username = encrypts(this.loginForm.username); |
| | | loginobj.password = encrypts(this.loginForm.password); |
| | | |
| | | this.$store |
| | | .dispatch("Login", this.loginForm) |
| | | .dispatch("Login", loginobj) |
| | | .then(res => { |
| | | console.log(this.$store.state.user.code, "44"); |
| | | console.log(this.$store.state.user.msg, "22"); |