|
@ -71,7 +71,7 @@ |
|
|
v-model="code" |
|
|
v-model="code" |
|
|
style="background-color: lightgray;padding-top: 40rpx;padding-bottom: 40rpx;margin-right: 20rpx;" /> |
|
|
style="background-color: lightgray;padding-top: 40rpx;padding-bottom: 40rpx;margin-right: 20rpx;" /> |
|
|
</view> --> |
|
|
</view> --> |
|
|
<view class="uni-input-wrapper" > |
|
|
<view class="uni-input-wrapper"> |
|
|
<input class="" style="height: 80rpx; background-color: #F7F9FF;margin-right: 20rpx;" |
|
|
<input class="" style="height: 80rpx; background-color: #F7F9FF;margin-right: 20rpx;" |
|
|
placeholder="请输入验证码" type="number" v-model="code" /> |
|
|
placeholder="请输入验证码" type="number" v-model="code" /> |
|
|
</view> |
|
|
</view> |
|
@ -120,7 +120,7 @@ |
|
|
code: "", |
|
|
code: "", |
|
|
uuid: "", |
|
|
uuid: "", |
|
|
version: "", |
|
|
version: "", |
|
|
needCode:false |
|
|
needCode: false |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// computed: mapState(['forcedLogin', 'hasLogin']), |
|
|
// computed: mapState(['forcedLogin', 'hasLogin']), |
|
@ -132,7 +132,7 @@ |
|
|
storage.clearStorage() |
|
|
storage.clearStorage() |
|
|
if (process.env.NODE_ENV === 'development') { |
|
|
if (process.env.NODE_ENV === 'development') { |
|
|
this.username = "admin" |
|
|
this.username = "admin" |
|
|
this.password = "win123456"; |
|
|
this.password = "CD_win09"; |
|
|
} |
|
|
} |
|
|
uni.setNavigationBarColor({ |
|
|
uni.setNavigationBarColor({ |
|
|
frontColor: '#ffffff', |
|
|
frontColor: '#ffffff', |
|
@ -158,7 +158,7 @@ |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
onLoad() { |
|
|
onLoad() { |
|
|
if(this.needCode){ |
|
|
if (this.needCode) { |
|
|
getCaptchaImage().then(res => { |
|
|
getCaptchaImage().then(res => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
var code = res.data.img; |
|
|
var code = res.data.img; |
|
@ -189,15 +189,13 @@ |
|
|
icon: 'none', |
|
|
icon: 'none', |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} else if (this.needCode && this.code === '') { |
|
|
else if (this.needCode&&this.code === '') { |
|
|
|
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: '验证码不能为空', |
|
|
title: '验证码不能为空', |
|
|
icon: 'none', |
|
|
icon: 'none', |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} else { |
|
|
else { |
|
|
|
|
|
// console.log("用户名:", this.username, "密码:", this.password, this.tapstyle, this.smloginmsg) |
|
|
// console.log("用户名:", this.username, "密码:", this.password, this.tapstyle, this.smloginmsg) |
|
|
let logininfo = { |
|
|
let logininfo = { |
|
|
username: "", |
|
|
username: "", |
|
@ -232,7 +230,7 @@ |
|
|
title: "正在登录", |
|
|
title: "正在登录", |
|
|
mask: true |
|
|
mask: true |
|
|
}) |
|
|
}) |
|
|
try{ |
|
|
try { |
|
|
var result = await this.$store.dispatch('Login', logininfo); |
|
|
var result = await this.$store.dispatch('Login', logininfo); |
|
|
// await this.$store.dispatch('GetTenantIdInfo', this.tenantName) |
|
|
// await this.$store.dispatch('GetTenantIdInfo', this.tenantName) |
|
|
console.log(result) |
|
|
console.log(result) |
|
@ -242,7 +240,7 @@ |
|
|
url: '/pages/index/index' |
|
|
url: '/pages/index/index' |
|
|
}); |
|
|
}); |
|
|
uni.setStorageSync('username', this.username); |
|
|
uni.setStorageSync('username', this.username); |
|
|
}catch(e){ |
|
|
} catch (e) { |
|
|
uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
this.showErrorMessage(e) |
|
|
this.showErrorMessage(e) |
|
|
} |
|
|
} |
|
@ -262,7 +260,12 @@ |
|
|
showErrorMessage(message) { |
|
|
showErrorMessage(message) { |
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
|
|
|
if (message.includes("密码策略")) { |
|
|
|
|
|
uni.setStorageSync('username', this.username); |
|
|
|
|
|
uni.reLaunch({ |
|
|
|
|
|
url: '/pages/setter/loginPwdUpdate' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|