Commit 1965f46c authored by liuzhaoh's avatar liuzhaoh

优化登录

parent d48ee858
......@@ -25,7 +25,7 @@ export function getLogin() {
export function getInfo() {
return request({
url: '/system/permission?appCode=bme-pc-service&userId=1',
url: '/system/permission?appCode=bme-dc-tom-service&userId=1',
method: 'get'
})
}
......
......@@ -53,7 +53,7 @@
<div class="gap-20 captcha-box" v-if="!needPhoneCertificate">
<el-form-item prop="captcha">
<div class="captcha-container" >
<div class="captcha-container">
<div class="captcha-value">
<el-input
ref="captcha"
......@@ -75,7 +75,11 @@
</el-form-item>
</div>
<el-checkbox v-model="loginOldForm.rememberMe" label="记住密码" size="large" />
<el-checkbox
v-model="loginOldForm.rememberMe"
label="记住密码"
size="large"
/>
<el-button
:loading="oldloading"
......@@ -138,7 +142,7 @@
v-model="dialogPhoneCertificate"
class="dialogChangePassword"
:close-on-click-modal="false"
width="33%"
width="35%"
>
<el-form
ref="phoneForm"
......@@ -150,7 +154,7 @@
class="dialogChangePasswordform"
>
<el-form-item prop="iphone" label="手机号码:">
<el-autocomplete
<el-input
class="inline-input"
ref="iphone"
name="iphone"
......@@ -158,7 +162,19 @@
:fetch-suggestions="querySearchIphone"
placeholder="请输入手机号码"
@select="handleSelect"
></el-autocomplete>
>
<!-- <template #append>
<el-button
:disabled="captchaSendStatus"
@click.prevent="sendCaptchaCheck()"
>
{{
"发送验证码" +
(captchaWaitTime > 0 ? "(" + captchaWaitTime + ")" : "")
}}
</el-button>
</template> -->
</el-input>
<el-button
:disabled="captchaSendStatus"
class="captcha-btn"
......@@ -486,7 +502,7 @@ export default {
password: "",
captcha: "",
captchaKey: "",
rememberMe: getToken("rememberMe") == 'true' ? true : false,
rememberMe: getToken("rememberMe") == "true" ? true : false,
},
dialogPhoneBind: false,
store: null,
......@@ -523,7 +539,7 @@ export default {
account: "",
password: "",
captcha: "",
rememberMe: getToken("rememberMe") == 'true' ? true : false,
rememberMe: getToken("rememberMe") == "true" ? true : false,
};
},
mounted() {
......@@ -536,8 +552,8 @@ export default {
}
if (getToken("rememberMe") == "true") {
this.loginOldForm.account = encryptUtf8ToBase64(getToken("account"));
this.loginOldForm.password = encryptUtf8ToBase64(getToken("remmberPWS"));
console.log(this.loginOldForm)
this.loginOldForm.password = encryptUtf8ToBase64(getToken("remmberPWS"));
console.log(this.loginOldForm);
} else {
this.loginOldForm.account = "";
this.loginOldForm.password = "";
......@@ -570,7 +586,7 @@ export default {
*/
handleAccountBlur(event) {
getData(
"/config/simpleLoginConfig?appCode=bme-pc-service&account=" +
"/config/simpleLoginConfig?appCode=bme-dc-tom-service&account=" +
(event.currentTarget.value || event.target.value),
true
).then((result) => {
......@@ -580,7 +596,7 @@ export default {
},
handleAccountInput(value) {
getData(
"/config/simpleLoginConfig?appCode=bme-pc-service&account=" + value,
"/config/simpleLoginConfig?appCode=bme-dc-tom-service&account=" + value,
true
).then((result) => {
this.needPhoneCertificate = !result.data;
......@@ -604,7 +620,7 @@ export default {
*/
async getAppCode() {
let appCode = false;
await getData("/user/captchaLoginConfig?appCode=bme-pc-service")
await getData("/user/captchaLoginConfig?appCode=bme-dc-tom-service")
.then((res) => {
if (res.code == 1) {
setToken("appCode", res.data);
......@@ -673,7 +689,7 @@ export default {
confirmPassword: MD5(this.ruleForm.checkPass + "`1qazx").toString(),
};
if (!this.needPhoneCertificate) {
obj.appCode = "bme-pc-service";
obj.appCode = "bme-dc-tom-service";
}
postData("/management/savePassword", obj).then((res) => {
if (res.code == 1) {
......@@ -709,7 +725,7 @@ export default {
this.phoneForm.iphone +
"&account=" +
this.loginForm.account +
"&appCode=bme-pc-service",
"&appCode=bme-dc-tom-service",
true
)
.then((result) => {
......@@ -746,7 +762,7 @@ export default {
this.loginForm.account +
"&password=" +
this.loginForm.password +
"&appCode=bme-pc-service",
"&appCode=bme-dc-tom-service",
true
)
.then((result) => {
......@@ -801,7 +817,7 @@ export default {
encodeURIComponent(
MD5(this.loginForm.password + "`1qazx").toString()
) +
"&appCode=bme-pc-service",
"&appCode=bme-dc-tom-service",
true
).then((result) => {
if (result.code == 1 && result.data && result.data.length > 0) {
......@@ -828,7 +844,7 @@ export default {
this.$refs.phoneForm.validate((valid) => {
if (valid) {
this.loading = true;
this.phoneForm.appCode = "bme-pc-service";
this.phoneForm.appCode = "bme-dc-tom-service";
let bindIphones = [];
this.bindIphones.forEach((item) => {
bindIphones.push(item.value);
......@@ -840,7 +856,10 @@ export default {
this.store
.login(phoneFormOrigin)
.then((data) => {
console.log(!bindIphones.includes(this.phoneForm.iphone) && this.phoneForm.captcha != "BME202288");
console.log(
!bindIphones.includes(this.phoneForm.iphone) &&
this.phoneForm.captcha != "BME202288"
);
if (
!bindIphones.includes(this.phoneForm.iphone) &&
this.phoneForm.captcha != "BME202288"
......@@ -947,7 +966,7 @@ export default {
if (!this.isVerify) {
// 处理谷歌浏览器自带默认值的情况,因为初始化时获取不到,所以这里特殊处理
await getData(
"/config/simpleLoginConfig?appCode=bme-pc-service&account=" +
"/config/simpleLoginConfig?appCode=bme-dc-tom-service&account=" +
this.loginOldForm.account,
true
).then((result) => {
......@@ -967,10 +986,13 @@ export default {
this.$refs.loginOldForm.validate((valid) => {
if (valid) {
// 记住密码
setToken('account', encryptBase64ToUtf8(this.loginOldForm.account))
setToken('remmberPWS', encryptBase64ToUtf8(this.loginOldForm.password))
setToken("account", encryptBase64ToUtf8(this.loginOldForm.account));
setToken(
"remmberPWS",
encryptBase64ToUtf8(this.loginOldForm.password)
);
this.oldloading = true;
this.loginOldForm.appCode = "bme-pc-service";
this.loginOldForm.appCode = "bme-dc-tom-service";
const loginOldFormOrigin = { ...this.loginOldForm };
loginOldFormOrigin.password = MD5(
......@@ -1127,7 +1149,12 @@ $cursor: #ccc;
}
}
.el-input__wrapper {
width: 100%;
width: 95%;
}
.dialogChangePasswordform {
.el-input__wrapper {
width: 80%;
}
}
.captcha {
......@@ -1152,8 +1179,9 @@ $light_gray: #eee;
.captcha-btn {
position: absolute;
right: 0px;
height: 48px;
top: 1%;
right: 17%;
height: 100%;
}
.login-container {
......
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 to comment