diff --git a/packageA/pages/UnitDetails/UnitDetails.vue b/packageA/pages/UnitDetails/UnitDetails.vue
index 86b22b8..e477161 100644
--- a/packageA/pages/UnitDetails/UnitDetails.vue
+++ b/packageA/pages/UnitDetails/UnitDetails.vue
@@ -75,8 +75,9 @@ import { reactive, inject, watch, ref, onMounted, computed } from 'vue';
import { onLoad, onShow } from '@dcloudio/uni-app';
import dictLabel from '@/components/dict-Label/dict-Label.vue';
import { storeToRefs } from 'pinia';
-const { isMiniProgram } = storeToRefs(useUserStore());
import useUserStore from '@/stores/useUserStore';
+const { isMiniProgram } = storeToRefs(useUserStore());
+const { checkAuth } = useUserStore();
import useLocationStore from '@/stores/useLocationStore';
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
const { $api, navTo, vacanciesTo, navBack } = inject('globalFunction');
@@ -111,6 +112,9 @@ onLoad((options) => {
});
function companyCollection() {
+ if (!checkAuth()) {
+ return
+ }
if (dataType.value === 2) {
// 第三方数据收藏逻辑
const id = companyInfo.value.id;
diff --git a/packageA/pages/exhibitors/exhibitors.vue b/packageA/pages/exhibitors/exhibitors.vue
index ca6fce1..69ba464 100644
--- a/packageA/pages/exhibitors/exhibitors.vue
+++ b/packageA/pages/exhibitors/exhibitors.vue
@@ -112,6 +112,7 @@ import { storeToRefs } from 'pinia';
const { longitudeVal, latitudeVal } = storeToRefs(useLocationStore());
import useUserStore from '@/stores/useUserStore';
const { isMiniProgram } = storeToRefs(useUserStore());
+const { checkAuth } = useUserStore();
import { playTextDirectly } from '@/hook/useTTSPlayer-all-in-one';
const isExpanded = ref(false);
@@ -204,6 +205,10 @@ function expand() {
// 取消/预约招聘会
function applyExhibitors() {
+ if (!checkAuth()) {
+ return
+ }
+
const fairId = fairInfo.value.zphID;
if (fairInfo.value.isCollection) {
$api.createRequest(`/app/fair/collection/${fairId}`, {}, 'DELETE').then((resData) => {
diff --git a/packageA/pages/post/post.vue b/packageA/pages/post/post.vue
index fe3e575..66806d3 100644
--- a/packageA/pages/post/post.vue
+++ b/packageA/pages/post/post.vue
@@ -187,6 +187,7 @@ import { storeToRefs } from 'pinia';
import useUserStore from '@/stores/useUserStore';
import { playTextDirectly } from '@/hook/useTTSPlayer-all-in-one';
const { isMiniProgram, hasLogin } = storeToRefs(useUserStore());
+const { checkAuth } = useUserStore();
const { $api, navTo, getLenPx, parseQueryParams, navBack, isEmptyObject } = inject('globalFunction');
import config from '@/config.js';
@@ -322,10 +323,14 @@ function getCompetivetuveness(jobId) {
}
}
-// 申请岗位
+// 申请岗位 第三方需要认证
function jobApply() {
if (dataType.value === 2) {
// 第三方数据申请逻辑
+
+ if (!checkAuth()) {
+ return
+ }
const params = {
jobid: jobInfo.value.id,
jobname: jobInfo.value.gwmc,
@@ -359,8 +364,11 @@ function jobApply() {
}
}
-// 取消/收藏岗位
+// 取消/收藏岗位 都需要认证
function jobCollection() {
+ if (!checkAuth()) {
+ return
+ }
if (dataType.value === 2) {
// 第三方数据收藏逻辑
const id = jobInfo.value.id;
diff --git a/pages.json b/pages.json
index cd14c31..a2857eb 100644
--- a/pages.json
+++ b/pages.json
@@ -63,7 +63,14 @@
{
"path": "pages/search/search",
"style": {
- "navigationBarTitleText": "",
+ "navigationBarTitleText": "搜索",
+ "navigationStyle": "custom"
+ }
+ },
+ {
+ "path": "pages/auth/index",
+ "style": {
+ "navigationBarTitleText": "实名认证",
"navigationStyle": "custom"
}
}
diff --git a/pages/auth/index.vue b/pages/auth/index.vue
new file mode 100644
index 0000000..3b8afd0
--- /dev/null
+++ b/pages/auth/index.vue
@@ -0,0 +1,729 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 身份证号
+ {{ idCardError }}
+
+
+
+
+
+
+
+
+
+
+
+
+ 手机号
+ {{ phoneError }}
+
+
+
+
+
+
+
+
+
+
+
+
+ 验证码
+ {{ codeError }}
+
+
+
+
+ {{ codeBtnText }}
+
+
+
+
+
+
+
+
+
+ 认证信息仅用于身份验证,我们将严格保护您的隐私
+
+
+
+
+
+
+ {{ authStatus.message }}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/mine/mine.vue b/pages/mine/mine.vue
index de85063..a9d7d03 100644
--- a/pages/mine/mine.vue
+++ b/pages/mine/mine.vue
@@ -49,12 +49,12 @@
服务专区
-
+
实名认证
- 已认证
+ {{isAuth ? '已认证' : '未认证'}}
@@ -112,7 +112,7 @@ const { $api, navTo } = inject('globalFunction');
import useUserStore from '@/stores/useUserStore';
const popup = ref(null);
-const { userInfo, Completion, counts, isMachineEnv } = storeToRefs(useUserStore());
+const { userInfo, Completion, counts, isMachineEnv, isAuth } = storeToRefs(useUserStore());
import useScreenStore from '@/stores/useScreenStore';
const screenStore = useScreenStore();
@@ -144,12 +144,10 @@ function confirm() {
const isAbove90 = (percent) => parseFloat(percent) < 90;
-function selectFile() {
- // FileUploader.showMenuAndUpload({
- // success: function (res) {
- // alert('上传成功: ' + JSON.stringify(res));
- // },
- // });
+function goAuth() {
+ if(!isAuth.value){
+ navTo('/pages/auth/index')
+ }
}
function chooseFileUploadTest(pam) {}
diff --git a/static/icon/input-delete.png b/static/icon/input-delete.png
new file mode 100644
index 0000000..dcb2276
Binary files /dev/null and b/static/icon/input-delete.png differ
diff --git a/stores/useUserStore.js b/stores/useUserStore.js
index d834780..65aa0bb 100644
--- a/stores/useUserStore.js
+++ b/stores/useUserStore.js
@@ -2,7 +2,8 @@ import {
defineStore
} from 'pinia';
import {
- ref
+ ref,
+ inject
} from 'vue'
import {
createRequest
@@ -17,6 +18,7 @@ import {
import {
msg,
$api,
+ navTo
} from '../common/globalFunction';
import baseDB from '@/utils/db.js';
@@ -61,6 +63,7 @@ const useUserStore = defineStore("user", () => {
const counts = ref({})
const isMiniProgram = ref(false)
const isMachineEnv = ref(false)
+ const isAuth = ref(false) //是否认证(身份证+手机号)
const login = (value) => {
hasLogin.value = true;
@@ -135,6 +138,19 @@ const useUserStore = defineStore("user", () => {
userInfo.value = values.data;
// role.value = values.role;
hasLogin.value = true;
+ isAuth.value = values.data?.isCert ?? false
+ }
+
+ const checkAuth = () => {
+ if (!hasLogin.value) {
+ logOut()
+ return false //验证失败
+ }
+ if (hasLogin.value && !isAuth.value) {
+ navTo('/pages/auth/index')
+ return false //验证失败
+ }
+ return true // 验证通过
}
@@ -186,7 +202,9 @@ const useUserStore = defineStore("user", () => {
isMiniProgram,
changMiniProgramAppStatus,
changMachineEnv,
- isMachineEnv
+ isMachineEnv,
+ isAuth,
+ checkAuth
}
}, {
unistorage: true,
diff --git a/utils/request.js b/utils/request.js
index c354acb..27261da 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -137,6 +137,7 @@ export function createRequest(url, data = {}, method = 'GET', loading = false, h
} = resData.data
if (code === 200) {
resolve(resData.data)
+ console.log(resData.data.data,'接口解密')
return
}
if (msg) {