|
@@ -2,23 +2,16 @@
|
|
|
<div class="login-container">
|
|
|
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left">
|
|
|
<div class="title-container flex-wrap">
|
|
|
- <!-- <el-divider direction="vertical"></el-divider> -->
|
|
|
<div class="content-box">
|
|
|
<div class="title">{{ pageTitle }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<el-form-item prop="username">
|
|
|
- <!-- <span class="svg-container">
|
|
|
- <svg-icon style="color:#606266;" icon-class="user" />
|
|
|
- </span> -->
|
|
|
<el-input ref="username" v-model="loginForm.username" placeholder="用户名" name="username" type="text" tabindex="1" auto-complete="on" />
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item prop="password">
|
|
|
- <!-- <span class="svg-container">
|
|
|
- <svg-icon style="color:#606266;" icon-class="password" />
|
|
|
- </span> -->
|
|
|
<el-input ref="password" v-model="loginForm.password" show-password placeholder="密码" name="password" tabindex="2" auto-complete="on" />
|
|
|
</el-form-item>
|
|
|
|
|
@@ -43,7 +36,6 @@ export default {
|
|
|
name: "Login",
|
|
|
data () {
|
|
|
return {
|
|
|
- text: `<a onclick='("XSS")'>链接</a>`,
|
|
|
flag: false,
|
|
|
PwdMessage: null,
|
|
|
loginForm: {
|
|
@@ -70,34 +62,27 @@ export default {
|
|
|
appId: ''
|
|
|
};
|
|
|
},
|
|
|
- watch: {
|
|
|
- $route: {
|
|
|
- handler: function (route) {
|
|
|
- this.redirect = route.query && route.query.redirect;
|
|
|
- },
|
|
|
- immediate: true,
|
|
|
- }
|
|
|
- },
|
|
|
async created () {
|
|
|
try {
|
|
|
const { code, returnData, message } = await getToken({
|
|
|
'appid': PLATFROM_CONFIG.appId,
|
|
|
- 'appSecret': PLATFROM_CONFIG.appKeyString
|
|
|
+ 'appsecret': PLATFROM_CONFIG.appKeyString
|
|
|
})
|
|
|
if (code == 0 && isValue(returnData)) {
|
|
|
- const { app_log, app_name, app_token, active_duration, app_code_rule } = returnData;
|
|
|
- this.imgSrc = window.location.origin + app_log
|
|
|
- this.pageTitle = app_name
|
|
|
- this.isCode = app_code_rule
|
|
|
- setCodeToken(app_token);
|
|
|
- setToken('active_duration', active_duration);
|
|
|
- sessionStorage.setItem('appLog', app_log)
|
|
|
- sessionStorage.setItem('appName', app_name)
|
|
|
- if (app_code_rule) {
|
|
|
+ const { appenname, appname, background, expirestime, logo, securitycoderule, smalllogo, token } = returnData;
|
|
|
+ this.imgSrc = window.location.origin + logo
|
|
|
+ this.pageTitle = appname
|
|
|
+ this.isCode = securitycoderule
|
|
|
+ setCodeToken(token);
|
|
|
+ sessionStorage.setItem('appConfig', JSON.stringify({ ...returnData }))
|
|
|
+ // setToken('active_duration', active_duration);
|
|
|
+ sessionStorage.setItem('appLog', logo)
|
|
|
+ sessionStorage.setItem('appName', appname)
|
|
|
+ if (securitycoderule) {
|
|
|
this.getCheckCode()
|
|
|
}
|
|
|
} else {
|
|
|
- this.$message.error(message);
|
|
|
+ this.$router.push('/404')
|
|
|
}
|
|
|
} catch (error) {
|
|
|
this.$message.error(error.message);
|
|
@@ -145,9 +130,7 @@ export default {
|
|
|
},
|
|
|
//获取动态验证码
|
|
|
async getCheckCode () {
|
|
|
- const { code, message, returnData } = await getVCode({
|
|
|
- app_token: getCodeToken()
|
|
|
- });
|
|
|
+ const { code, message, returnData } = await getVCode();
|
|
|
if (code == 0 && isValue(returnData)) {
|
|
|
const { verifyCode } = returnData;
|
|
|
this.baseImg = "data:image/gif;base64," + verifyCode;
|
|
@@ -159,9 +142,6 @@ export default {
|
|
|
changeCode () {
|
|
|
this.getCheckCode();
|
|
|
},
|
|
|
- errorHandler () {
|
|
|
- return true
|
|
|
- }
|
|
|
},
|
|
|
};
|
|
|
</script>
|