·修改部分页面数据冗余

This commit is contained in:
lemon橪
2021-05-14 17:31:40 +08:00
parent 23804939eb
commit 7f4212755d
42 changed files with 1415 additions and 2987 deletions

View File

@@ -1,40 +0,0 @@
<template>
<view class="device-manage">
<u-cell-group>
<u-cell-item class="border-top" :arrow="false" title="常用设备保护">
<u-switch slot="right-icon" active-color="#1abc9c" size="40" v-model="checked"></u-switch>
</u-cell-item>
</u-cell-group>
<view class="describe">开启常用设备保护后在不常用的手机上登录时需要进行账号及密码验证通过后继续登录</view>
<view class="title">常用设备</view>
<u-cell-group class="">
<u-cell-item
title="HUAWEI Mate30"
:center="true"
label="最近使用2020-06-28北京市"
value="正在使用"
:value-style="{color:'#1abc9c','font-size':'14px'}"
:title-style="{'color':'#333'}"
>
</u-cell-item>
</u-cell-group>
</view>
</template>
<script>
export default {
data() {
return {
checked:true
};
}
}
</script>
<style lang="scss">
.device-manage{
.title{
padding:0 30rpx 20rpx;
}
}
</style>

View File

@@ -40,10 +40,9 @@
<script>
import { sendMobile, resetByMobile, modifyPass } from "@/api/login";
import storage from "@/utils/storage.js";
import { md5 } from "@/utils/md5.js";
import myVerification from "@/components/verification/verification.vue";
import { md5 } from "@/utils/md5.js"; // md5
import myVerification from "@/components/verification/verification.vue"; //验证
import uuid from "@/utils/uuid.modified.js";
export default {
components: {
@@ -65,15 +64,15 @@ export default {
],
step: 0, //当前验证步骤
flage: false, //是否验证码验证
// 验证码登录form
codeForm: {
mobile: "", //手机号
code: "", //验证码
},
newPassword: "",//新密码
newPassword: "", //新密码
password: "", //密码
tips: "", //提示
seconds: 60,
tips: "", //提示
seconds: 60, // 60s等待时间
// 验证码登录校验
codeRules: {
@@ -174,7 +173,7 @@ export default {
}
});
},
codeChange(text) {
this.tips = text;
},

View File

@@ -1,80 +1,82 @@
// TODO 第一版本暂无此功能 后续优化以及更新
<template>
<view class="face-login">
<u-cell-group>
<u-cell-item class="border-top" :arrow="false" title="面容登录">
<u-switch slot="right-icon" @change="faceSwitchChange" active-color="#1abc9c" size="40" v-model="checked"></u-switch>
</u-cell-item>
</u-cell-group>
<view class="describe">开启后可使用面容认证完成快捷登录设置仅对本机生效</view>
</view>
<view class="face-login">
<u-cell-group>
<u-cell-item class="border-top" :arrow="false" title="面容登录">
<u-switch slot="right-icon" @change="faceSwitchChange" active-color="#1abc9c" size="40" v-model="checked"></u-switch>
</u-cell-item>
</u-cell-group>
<view class="describe">开启后可使用面容认证完成快捷登录设置仅对本机生效</view>
</view>
</template>
<script>
import storage from '@/utils/storage.js';
import { setBiolofy } from '@/api/passport.js';
import storage from "@/utils/storage.js";
import { setBiolofy } from "@/api/passport.js";
export default {
data() {
return {
checked: true
};
},
methods: {
faceSwitchChange(value) {
if (value === true) {
const res = uni.getSystemInfoSync();
plus.device.getInfo({
success: function(e) {
let params = {
mobile_type: res.model,
secret_key: e.uuid
};
setBiolofy(params).then(res => {
if (res.statusCode === 200) {
storage.setFaceLogin(true);
}
});
},
fail: function(e) {
//plus.nativeUI.toast('获取设备信息错误:' + JSON.stringify(e));
console.error('getDeviceInfo failed: ' + JSON.stringify(e));
}
});
} else {
storage.setFaceLogin(false);
}
}
},
onLoad() {
// #ifdef APP-PLUS
uni.checkIsSupportSoterAuthentication({
success(res) {
if (!res.supportMode.find(e => e === 'facial')) {
plus.nativeUI.toast('此设备不支持面部识别');
uni.navigateBack();
}
uni.checkIsSoterEnrolledInDevice({
checkAuthMode: 'facial',
success(_res) {
if (!_res.isEnrolled) {
plus.nativeUI.toast('此设备未录入面部信息');
uni.navigateBack();
}
},
fail(_err) {
// plus.nativeUI.toast(JSON.stringify(_err));
uni.navigateBack();
}
});
},
fail(err) {
// plus.nativeUI.toast(JSON.stringify(err));
uni.navigateBack();
}
});
this.checked = storage.getFaceLogin() || false;
// #endif
}
data() {
return {
lightColor: this.$lightColor,
checked: true,
};
},
methods: {
faceSwitchChange(value) {
if (value === true) {
const res = uni.getSystemInfoSync();
plus.device.getInfo({
success: function (e) {
let params = {
mobile_type: res.model,
secret_key: e.uuid,
};
setBiolofy(params).then((res) => {
if (res.statusCode === 200) {
storage.setFaceLogin(true);
}
});
},
fail: function (e) {
//plus.nativeUI.toast('获取设备信息错误:' + JSON.stringify(e));
console.error("getDeviceInfo failed: " + JSON.stringify(e));
},
});
} else {
storage.setFaceLogin(false);
}
},
},
onLoad() {
// #ifdef APP-PLUS
uni.checkIsSupportSoterAuthentication({
success(res) {
if (!res.supportMode.find((e) => e === "facial")) {
plus.nativeUI.toast("此设备不支持面部识别");
uni.navigateBack();
}
uni.checkIsSoterEnrolledInDevice({
checkAuthMode: "facial",
success(_res) {
if (!_res.isEnrolled) {
plus.nativeUI.toast("此设备未录入面部信息");
uni.navigateBack();
}
},
fail(_err) {
// plus.nativeUI.toast(JSON.stringify(_err));
uni.navigateBack();
},
});
},
fail(err) {
// plus.nativeUI.toast(JSON.stringify(err));
uni.navigateBack();
},
});
this.checked = storage.getFaceLogin() || false;
// #endif
},
};
</script>

View File

@@ -1,70 +1,70 @@
// TODO 第一版本暂无此功能 后续优化以及更新
<template>
<view class="finger">
<u-cell-group>
<u-cell-item class="border-top" :arrow="false" title="指纹登录">
<u-switch slot="right-icon" @change="fingerSwitchChange" active-color="#1abc9c" size="40" v-model="checked"></u-switch>
</u-cell-item>
</u-cell-group>
<view class="describe">开启后可使用指纹认证完成快捷登录设置仅对本机生效如需修改指纹请在系统设置中操作</view>
</view>
<view class="finger">
<u-cell-group>
<u-cell-item class="border-top" :arrow="false" title="指纹登录">
<u-switch slot="right-icon" @change="fingerSwitchChange" :active-color="lightColor" size="40" v-model="checked"></u-switch>
</u-cell-item>
</u-cell-group>
<view class="describe">开启后可使用指纹认证完成快捷登录设置仅对本机生效如需修改指纹请在系统设置中操作</view>
</view>
</template>
<script>
import storage from '@/utils/storage.js';
import { setBiolofy } from '@/api/passport.js';
import storage from "@/utils/storage.js";
import { setBiolofy } from "@/api/passport.js";
export default {
data() {
return {
checked: false
};
},
methods: {
fingerSwitchChange(value) {
if (value === true) {
const res = uni.getSystemInfoSync();
plus.device.getInfo({
success: function(e) {
let params = {
mobile_type: res.model,
secret_key: e.uuid
};
setBiolofy(params).then(res => {
if (res.statusCode === 200) {
storage.setFingerLogin(true);
}
});
},
fail: function(e) {
console.error('getDeviceInfo failed: ' + JSON.stringify(e));
}
});
} else {
storage.setFingerLogin(false);
}
}
},
onLoad() {
// #ifdef APP-PLUS
if (!plus.fingerprint.isSupport()) {
plus.nativeUI.toast('此设备不支持指纹识别');
uni.navigateBack();
}
if (!plus.fingerprint.isKeyguardSecure()) {
plus.nativeUI.toast('此设备未设置密码锁屏');
uni.navigateBack();
}
if (!plus.fingerprint.isEnrolledFingerprints()) {
plus.nativeUI.toast('此设备未录入指纹');
uni.navigateBack();
}
this.checked = storage.getFingerLogin() || false;
// #endif
}
data() {
return {
lightColor: this.$lightColor,
checked: false,
};
},
methods: {
fingerSwitchChange(value) {
if (value === true) {
const res = uni.getSystemInfoSync();
plus.device.getInfo({
success: function (e) {
let params = {
mobile_type: res.model,
secret_key: e.uuid,
};
setBiolofy(params).then((res) => {
if (res.statusCode === 200) {
storage.setFingerLogin(true);
}
});
},
fail: function (e) {
console.error("getDeviceInfo failed: " + JSON.stringify(e));
},
});
} else {
storage.setFingerLogin(false);
}
},
},
onLoad() {
// #ifdef APP-PLUS
if (!plus.fingerprint.isSupport()) {
plus.nativeUI.toast("此设备不支持指纹识别");
uni.navigateBack();
}
if (!plus.fingerprint.isKeyguardSecure()) {
plus.nativeUI.toast("此设备未设置密码锁屏");
uni.navigateBack();
}
if (!plus.fingerprint.isEnrolledFingerprints()) {
plus.nativeUI.toast("此设备未录入指纹");
uni.navigateBack();
}
this.checked = storage.getFingerLogin() || false;
// #endif
},
};
</script>
<style lang="scss">
.finger {
}
<style scoped lang="scss">
</style>