113 lines
2.9 KiB
Vue
113 lines
2.9 KiB
Vue
<!--sso login-->
|
|
<template>
|
|
<view>
|
|
<view class="hz-text-center" style="padding-top:200rpx;">
|
|
<image src="../../static/images/logo.png" style="width:138rpx;height:140rpx;"></image>
|
|
</view>
|
|
<view class="hz-font-bolder hz-font-xl hz-text-center hz-font-color-primary">
|
|
{{$t('common.appName')}}
|
|
</view>
|
|
<view class="hz-font-bolder hz-font-xl hz-text-center hz-font-color-dark" style="margin-top:100rpx;">
|
|
{{$t('common.userLogin')}}
|
|
</view>
|
|
<view style="margin-top:30rpx;margin-right:60rpx;margin-left:60rpx;">
|
|
<u--input
|
|
v-model="userId"
|
|
placeholder="Login User ID"
|
|
prefixIcon="account"
|
|
prefixIconStyle="font-size: 20px;color:#C39A4B;"
|
|
customStyle="border-radius:22px;"
|
|
></u--input>
|
|
</view>
|
|
<view style="margin-top:30rpx;margin-right:60rpx;margin-left:60rpx;">
|
|
<u--input
|
|
v-model="password"
|
|
placeholder="Login Password"
|
|
prefixIcon="lock-open"
|
|
:password="true"
|
|
prefixIconStyle="font-size: 20px;color: #C39A4B"
|
|
customStyle="border-radius:22px;"
|
|
></u--input>
|
|
</view>
|
|
<view style="margin-top:30rpx;margin-right:60rpx;margin-left:60rpx;">
|
|
<view @click="internalLogin" class="hz-btn hz-font-color-white hz-font-lg hz-font-bold hz-text-center" >{{$t("common.loginsso")}}</view>
|
|
</view>
|
|
<u-modal :content="msgStr" :show="showMsg" :confirmText="yesText" closeOnClickOverlay @confirm="confirmMsg" confirmColor="#C39A4B" @cancel="cancelMsg" @close="cancelMsg"></u-modal>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import config from '../../common/config.js'
|
|
export default {
|
|
data() {
|
|
return {
|
|
// 数据变量
|
|
userId: '',
|
|
password:'',
|
|
// 界面变量
|
|
msgStr:'',
|
|
showMsg:false,
|
|
yesText:this.$t("common.ok"),
|
|
|
|
}
|
|
},
|
|
onLoad(options) {
|
|
if(options && options.errorCode){
|
|
if(options.errorCode=='FormLoginFailed'){
|
|
this.msgStr = this.$t("common.loginerror");
|
|
}
|
|
else if(options.errorCode=='MFALoginFailed'){
|
|
this.msgStr = this.$t("common.mfaerror");
|
|
}
|
|
else
|
|
{
|
|
this.msgStr = this.$t("common.loginfail");
|
|
}
|
|
this.showMsg = true;
|
|
}else{
|
|
this.showMsg = false;
|
|
}
|
|
},
|
|
onShow() {
|
|
},
|
|
methods: {
|
|
// 数据方法
|
|
async internalLogin(){
|
|
// 判断用户名密码是否为空
|
|
|
|
if(this.userId!='' && this.password!=''){
|
|
if(this.userId.indexOf('@')==-1){
|
|
this.userId = this.userId + '@mgm.mo';
|
|
}
|
|
uni.redirectTo({
|
|
url:'/pages/samlLogin/samlLogin?uid=' + encodeURIComponent(this.userId) + '&pwd=' + encodeURIComponent(this.password)
|
|
})
|
|
}
|
|
else{
|
|
this.msgStr = this.$t("common.inputUserNameAndPassword");
|
|
this.showMsg = true;
|
|
}
|
|
|
|
},
|
|
// 界面方法
|
|
initUI() {
|
|
},
|
|
confirmMsg(){
|
|
this.showMsg = false;
|
|
},
|
|
cancelMsg(){
|
|
this.showMsg = false;
|
|
}
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.u-border {
|
|
border-width: 0.5px !important;
|
|
border-color: #434343 !important;
|
|
border-style: solid;
|
|
height:30px;
|
|
}
|
|
</style>
|