Commit 374efdff authored by 胡's avatar

fix: 登录问题(极光推送问题)

parent e7fc4ea9
...@@ -11,5 +11,5 @@ module.exports = { ...@@ -11,5 +11,5 @@ module.exports = {
ocrPath:'"http://180.104.121.66:8088/r/api"', ocrPath:'"http://180.104.121.66:8088/r/api"',
fileUploadSvcPath:'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_UAT&apiName="', fileUploadSvcPath:'"http://180.104.121.66:8088/r/api/app/fileUploadSvc?sysName=XCMG_UAT&apiName="',
appId: '"com.xcmg.app.dev"', appId: '"com.xcmg.app.dev"',
currentVersion: '"3.4.8"' currentVersion: '"3.5.0"'
} }
<template> <template>
<scroll id="login"> <h-content id="login">
<transition name="trans"> <transition name="trans">
<div v-show="downNum" class="modal-show"> <div v-show="downNum" class="modal-show">
<div class="down"> <div class="down">
...@@ -11,27 +11,27 @@ ...@@ -11,27 +11,27 @@
</div> </div>
</div> </div>
</transition> </transition>
<div class="bird-icon" /> <div class="bird-icon"/>
<div class="login-wrap"> <div class="login-wrap">
<img class="title" src="../assets/login/right-title.png" > <img class="title" src="../assets/login/right-title.png">
<div class="pwd"> <div class="pwd">
<div class="pwd-input"> <div class="pwd-input">
<input <input
id="userInput" v-model.trim="username" class="user" type="text" id="userInput" v-model="username" class="user" type="text"
placeholder="请输入用户名/手机号" > placeholder="请输入用户名/手机号">
</div> </div>
<div v-if="username" class="delete" @click="clearAccount"> <div v-if="username" class="delete" @click="clearAccount">
<img src="../assets/login/login-delete.png" > <img src="../assets/login/login-delete.png">
</div> </div>
</div> </div>
<div class="pwd"> <div class="pwd">
<div class="pwd-input"> <div class="pwd-input">
<input <input
id="passwordInput" v-model="password" :type="pwdType" placeholder="请输入密码" id="passwordInput" v-model="password" :type="pwdType" placeholder="请输入密码"
oninput="value=value.replace(/[^\w\.\&\/\|\,\\_\-\+\=\[\]\{\}\'\^\%\$\@\!\~\`\*\《\》\<\>\/\;\:\,\,\。\【\】\?\?\、\;\:\‘\“\(\#)]/i,'')" > oninput="value=value.replace(/[^\w\.\&\/\|\,\\_\-\+\=\[\]\{\}\'\^\%\$\@\!\~\`\*\《\》\<\>\/\;\:\,\,\。\【\】\?\?\、\;\:\‘\“\(\#)]/i,'')">
</div> </div>
<div v-if="password" class="delete" @click="changeType"> <div v-if="password" class="delete" @click="changeType">
<img :src="openEye" > <img :src="openEye">
</div> </div>
</div> </div>
<div class="other-function"> <div class="other-function">
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</div> </div>
</div> </div>
</scroll> </h-content>
</template> </template>
<script> <script>
var CryptoJS = require('crypto-js') var CryptoJS = require('crypto-js')
...@@ -103,17 +103,21 @@ export default { ...@@ -103,17 +103,21 @@ export default {
}, },
methods: { methods: {
async goHome () { async goHome () {
this.hlsPopup.showLoading('请稍等')
let flag = await this.getAccessToken() let flag = await this.getAccessToken()
this.hlsPopup.hideLoading()
if (flag) { if (flag) {
this.$router.push('tab') this.$router.push({
name: 'HomePage',
})
} }
}, },
changeType () { changeType () {
this.pwdType = this.pwdType === 'password' ? 'text' : 'password' this.pwdType = this.pwdType === 'password' ? 'text' : 'password'
this.openEye = this.openEye =
this.pwdType === 'password' this.pwdType === 'password'
? require('@/assets/login/pwd.png') ? require('@/assets/login/pwd.png')
: require('@/assets/login/pwd-show.png') : require('@/assets/login/pwd-show.png')
}, },
privacyPolicy () { privacyPolicy () {
this.$router.push({ this.$router.push({
...@@ -133,20 +137,27 @@ export default { ...@@ -133,20 +137,27 @@ export default {
let param = { let param = {
phone: vm.username, phone: vm.username,
password: md5passwprd, password: md5passwprd,
} }
vm.hlsHttp.post(url, param).then(function (res) { vm.hlsHttp.post(url, param).then(function (res) {
if (res.result === 'S' && res.info.login_flag === 'Y') { if (res.result === 'S' && res.info.login_flag === 'Y') {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
vm.updateVersion() // 版本更新 // vm.updateVersion() // 版本更新
window.localStorage.setItem('user_phone', isNaN(parseInt(vm.username)) ? '11111111111': vm.username)
window.localStorage.setItem('password', md5passwprd) window.localStorage.setItem('password', md5passwprd)
window.localStorage.setItem('user_phone', vm.username) // vm.$router.push({
window.localStorage.setItem('app_user_id', res.info.app_user_id) // name: 'HomePage',
// vm.$router.push('tab') // })
vm.$router.push('/choose-user'); vm.$router.push('/choose-user');
let tagOption = {
'username': vm.username, window.localStorage.setItem('app_user_id', res.info.app_user_id)
}
vm.Jpush._jpush_config(tagOption) let tagOption = {
'username': isNaN(parseInt(vm.username)) ? '11111111111': vm.username
}
vm.Jpush._jpush_config(tagOption);
} else { } else {
hlsPopup.hideLoading() hlsPopup.hideLoading()
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
...@@ -165,10 +176,10 @@ export default { ...@@ -165,10 +176,10 @@ export default {
return true return true
} }
}, },
async access () { async access () {
document.getElementById('passwordInput').blur() document.getElementById('passwordInput').blur()
document.getElementById('userInput').blur() document.getElementById('userInput').blur()
document.activeElement.blur() document.activeElement.blur()
let vm = this let vm = this
if (!vm.username || vm.username === undefined) { if (!vm.username || vm.username === undefined) {
vm.hlsPopup.showLongCenter('请输入用户名') vm.hlsPopup.showLongCenter('请输入用户名')
...@@ -176,7 +187,7 @@ export default { ...@@ -176,7 +187,7 @@ export default {
vm.hlsPopup.showLongCenter('请输入密码') vm.hlsPopup.showLongCenter('请输入密码')
} else { } else {
hlsPopup.showLoading('正在登录') hlsPopup.showLoading('正在登录')
let flag = await this.getAccessToken() let flag = await this.getAccessToken()
if (flag) { if (flag) {
vm.login() vm.login()
} }
...@@ -306,239 +317,271 @@ export default { ...@@ -306,239 +317,271 @@ export default {
.trans-leave-active { .trans-leave-active {
transition: opacity 0.5s; transition: opacity 0.5s;
} }
.trans-enter, .trans-enter,
.trans-leave-active { .trans-leave-active {
opacity: 0; opacity: 0;
} }
#login {
background: url("../assets/login/back.png") no-repeat; #login {
background-size: 100% 100%; background: url("../assets/login/back.png") no-repeat;
background-position-x: 0px; background-size: 100% 100%;
color: #ffffff; background-position-x: 0px;
width: 100%; color: #ffffff;
height: 100%;
margin: 0 auto;
.scrollContent {
display: flex;
justify-content: center;
align-items: center;
}
.modal-show {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: absolute; margin: 0 auto;
display: flex;
z-index: 900; .scrollContent {
background-color: rgba(56, 63, 69, 0.3);
justify-content: center;
align-items: center;
.policy{
width:80%;
height:90%;
margin:0 auto;
display: flex; display: flex;
justify-content: center; justify-content: center;
flex-direction: column;
flex-wrap: wrap;
align-items: center; align-items: center;
} }
.down {
position: relative; .modal-show {
width: 301px; width: 100%;
height: 202px; height: 100%;
position: absolute;
display: flex; display: flex;
z-index: 900;
background-color: rgba(56, 63, 69, 0.3);
justify-content: center; justify-content: center;
flex-flow: column wrap;
align-items: center; align-items: center;
background-size: 301px 24.7px;
background-color: #fff; .policy {
border-radius: 8px; width: 80%;
p { height: 90%;
font-family: PingFangSC-Semibold; margin: 0 auto;
font-size: 16px; display: flex;
color: #1d3fff; justify-content: center;
margin-top: 16px; flex-direction: column;
flex: 2; flex-wrap: wrap;
} align-items: center;
span {
font-family: PingFangSC-Regular;
font-size: 14px;
color: #383f45;
flex: 3;
line-height: 25px;
text-indent: 10px;
letter-spacing: 0;
// margin-top: 6px;
} }
button {
width: 159px; .down {
flex: 2; position: relative;
margin-bottom: 16px; width: 301px;
height: 40px; height: 202px;
background-color: @headerColor; display: flex;
font-family: PingFangSC-Semibold; justify-content: center;
font-size: 15px; flex-flow: column wrap;
color: #fafafa; align-items: center;
line-height: 20px; background-size: 301px 24.7px;
background-color: #fff;
border-radius: 8px;
p {
font-family: PingFangSC-Semibold;
font-size: 16px;
color: #1d3fff;
margin-top: 16px;
flex: 2;
}
span {
font-family: PingFangSC-Regular;
font-size: 14px;
color: #383f45;
flex: 3;
line-height: 25px;
text-indent: 10px;
letter-spacing: 0;
// margin-top: 6px;
}
button {
width: 159px;
flex: 2;
margin-bottom: 16px;
height: 40px;
background-color: @headerColor;
font-family: PingFangSC-Semibold;
font-size: 15px;
color: #fafafa;
line-height: 20px;
}
} }
} }
}
.bird-icon { .bird-icon {
padding-top: 30%; padding-top: 30%;
background: url("../assets/login/right.png") 90% no-repeat; background: url("../assets/login/right.png") 90% no-repeat;
background-size: 51px 25px; background-size: 51px 25px;
}
.login-wrap {
width: 87%;
height: 355px;
margin: 0 auto;
background-color: #fff;
border-radius: 8px;
// margin-top: 15%;
margin-top: 6%;
padding: 32px 24px;
.title {
width: 227px;
height: 71px;
margin-left: -10px;
} }
}
.pwd { .login-wrap {
position: relative; width: 87%;
width: 279px; height: 355px;
margin: 0 auto; margin: 0 auto;
display: flex; background-color: #fff;
display: -webkit-flex; border-radius: 8px;
.pwd-icon { // margin-top: 15%;
margin-top: 2px; margin-top: 6%;
margin-right: 6px; padding: 32px 24px;
margin-left: 4px;
img { .title {
width: 18px; width: 227px;
height: 20px; height: 71px;
margin-left: -10px;
} }
} }
.pwd-input {
width: 100%; .pwd {
.user { position: relative;
background: url("../assets/login/phone.png") 2px 2px no-repeat; width: 279px;
background-size: 25px 25px; margin: 0 auto;
} display: flex;
#passwordInput { display: -webkit-flex;
background: url("../assets/login/passwordConfirm.png") 2px 2px no-repeat;
background-size: 25px 25px; .pwd-icon {
margin-top: 2px;
margin-right: 6px;
margin-left: 4px;
img {
width: 18px;
height: 20px;
}
} }
input {
.pwd-input {
width: 100%; width: 100%;
text-indent: 30px;
font-family: PingFangSC-Regular; .user {
font-size: 14px; background: url("../assets/login/phone.png") 2px 2px no-repeat;
color: #2a2a2a; background-size: 25px 25px;
height: 35px; }
line-height: 35px;
display: flex; #passwordInput {
align-items: center; background: url("../assets/login/passwordConfirm.png") 2px 2px no-repeat;
border-bottom: 1px solid rgba(42, 42, 42, 0.4); background-size: 25px 25px;
margin-top: 30px; }
border-top:1px solid #FFF;
border-left: 1px solid #FFF; input {
border-right: 1px solid #FFF; width: 100%;
} text-indent: 30px;
input:focus { font-family: PingFangSC-Regular;
border-bottom: 1px solid #1d3fff; font-size: 14px;
color: #2a2a2a;
height: 35px;
line-height: 35px;
display: flex;
align-items: center;
border-bottom: 1px solid rgba(42, 42, 42, 0.4);
margin-top: 30px;
border-top: 1px solid #FFF;
border-left: 1px solid #FFF;
border-right: 1px solid #FFF;
}
input:focus {
border-bottom: 1px solid #1d3fff;
}
input::-webkit-input-placeholder {
font-family: PingFangSC-Regular;
font-size: 14px;
color: rgba(75, 74, 75, 0.4);
}
} }
input::-webkit-input-placeholder {
font-family: PingFangSC-Regular; .delete {
font-size: 14px; position: absolute;
color: rgba(75, 74, 75, 0.4); right: -15px;
top: 30px;
img {
margin-right: 20px;
margin-top: 5px;
width: 20px;
// height: 14px;
}
} }
} }
.delete {
position: absolute; .other-function {
right: -15px; width: 279px;
top: 30px; margin: 0 auto;
img { display: flex;
margin-right: 20px; font-family: PingFangSC-Regular;
margin-top: 5px; font-size: 13px;
width: 20px; color: #1d3fff;
// height: 14px; margin-top: 8px;
} font-weight: 500;
display: -webkit-flex;
justify-content: space-between;
-webkit-justify-content: space-between;
} }
}
.other-function { .both-button {
width: 279px; display: flex;
margin: 0 auto; justify-content: space-around;
display: flex;
font-family: PingFangSC-Regular;
font-size: 13px;
color: #1d3fff;
margin-top: 8px;
font-weight: 500;
display: -webkit-flex;
justify-content: space-between;
-webkit-justify-content: space-between;
}
.both-button{
display: flex;
justify-content: space-around;
}
.submit {
background: #1d3fff;
border-radius: 4px;
width: 130px;
margin-top: 32px;
height: 45px;
font-size: 16px;
color: #fff;
display: flex;
display: -webkit-flex;
justify-content: center;
-webkit-justify-content: center;
align-items: center;
-webkit-align-items: center;
&.activated {
opacity: 0.8;
-webkit-transform: scale(1, 1);
transform: scale(1, 1);
} }
}
} .submit {
.platform-ios { background: #1d3fff;
#login { border-radius: 4px;
.pwd-input{ width: 130px;
input{ margin-top: 32px;
line-height: 20px; height: 45px;
font-size: 16px;
color: #fff;
display: flex;
display: -webkit-flex;
justify-content: center;
-webkit-justify-content: center;
align-items: center;
-webkit-align-items: center;
&.activated {
opacity: 0.8;
-webkit-transform: scale(1, 1);
transform: scale(1, 1);
} }
} }
} }
}
@media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) {
.platform-ios { .platform-ios {
#login { #login {
.pwd-input{ .pwd-input {
input{ input {
line-height: 20px; line-height: 20px;
} }
} }
.login-wrap{
margin-top:20%
}
} }
} }
}
// iPhoneXR适配 @media (device-width: 375px) and (device-height: 812px) and (-webkit-min-device-pixel-ratio: 3) {
@media (device-width: 414px) and (device-height: 896px) { .platform-ios {
.platform-ios { #login {
#login { .pwd-input {
.pwd-input{ input {
input{ line-height: 20px;
line-height: 20px; }
}
.login-wrap {
margin-top: 20%
} }
} }
.login-wrap{ }
margin-top:20% }
// iPhoneXR适配
@media (device-width: 414px) and (device-height: 896px) {
.platform-ios {
#login {
.pwd-input {
input {
line-height: 20px;
}
}
.login-wrap {
margin-top: 20%
}
} }
} }
} }
}
</style> </style>
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