diff --git a/api/index.js b/api/index.js index 61fb15c..e617290 100644 --- a/api/index.js +++ b/api/index.js @@ -1,4 +1,4 @@ -import {post, upload, uploads,videoApiGet} from "@/utils/request"; +import {post, upload, uploads,videoApiGet,loginRequest} from "@/utils/request"; export const submitLogin = (params) => post("/sys/login", params) // 登录 export const getUserInfo = (params) => post("/sys/user/info/app", params); // 获取用户信息 diff --git a/pages.json b/pages.json index 7c68a2f..5d80598 100644 --- a/pages.json +++ b/pages.json @@ -821,6 +821,12 @@ "navigationBarTitleText" : "股份公司车辆管理" } }, + { + "path": "pages/mine/face/face_authentication", + "style": { + "navigationBarTitleText": "人脸认证" + } + }, { "path" : "pages/door_access_control/share_office_vehicle_info/add", "style" : { diff --git a/pages/mine/face/face_authentication.nvue b/pages/mine/face/face_authentication.nvue new file mode 100644 index 0000000..85cec21 --- /dev/null +++ b/pages/mine/face/face_authentication.nvue @@ -0,0 +1,138 @@ + + + + + diff --git a/pages/mine/index/index.vue b/pages/mine/index/index.vue index fdbc90d..9fa558e 100644 --- a/pages/mine/index/index.vue +++ b/pages/mine/index/index.vue @@ -61,6 +61,10 @@ export default { img: require('../../../static/images/my_ico1.png'), name:'个人信息', }, + { + img: require('../../../static/images/my_ico2.png'), + name: '人脸认证', + }, { img: require('../../../static/images/my_ico3.png'), name:'问题反馈', @@ -137,11 +141,17 @@ export default { url: '/pages/mine/promise/promise' }) }, + faceAuthentication() { + uni.navigateTo({ + url: '/pages/mine/face/face_authentication' + }) + }, clickItem(name){ if(name === '个人信息') this.goabout() if(name === '问题反馈') this.feedbackclick() if(name === '安全承诺') this.promiseclick() if(name === '修改密码') this.pwdclick() + if(name === '人脸认证') this.faceAuthentication() // #ifdef APP-PLUS if(name === '版本更新') this.fnUpdateVersion() // #endif diff --git a/utils/request.js b/utils/request.js index 9b12488..eda424d 100644 --- a/utils/request.js +++ b/utils/request.js @@ -226,6 +226,51 @@ function videoApiGet(url, data) { }) } +function loginRequest(url, data = {}) { + return new Promise((resolve, reject) => { + if (data && data.loading !== false) { + uni.showLoading({ + title: "加载中", + mask: true, + }); + } + uni.request({ + url: requestPath + url, + data: { + ...data, + }, + header: { + "Content-type": data?.postMethod || "application/json", + }, + method: "POST", + success: (res) => { + if (data && data.loading !== false) { + uni.hideLoading(); + } + if (res.data.result === "success") { + resolve(res.data); + } else { + uni.showToast({ + title: res.data || "系统开小差了", + icon: "none", + }); + reject(res.data); + } + }, + fail: (err) => { + if (data && data.loading !== false) { + uni.hideLoading(); + } + uni.showToast({ + title: "网络错误请重试", + icon: "none", + }); + reject(err); + }, + }); + }); +} + setInterval(async () => { if (uni.getStorageSync('tokenTime') == null) return; if (dayjs().diff(dayjs(uni.getStorageSync('tokenTime')), "minute") >= 5) { @@ -234,4 +279,4 @@ setInterval(async () => { } }, 1000 * 60); -export {post, upload, uploads,setBasePath,videoApiGet} +export {post, upload, uploads,setBasePath,videoApiGet,loginRequest}