|
@@ -6,7 +6,7 @@
|
|
|
<!--<div class="login-header">-->
|
|
|
<!--<h2 class="login-brand">{{ $t('brand.lg') }}</h2>-->
|
|
|
<!--</div>-->
|
|
|
- <div class="login-body">
|
|
|
+ <div class="login-body" v-if="isHttps">
|
|
|
<!--<h3 class="login-title">{{ $t('login.title') }}</h3>-->
|
|
|
<img src="~@/assets/img/logo.png" style="width:50%;margin-bottom: 40px;">
|
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" status-icon>
|
|
@@ -44,7 +44,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="showOnPhone" prop="validsmsCode" >
|
|
|
<el-input v-model="dataForm.validsmsCode" placeholder="请输入验证码">
|
|
|
- <template #append> <div class="verView" @click="verCodeClick()">{{codeTitle}}</div></template>
|
|
|
+ <template #append> <div class="verView" @click="verCodeClick()">{{codeTitle}}</div></template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
@@ -83,26 +83,29 @@ import {
|
|
|
IsAddonAvailable,
|
|
|
GetSignAndToken,
|
|
|
form1T9,
|
|
|
- GetSignAndTokenCb,
|
|
|
+ GetSignAndTokenCb
|
|
|
} from './onenethelper'
|
|
|
+import {MessageBox} from 'element-ui'
|
|
|
+import router from '@/router'
|
|
|
+import fa from 'element-ui/src/locale/lang/fa'
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
|
i18nMessages: messages,
|
|
|
showOnPhone: false,
|
|
|
showUsername: true,
|
|
|
- show:false,
|
|
|
- codeTitle:"获取验证码",
|
|
|
- time_count:60,
|
|
|
- timer:null,
|
|
|
+ show: false,
|
|
|
+ codeTitle: '获取验证码',
|
|
|
+ time_count: 60,
|
|
|
+ timer: null,
|
|
|
captchaPath: '',
|
|
|
dataForm: {
|
|
|
username: '',
|
|
|
password: '',
|
|
|
deviceId: '',
|
|
|
validCode: '',
|
|
|
- phoneNumber:'',
|
|
|
- validsmsCode:'',
|
|
|
+ phoneNumber: '',
|
|
|
+ validsmsCode: ''
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -123,21 +126,34 @@ export default {
|
|
|
],
|
|
|
phoneNumber: [
|
|
|
{ required: true, message: '请输入手机号码', trigger: 'blur' }
|
|
|
- ],
|
|
|
+ ]
|
|
|
}
|
|
|
+ },
|
|
|
+ isHttps () {
|
|
|
+ return location.protocol.includes('https')
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
- this.getCaptcha()
|
|
|
+ if (this.isHttps) {
|
|
|
+ this.getCaptcha()
|
|
|
+ } else {
|
|
|
+ MessageBox.confirm('<div>根据网络安全管理要求,系统计划于2025年3月28日14时30分至23时进行升级改造,期间系统无法使用,敬请谅解。</div><div>升级后,请通过新地址进行登录<a href="https://10.110.35.47" style="cursor: pointer">(点击跳转)</a>,感谢您的理解和支持。</div>', '通知', {
|
|
|
+ showClose: false,
|
|
|
+ showCancelButton: false,
|
|
|
+ showConfirmButton: false,
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ customClass: 'https-msg'
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
- //证书插件下载
|
|
|
+ // 证书插件下载
|
|
|
handleCommand (filename) {
|
|
|
- const a = document.createElement('a');
|
|
|
- a.href = filename;
|
|
|
- a.download = filename;
|
|
|
- document.body.appendChild(a);
|
|
|
- a.click();
|
|
|
+ const a = document.createElement('a')
|
|
|
+ a.href = filename
|
|
|
+ a.download = filename
|
|
|
+ document.body.appendChild(a)
|
|
|
+ a.click()
|
|
|
},
|
|
|
// 获取验证码
|
|
|
getCaptcha () {
|
|
@@ -146,36 +162,34 @@ export default {
|
|
|
},
|
|
|
// 获取手机验证码
|
|
|
verCodeClick () {
|
|
|
- if(!this.show){
|
|
|
- this.$http.post('/idaas/sso/smsvalidate',{
|
|
|
- phoneNumber:this.dataForm.phoneNumber,
|
|
|
- deviceId:this.dataForm.deviceId,
|
|
|
- validCode:this.dataForm.validCode,
|
|
|
- }).then(({ data: res }) => {
|
|
|
+ if (!this.show) {
|
|
|
+ this.$http.post('/idaas/sso/smsvalidate', {
|
|
|
+ phoneNumber: this.dataForm.phoneNumber,
|
|
|
+ deviceId: this.dataForm.deviceId,
|
|
|
+ validCode: this.dataForm.validCode
|
|
|
+ }).then(({ data: res }) => {
|
|
|
// this.show = true
|
|
|
- if (res.code !== 0) {
|
|
|
- return this.$message.error(res.msg)
|
|
|
- }
|
|
|
- if(res.code==0) {
|
|
|
- if(!this.timer) {
|
|
|
- this.timer = setInterval ( () => {
|
|
|
- if(this.time_count>0) {
|
|
|
- this.time_count--
|
|
|
- this.codeTitle = this.time_count +'秒后重新获取'
|
|
|
- }
|
|
|
- else {
|
|
|
- this.codeTitle = '获取验证码'
|
|
|
- clearInterval(this.timer)
|
|
|
- this.timer = null
|
|
|
- this.time_count = 60
|
|
|
- this.show = false
|
|
|
- }
|
|
|
- },1000)
|
|
|
-
|
|
|
+ if (res.code !== 0) {
|
|
|
+ return this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ if (res.code == 0) {
|
|
|
+ if (!this.timer) {
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ if (this.time_count > 0) {
|
|
|
+ this.time_count--
|
|
|
+ this.codeTitle = this.time_count + '秒后重新获取'
|
|
|
+ } else {
|
|
|
+ this.codeTitle = '获取验证码'
|
|
|
+ clearInterval(this.timer)
|
|
|
+ this.timer = null
|
|
|
+ this.time_count = 60
|
|
|
+ this.show = false
|
|
|
}
|
|
|
- }
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+ }
|
|
|
}).catch(() => {})
|
|
|
- }
|
|
|
+ }
|
|
|
},
|
|
|
onUserName () {
|
|
|
this.showUsername = true
|
|
@@ -187,41 +201,39 @@ export default {
|
|
|
this.showUsername = false
|
|
|
},
|
|
|
CertLogin () {
|
|
|
- if(IsAddonAvailable()) {
|
|
|
- this.$http.post('/webservice/generatorchallenge', {}).then(({ data: res }) => {
|
|
|
+ if (IsAddonAvailable()) {
|
|
|
+ this.$http.post('/webservice/generatorchallenge', {}).then(({ data: res }) => {
|
|
|
if (res.code == 0) {
|
|
|
- GetSignAndToken(res.msg)
|
|
|
+ GetSignAndToken(res.msg)
|
|
|
// console.log(GetSignAndTokenCb(),"GetSignAndTokenCb()")
|
|
|
// console.log(form1T9,"登陆页")
|
|
|
setTimeout(() => {
|
|
|
- if(form1T9.signandtoken) {
|
|
|
- this.$http.post('/webservice/verifyIdentityTicket', {
|
|
|
- challenge: res.msg,//随机挑战数
|
|
|
- identityTicket:form1T9.signandtoken,//组合令牌数据
|
|
|
- appServerID:'0'//服务器ID
|
|
|
- }).then(({ data: res }) => {
|
|
|
- if (res.expiresIn==7200) {
|
|
|
- Cookies.set('token', res.sessionToken)
|
|
|
- this.$router.replace({ name: 'home' })
|
|
|
- // 发送用户登录成功MQ消息
|
|
|
- this.$http.get('/mq/user/login').then(({ data: res }) => {
|
|
|
- if (res.code !== 0) {
|
|
|
- return this.$message.error(res.msg)
|
|
|
- }
|
|
|
- }).catch(() => {})
|
|
|
- }else {
|
|
|
- this.$message.error(res.msg)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- else {
|
|
|
- this.$message.error("获取令牌错误 请刷新重试!")
|
|
|
+ if (form1T9.signandtoken) {
|
|
|
+ this.$http.post('/webservice/verifyIdentityTicket', {
|
|
|
+ challenge: res.msg, // 随机挑战数
|
|
|
+ identityTicket: form1T9.signandtoken, // 组合令牌数据
|
|
|
+ appServerID: '0'// 服务器ID
|
|
|
+ }).then(({ data: res }) => {
|
|
|
+ if (res.expiresIn == 7200) {
|
|
|
+ Cookies.set('token', res.sessionToken)
|
|
|
+ this.$router.replace({ name: 'home' })
|
|
|
+ // 发送用户登录成功MQ消息
|
|
|
+ this.$http.get('/mq/user/login').then(({ data: res }) => {
|
|
|
+ if (res.code !== 0) {
|
|
|
+ return this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ }).catch(() => {})
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message.error('获取令牌错误 请刷新重试!')
|
|
|
}
|
|
|
- },800)
|
|
|
+ }, 800)
|
|
|
// form1.T8.value = res.data.msg//获取随机挑战数
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
// 表单提交
|
|
@@ -230,58 +242,54 @@ export default {
|
|
|
if (!valid) {
|
|
|
return false
|
|
|
}
|
|
|
- if(this.showOnPhone) {
|
|
|
+ if (this.showOnPhone) {
|
|
|
this.$http.post('idaas/sso/smslogin', {
|
|
|
- deviceId:this.dataForm.deviceId,
|
|
|
- phoneNumber:this.dataForm.phoneNumber,
|
|
|
- validCode:this.dataForm.validCode,
|
|
|
- validsmsCode:this.dataForm.validsmsCode,
|
|
|
+ deviceId: this.dataForm.deviceId,
|
|
|
+ phoneNumber: this.dataForm.phoneNumber,
|
|
|
+ validCode: this.dataForm.validCode,
|
|
|
+ validsmsCode: this.dataForm.validsmsCode
|
|
|
})
|
|
|
- .then(({ data: res }) => {
|
|
|
- if (res.code !== 0) {
|
|
|
- this.getCaptcha()
|
|
|
- return this.$message.error(res.msg)
|
|
|
- }
|
|
|
- Cookies.set('token', res.sessionToken)
|
|
|
- Cookies.set('loginMsg', 1)
|
|
|
- // 发送用户登录成功MQ消息
|
|
|
- this.$http.get('/mq/user/login').then(({ data: res }) => {
|
|
|
+ .then(({ data: res }) => {
|
|
|
+ if (res.code !== 0) {
|
|
|
+ this.getCaptcha()
|
|
|
+ return this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ Cookies.set('token', res.sessionToken)
|
|
|
+ Cookies.set('loginMsg', 1)
|
|
|
+ // 发送用户登录成功MQ消息
|
|
|
+ this.$http.get('/mq/user/login').then(({ data: res }) => {
|
|
|
+ if (res.code !== 0) {
|
|
|
+ return this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ }).catch(() => {})
|
|
|
+ if (localStorage.getItem('pathCopyshow') && localStorage.getItem('pathCopy')) {
|
|
|
+ this.$router.push(localStorage.getItem('pathCopy'))
|
|
|
+ } else {
|
|
|
+ this.$router.replace({ name: 'home' })
|
|
|
+ }
|
|
|
+ }).catch(() => {})
|
|
|
+ } else {
|
|
|
+ this.$http.post('/idaas/sso/login', this.dataForm).then(({ data: res }) => {
|
|
|
if (res.code !== 0) {
|
|
|
+ this.getCaptcha()
|
|
|
return this.$message.error(res.msg)
|
|
|
}
|
|
|
- }).catch(() => {})
|
|
|
- if(localStorage.getItem('pathCopyshow') && localStorage.getItem('pathCopy')) {
|
|
|
- this.$router.push(localStorage.getItem('pathCopy'))
|
|
|
- }
|
|
|
- else{
|
|
|
- this.$router.replace({ name: 'home' })
|
|
|
- }
|
|
|
- }).catch(() => {})
|
|
|
-
|
|
|
- }else {
|
|
|
- this.$http.post('/idaas/sso/login', this.dataForm).then(({ data: res }) => {
|
|
|
- if (res.code !== 0) {
|
|
|
- this.getCaptcha()
|
|
|
- return this.$message.error(res.msg)
|
|
|
- }
|
|
|
- Cookies.set('token', res.sessionToken)
|
|
|
- Cookies.set('loginMsg', 1)
|
|
|
+ Cookies.set('token', res.sessionToken)
|
|
|
+ Cookies.set('loginMsg', 1)
|
|
|
|
|
|
- // 发送用户登录成功MQ消息
|
|
|
- this.$http.get('/mq/user/login').then(({ data: res }) => {
|
|
|
- if (res.code !== 0) {
|
|
|
- return this.$message.error(res.msg)
|
|
|
+ // 发送用户登录成功MQ消息
|
|
|
+ this.$http.get('/mq/user/login').then(({ data: res }) => {
|
|
|
+ if (res.code !== 0) {
|
|
|
+ return this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ }).catch(() => {})
|
|
|
+ if (localStorage.getItem('pathCopyshow') && localStorage.getItem('pathCopy')) {
|
|
|
+ this.$router.push(localStorage.getItem('pathCopy'))
|
|
|
+ } else {
|
|
|
+ this.$router.replace({ name: 'home' })
|
|
|
}
|
|
|
}).catch(() => {})
|
|
|
- if(localStorage.getItem('pathCopyshow') && localStorage.getItem('pathCopy')) {
|
|
|
- this.$router.push(localStorage.getItem('pathCopy'))
|
|
|
- }
|
|
|
- else{
|
|
|
- this.$router.replace({ name: 'home' })
|
|
|
- }
|
|
|
- }).catch(() => {})
|
|
|
}
|
|
|
-
|
|
|
})
|
|
|
}, 1000, { 'leading': true, 'trailing': false })
|
|
|
}
|
|
@@ -296,7 +304,7 @@ export default {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
.cert {
|
|
|
cursor: pointer;
|
|
@@ -320,4 +328,4 @@ export default {
|
|
|
color: #3E8EF7;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|