|
|
|
@ -11,7 +11,8 @@
|
|
|
|
|
<el-tab-pane label="企业用户登录" name="01"></el-tab-pane>
|
|
|
|
|
<el-tab-pane label="政务用户登录" name="02"></el-tab-pane>
|
|
|
|
|
</el-tabs>
|
|
|
|
|
<el-form-item prop="username" v-show="userType == '02'">
|
|
|
|
|
<!-- v-show="userType == '02'" -->
|
|
|
|
|
<el-form-item prop="username">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="loginForm.username"
|
|
|
|
|
type="text"
|
|
|
|
@ -25,7 +26,7 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item prop="password" v-show="userType == '02'">
|
|
|
|
|
<el-form-item prop="password">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="loginForm.password"
|
|
|
|
|
type="password"
|
|
|
|
@ -40,7 +41,7 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item prop="code" v-if="captchaEnabled && userType == '02'">
|
|
|
|
|
<el-form-item prop="code" v-if="captchaEnabled">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="loginForm.code"
|
|
|
|
|
auto-complete="off"
|
|
|
|
@ -60,11 +61,10 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-checkbox
|
|
|
|
|
v-model="loginForm.rememberMe"
|
|
|
|
|
v-show="userType == '02'"
|
|
|
|
|
style="margin: 0px 0px 25px 0px"
|
|
|
|
|
>记住密码</el-checkbox
|
|
|
|
|
>
|
|
|
|
|
<el-form-item style="width: 100%" v-if="userType == '02'">
|
|
|
|
|
<el-form-item style="width: 100%">
|
|
|
|
|
<el-button
|
|
|
|
|
:loading="loading"
|
|
|
|
|
size="medium"
|
|
|
|
@ -78,11 +78,20 @@
|
|
|
|
|
<el-button
|
|
|
|
|
size="medium"
|
|
|
|
|
type="primary"
|
|
|
|
|
v-if="userType == '02'"
|
|
|
|
|
style="width: 100%;margin-left: 0;margin-top: 20px;"
|
|
|
|
|
@click.native.prevent="changeHttp"
|
|
|
|
|
>
|
|
|
|
|
<span>政务通统一身份认证登录</span>
|
|
|
|
|
<!-- <span v-else>登 录 中...</span> -->
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
size="medium"
|
|
|
|
|
type="primary"
|
|
|
|
|
v-if="userType == '01'"
|
|
|
|
|
style="width: 100%;margin-left: 0;margin-top: 20px;"
|
|
|
|
|
@click.native.prevent="changeHttp"
|
|
|
|
|
>
|
|
|
|
|
<span>企业统一身份认证登录</span>
|
|
|
|
|
</el-button>
|
|
|
|
|
<div style="float: right" v-if="register">
|
|
|
|
|
<router-link class="link-type" :to="'/register'"
|
|
|
|
@ -90,7 +99,7 @@
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item style="width: 100%" v-else class="enterBtnLogin">
|
|
|
|
|
<!-- <el-form-item style="width: 100%" class="enterBtnLogin">
|
|
|
|
|
<div class="wai-box">
|
|
|
|
|
<el-button
|
|
|
|
|
:loading="loading"
|
|
|
|
@ -103,7 +112,7 @@
|
|
|
|
|
<span v-else>登 录 中...</span>
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form-item> -->
|
|
|
|
|
</el-form>
|
|
|
|
|
<!-- 底部 -->
|
|
|
|
|
<!-- <div class="el-login-footer">
|
|
|
|
@ -160,14 +169,14 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
// this.getCode();
|
|
|
|
|
this.getCode();
|
|
|
|
|
this.getCookie();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
handleClick(tab){
|
|
|
|
|
if(tab.index == "1") {
|
|
|
|
|
this.getCode();
|
|
|
|
|
}
|
|
|
|
|
// if(tab.index == "1") {
|
|
|
|
|
// this.getCode();
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
getCode() {
|
|
|
|
|
getCodeImg().then((res) => {
|
|
|
|
@ -191,45 +200,45 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
handleLogin() {
|
|
|
|
|
this.$refs.loginForm.validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
if (this.loginForm.rememberMe) {
|
|
|
|
|
Cookies.set("username", this.loginForm.username, { expires: 30 });
|
|
|
|
|
Cookies.set("password", encrypt(this.loginForm.password), {
|
|
|
|
|
expires: 30,
|
|
|
|
|
});
|
|
|
|
|
Cookies.set("rememberMe", this.loginForm.rememberMe, {
|
|
|
|
|
expires: 30,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
Cookies.remove("username");
|
|
|
|
|
Cookies.remove("password");
|
|
|
|
|
Cookies.remove("rememberMe");
|
|
|
|
|
}
|
|
|
|
|
this.$store
|
|
|
|
|
.dispatch("Login", {...this.loginForm,userType:this.userType})
|
|
|
|
|
.then(() => {
|
|
|
|
|
this.$router.push({ path: this.redirect || "/" }).catch(() => {});
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
if (this.captchaEnabled) {
|
|
|
|
|
// if(this.userType == "02") {
|
|
|
|
|
this.getCode();
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
changeHttp(){
|
|
|
|
|
if(this.userType == '01') {
|
|
|
|
|
location.href = process.env.VUE_APP_BASE_API + "/system/singlelogin/login"
|
|
|
|
|
} else {
|
|
|
|
|
this.$refs.loginForm.validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
if (this.loginForm.rememberMe) {
|
|
|
|
|
Cookies.set("username", this.loginForm.username, { expires: 30 });
|
|
|
|
|
Cookies.set("password", encrypt(this.loginForm.password), {
|
|
|
|
|
expires: 30,
|
|
|
|
|
});
|
|
|
|
|
Cookies.set("rememberMe", this.loginForm.rememberMe, {
|
|
|
|
|
expires: 30,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
Cookies.remove("username");
|
|
|
|
|
Cookies.remove("password");
|
|
|
|
|
Cookies.remove("rememberMe");
|
|
|
|
|
}
|
|
|
|
|
this.$store
|
|
|
|
|
.dispatch("Login", {...this.loginForm,userType:this.userType})
|
|
|
|
|
.then(() => {
|
|
|
|
|
this.$router.push({ path: this.redirect || "/" }).catch(() => {});
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
if (this.captchaEnabled) {
|
|
|
|
|
if(this.userType == "02") {
|
|
|
|
|
this.getCode();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
location.href = "https://qyt.sipac.gov.cn/sipsg-enterprise-mobile-manage/#/login"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
changeHttp(){
|
|
|
|
|
location.href = "https://qyt.sipac.gov.cn/sipsg-enterprise-mobile-manage/#/login"
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|