From 333316f207b4aad554e309b1940bfa79fcaf8d47 Mon Sep 17 00:00:00 2001 From: Net Date: Tue, 13 May 2025 15:39:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=95=99=E5=B8=88=E6=A1=A3?= =?UTF-8?q?=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/base/server.ts | 26 +- src/api/system/dic/index.ts | 32 +- src/api/system/login/index.ts | 61 ++-- .../BasicForm/components/BasicDataPicker.vue | 153 +++++--- .../BasicForm/src/BasicComponent.vue | 1 + src/components/BasicForm/type/useForm.d.ts | 1 + src/config.ts | 8 +- src/pages/system/launchPage/launchPage.vue | 77 +++- src/pages/system/login/login.vue | 91 ++++- .../hr/teacherProfile/EmergencyContact.vue | 44 ++- .../view/hr/teacherProfile/ExperienceInfo.vue | 62 ++-- .../view/hr/teacherProfile/FamilyInfo.vue | 241 +++++++------ .../view/hr/teacherProfile/PersonalHonor.vue | 52 +-- .../view/hr/teacherProfile/PositionInfo.vue | 91 +++-- .../hr/teacherProfile/PublicClassAwards.vue | 64 ++-- .../hr/teacherProfile/RecordMaterials.vue | 72 ++-- .../view/hr/teacherProfile/TitleInfo.vue | 95 +++-- src/pages/view/hr/teacherProfile/index.vue | 338 ++++++++++++------ src/store/modules/data.ts | 50 ++- src/store/modules/user.ts | 2 +- 20 files changed, 1053 insertions(+), 508 deletions(-) diff --git a/src/api/base/server.ts b/src/api/base/server.ts index 328a54e..dfdd8b8 100644 --- a/src/api/base/server.ts +++ b/src/api/base/server.ts @@ -1,26 +1,20 @@ // 参数接口 // 响应接口 -import {get, post} from "@/utils/request"; - +import { get, post } from "@/utils/request"; /** * 获取服务器时间 */ -export const serverTimeApi = async () => { - return await get('/api/server/serverTime') -} -export const standardWordsRandomApi = async () => { - return await get('/api/standardWords/findRandom') -} -export const cmsArticleFindPageApi = async (params: any) => { - return await get("/api/cmsArticle/findPage", params); +export const xqgwFindAllApi = async () => { + return await get("/api/xqgw/findAll"); }; - -export const agencyAgencyListApi = async () => { - return await get("/api/agency/agencyList"); +export const xqxjFindAllApi = async () => { + return await get("/api/xqxj/findAll"); }; - -export const serverCheckInRangeTimeApi = async () => { - return await get("/api/server/checkInRangeTime"); +export const findAllNjBjTreeApi = async () => { + return await get("/api/nj/findAllNjBjTree"); +}; +export const jsConfirmJsDataApi = async (params: any) => { + return await post("/api/js/confirmJsData", params); }; diff --git a/src/api/system/dic/index.ts b/src/api/system/dic/index.ts index 80b6e7d..c91f4e1 100644 --- a/src/api/system/dic/index.ts +++ b/src/api/system/dic/index.ts @@ -1,22 +1,40 @@ -import {get, post} from "@/utils/request"; +import { get, post } from "@/utils/request"; //字典接口 export const dicApi = async (param: { pid: number }) => { - return await get("/api/dic/findByPid", param); + return await get("/api/dic/findByPid", param); +}; +//字典接口 +export const findDicTreeByPidApi = async (param: { pid: number }) => { + return await get("/api/dic/findDicTreeByPid", param); }; //根据id查询部门 export const deptFindAllDeptsByPidApi = async (param: { pid: number }) => { - return await get("/api/dept/findAllDeptsByPid", param); + return await get("/api/dept/findAllDeptsByPid", param); }; //刷新token export const refreshTokenApi = async (param: { refresh_token: string }) => { - return await post("/userlogin/refresh-token?refresh_token=" + param.refresh_token, param); + return await post( + "/userlogin/refresh-token?refresh_token=" + param.refresh_token, + param + ); }; //修改用户部门 -export const userSaveApi = async (param: { id: string, deptId: string, deptName: string }) => { - return await post("/api/user/save?deptId=" + param.deptId + '&deptName=' + param.deptName + '&id=' + param.id, param); +export const userSaveApi = async (param: { + id: string; + deptId: string; + deptName: string; +}) => { + return await post( + "/api/user/save?deptId=" + + param.deptId + + "&deptName=" + + param.deptName + + "&id=" + + param.id, + param + ); }; - diff --git a/src/api/system/login/index.ts b/src/api/system/login/index.ts index 94b0687..49b7bc0 100644 --- a/src/api/system/login/index.ts +++ b/src/api/system/login/index.ts @@ -1,49 +1,68 @@ //登录接口 -import {get, post} from "@/utils/request"; +import { get, post } from "@/utils/request"; //密码登录接口 -export const loginPass = async (param: { username: string, password: string, openId: number | string }) => { - return await post("/userlogin/check?username=" + param.username + '&password=' + param.password + '&openId=' + param.openId, param - ) - ; +export const loginPass = async (param: { + username: string; + password: string; + openId: number | string; +}) => { + return await post( + "/userlogin/check?username=" + + param.username + + "&password=" + + param.password + + "&openId=" + + param.openId, + param + ); }; //验证码登录接口 -export const loginCode = async (param: { phone: string | number, code: string | number, openId: number | string }) => { - return await post("/open/sms/checkCode", param); +export const loginCode = async (param: { + phone: string | number; + code: string | number; + openId: number | string; +}) => { + return await post("/open/sms/checkCode", param); }; //验证码登录接口 export const loginCheckCode = async (param: any) => { - return await post("/open/sms/checkCode", param); + return await post("/open/sms/checkCode", param); }; //获取验证码接口 -export const sendCodeApi = async (param:any) => { - return await get("/open/sms/sendCode", param); +export const sendCodeApi = async (param: any) => { + return await get("/open/sms/sendCode", param); }; //获取验证码接口 export const sendToUserApi = async (param: string) => { - return await post("/open/sms/sendToUser", param); + return await post("/open/sms/sendToUser", param); }; //微信获取手机号登录接口 export const weChatLogin = async (param: any) => { - return await get("/userlogin/weloginByCode", param); + return await get("/userlogin/weloginByCode", param); }; //获取用户按钮权限 export const authenticationApi = async (param: { userId: string }) => { - return await get("/api/authentication/find-by-user", param); -}; - -// 汇兴小程序登录 -export const huiXingLoginApi = async (param: { token: string }) => { - return await post("/userlogin/appCheck?token=" + param.token, param); + return await get("/api/authentication/find-by-user", param); }; //获取公众号票据 export const wxConfigApi = async (param: any) => { - return await post("/userlogin/wxConfig", param); + return await post("/userlogin/wxConfig", param); }; -export const checkOpenId = async (param: { openId: string | number, appCode: string }) => { - return await post("/open/sms/checkOpenId", param); + +export const checkOpenId = async (param: { + openId: string | number; + appCode: string; +}) => { + return await post("/open/login/js/checkUser", param); +}; +export const updateUserApi = async (param: any) => { + return await post("/open/login/js/updateUser", param); +}; +export const findJsByPhoneApi = async (param: any) => { + return await get("/api/js/findJsByPhone", param); }; diff --git a/src/components/BasicForm/components/BasicDataPicker.vue b/src/components/BasicForm/components/BasicDataPicker.vue index effaa9c..222557a 100644 --- a/src/components/BasicForm/components/BasicDataPicker.vue +++ b/src/components/BasicForm/components/BasicDataPicker.vue @@ -1,73 +1,128 @@ \ No newline at end of file + diff --git a/src/components/BasicForm/src/BasicComponent.vue b/src/components/BasicForm/src/BasicComponent.vue index d436b92..30dfa2c 100644 --- a/src/components/BasicForm/src/BasicComponent.vue +++ b/src/components/BasicForm/src/BasicComponent.vue @@ -14,6 +14,7 @@ + diff --git a/src/components/BasicForm/type/useForm.d.ts b/src/components/BasicForm/type/useForm.d.ts index 322e14c..851f2af 100644 --- a/src/components/BasicForm/type/useForm.d.ts +++ b/src/components/BasicForm/type/useForm.d.ts @@ -26,6 +26,7 @@ type Component = | 'BasicDataPicker' | 'BasicSearchList' | 'BasicDateTimes' + | 'BasicTree' interface FormsSchema { field?: string, diff --git a/src/config.ts b/src/config.ts index 423df1c..039659e 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,15 +1,15 @@ -const ip: string = "dj.zhongjingzh.com"; +const ip: string = "192.168.8.35:8897"; //打包服务器接口代理标识 const SERVERAGENT: string = "/"; //本地代理url地址,配置了就启动代理,没配置就不启动代理 export const HOMEAGENT: string = ""; // 接口地址 export const BASE_URL: string = - process.env.NODE_ENV == "development" ? `http://${ip}/yqdj` : SERVERAGENT; + process.env.NODE_ENV == "development" ? `http://${ip}/zhxy` : SERVERAGENT; // WebSocket地址 export const BASE_WS_URL: string = `wss://${ip}`; //图片地址 -export const BASE_IMAGE_URL: string = `http://${ip}`; +export const BASE_IMAGE_URL: string = `http://${ip}/zhxy`; //存token的key export const AUTH_KEY: string = "satoken"; //token过期返回状态码 @@ -17,7 +17,7 @@ export const RESULT_CODE_NOT_LOGIN: number = 10; //是否打印接口日志 export const ISREQUESTLOG: boolean = false; //是否打开登录页面拦截 -export const ISROUTERINTERCEPT: boolean = false; +export const ISROUTERINTERCEPT: boolean = true; //配置路由白名单 export const WHITELIST: WhiteList = []; //主题颜色 diff --git a/src/pages/system/launchPage/launchPage.vue b/src/pages/system/launchPage/launchPage.vue index 2a14e3f..2f966b5 100644 --- a/src/pages/system/launchPage/launchPage.vue +++ b/src/pages/system/launchPage/launchPage.vue @@ -1,24 +1,79 @@ diff --git a/src/pages/system/login/login.vue b/src/pages/system/login/login.vue index 468619b..37d9472 100644 --- a/src/pages/system/login/login.vue +++ b/src/pages/system/login/login.vue @@ -44,7 +44,7 @@ @@ -87,14 +87,24 @@ import { ref, reactive, computed } from "vue"; import CustomUpload from "/src/components/BasicUpload/CustomUpload.vue"; import { onUnmounted } from "vue"; -import { hideLoading, showLoading } from "@/utils/uniapp"; +import { hideLoading, isTabBar, showLoading } from "@/utils/uniapp"; import { attachmentUpload } from "@/api/system/upload"; - +import { useDataStore } from "@/store/modules/data"; +import { + findJsByPhoneApi, + sendCodeApi, + updateUserApi, +} from "@/api/system/login"; +import { useUserStore } from "@/store/modules/user"; +import pages from "@/pages.json"; +const { getGlobal } = useDataStore(); const formData = reactive({ - name: "", + loginName: "", phone: "", code: "", - avatar_url: "", + avatarUrl: "", + openId: getGlobal.openId, + appCode: "JS", }); const countdown = ref(60); @@ -104,7 +114,7 @@ const countdownText = computed(() => { return isCountingDown.value ? `${countdown.value}s后重试` : "获取验证码"; }); -const handleGetCode = () => { +const handleGetCode = async () => { if (isCountingDown.value) { return; } @@ -114,7 +124,14 @@ const handleGetCode = () => { } console.log("获取验证码,手机号:", formData.phone); - + const result = await sendCodeApi({ + phone: formData.phone, + }); + if (result.resultCode == 1) { + uni.showToast({ title: "验证码发送成功", icon: "success" }); + } else { + uni.showToast({ title: "验证码发送失败", icon: "none" }); + } isCountingDown.value = true; countdown.value = 60; // 重置倒计时 timer = setInterval(() => { @@ -128,25 +145,70 @@ const handleGetCode = () => { }, 1000); }; -const handleVerify = () => { +function toHome() { + if (isTabBar()) { + uni.switchTab({ + url: "/" + (pages as any).tabBar.list[0].pagePath, + }); + } else { + uni.reLaunch({ + url: "/" + pages.pages[1].path, + }); + } +} + +const { afterLoginAction } = useUserStore(); +const { setFile } = useDataStore(); +const handleVerify = async () => { if ( - !formData.name || + !formData.loginName || !formData.phone || !formData.code || - !formData.avatar_url + !formData.avatarUrl ) { uni.showToast({ title: "请填写完整的验证信息", icon: "none" }); return; } - console.log("提交验证信息:", formData); - uni.showToast({ title: "验证成功 (模拟)", icon: "success" }); + const result = await updateUserApi({ + loginName: formData.loginName, + phone: formData.phone, + code: formData.code, + avatarUrl: formData.avatarUrl, + openId: getGlobal.openId, + appCode: "JS", + }); + if (result.resultCode == 1) { + afterLoginAction(result.result); + uni.showToast({ title: "验证成功", icon: "success" }); + const findJsByPhoneResult = await findJsByPhoneApi({ + phone: formData.phone, + }); + if (findJsByPhoneResult.resultCode == 1) { + if (findJsByPhoneResult.result) { + if (findJsByPhoneResult.result["confirmStatus"] == "A") { + toHome(); + } else { + setFile(findJsByPhoneResult.result); + setTimeout(() => { + uni.reLaunch({ + url: "/pages/view/hr/teacherProfile/index", + }); + }, 1500); + } + } else { + toHome(); + } + } + } else { + uni.showToast({ title: result.message || "验证失败", icon: "none" }); + } }; async function afterRead(event: any) { showLoading({ title: "上传中" }); const { result } = await attachmentUpload(event.tempFilePaths[0]); hideLoading(); - formData.avatar_url = result[0].filePath; + formData.avatarUrl = result[0].filePath; } onUnmounted(() => { @@ -304,3 +366,6 @@ input::placeholder { font-size: 14px; } + +function updateUserApi(arg0: { loginName: string; phone: string; code: string; +avatarUrl: string; }) { throw new Error("Function not implemented."); } diff --git a/src/pages/view/hr/teacherProfile/EmergencyContact.vue b/src/pages/view/hr/teacherProfile/EmergencyContact.vue index d12e4e7..4f25f67 100644 --- a/src/pages/view/hr/teacherProfile/EmergencyContact.vue +++ b/src/pages/view/hr/teacherProfile/EmergencyContact.vue @@ -30,44 +30,47 @@ diff --git a/src/pages/view/hr/teacherProfile/ExperienceInfo.vue b/src/pages/view/hr/teacherProfile/ExperienceInfo.vue index dcdda31..48e750d 100644 --- a/src/pages/view/hr/teacherProfile/ExperienceInfo.vue +++ b/src/pages/view/hr/teacherProfile/ExperienceInfo.vue @@ -29,59 +29,58 @@ diff --git a/src/pages/view/hr/teacherProfile/FamilyInfo.vue b/src/pages/view/hr/teacherProfile/FamilyInfo.vue index b448710..c9cc694 100644 --- a/src/pages/view/hr/teacherProfile/FamilyInfo.vue +++ b/src/pages/view/hr/teacherProfile/FamilyInfo.vue @@ -1,115 +1,136 @@ - - - - \ No newline at end of file +} +function addEducation() { + education.xl.push({ value: {} }); +} + +function deleteMemberFamily(index: number, item: any) { + const list = cloneDeep(education.xl); + list.splice(index, 1); + education.xl = list; +} + +function submit() { + setFile({ + ...getFile, + jtcyList: map(education.xl, (item) => { + return item.value; + }), + }); + navigateTo("/pages/view/hr/teacherProfile/ExperienceInfo"); +} + + diff --git a/src/pages/view/hr/teacherProfile/PersonalHonor.vue b/src/pages/view/hr/teacherProfile/PersonalHonor.vue index aba5a92..12e5fbf 100644 --- a/src/pages/view/hr/teacherProfile/PersonalHonor.vue +++ b/src/pages/view/hr/teacherProfile/PersonalHonor.vue @@ -36,7 +36,7 @@ @click="navigateBack" /> - \ No newline at end of file diff --git a/src/pages/view/hr/teacherProfile/PositionInfo.vue b/src/pages/view/hr/teacherProfile/PositionInfo.vue index b909987..25ca08c 100644 --- a/src/pages/view/hr/teacherProfile/PositionInfo.vue +++ b/src/pages/view/hr/teacherProfile/PositionInfo.vue @@ -29,59 +29,93 @@ diff --git a/src/pages/view/hr/teacherProfile/PublicClassAwards.vue b/src/pages/view/hr/teacherProfile/PublicClassAwards.vue index fd2c969..32373d1 100644 --- a/src/pages/view/hr/teacherProfile/PublicClassAwards.vue +++ b/src/pages/view/hr/teacherProfile/PublicClassAwards.vue @@ -29,50 +29,57 @@ diff --git a/src/pages/view/hr/teacherProfile/RecordMaterials.vue b/src/pages/view/hr/teacherProfile/RecordMaterials.vue index 1f263e5..19435fb 100644 --- a/src/pages/view/hr/teacherProfile/RecordMaterials.vue +++ b/src/pages/view/hr/teacherProfile/RecordMaterials.vue @@ -26,20 +26,24 @@ - + diff --git a/src/pages/view/hr/teacherProfile/TitleInfo.vue b/src/pages/view/hr/teacherProfile/TitleInfo.vue index a0bf762..6effeec 100644 --- a/src/pages/view/hr/teacherProfile/TitleInfo.vue +++ b/src/pages/view/hr/teacherProfile/TitleInfo.vue @@ -20,7 +20,7 @@ @@ -29,73 +29,100 @@ diff --git a/src/pages/view/hr/teacherProfile/index.vue b/src/pages/view/hr/teacherProfile/index.vue index 9066b8c..34fcffb 100644 --- a/src/pages/view/hr/teacherProfile/index.vue +++ b/src/pages/view/hr/teacherProfile/index.vue @@ -1,6 +1,6 @@