From 5497398498b995d58f8a810db3f66ceae2d38db7 Mon Sep 17 00:00:00 2001 From: Apcallover <1503963513@qq.com> Date: Thu, 20 Nov 2025 09:17:29 +0800 Subject: [PATCH] =?UTF-8?q?flat:=20ai=E5=AF=B9=E8=AF=9D=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/globalFunction.js | 55 ++- components/selectJobs/selectJobs.vue | 2 +- components/tabbar/midell-box.vue | 2 +- config.js | 7 + index.html | 2 + pages.json | 536 +++++++++++----------- pages/chat/components/ai-paging.vue | 2 - pages/chat/components/popupbadFeeback.vue | 2 +- pages/login/login.vue | 24 + pages/mine/mine.vue | 5 +- static/js/sm4.min.js | 7 + stores/userChatGroupStore.js | 12 +- utils/request.js | 106 ++--- utils/streamRequest.js | 3 +- 14 files changed, 410 insertions(+), 355 deletions(-) create mode 100644 static/js/sm4.min.js diff --git a/common/globalFunction.js b/common/globalFunction.js index 4bea4d7..bbec1aa 100644 --- a/common/globalFunction.js +++ b/common/globalFunction.js @@ -1,6 +1,5 @@ import useUserStore from "../stores/useUserStore"; import { - request, createRequest, uploadFile } from "../utils/request"; @@ -8,6 +7,9 @@ import streamRequest, { chatRequest } from "../utils/streamRequest.js"; +const sm4 = typeof window.sm4 !== 'undefined' ? window.sm4 : + (typeof window.smCrypto !== 'undefined' ? window.smCrypto.sm4 : null); + export const CloneDeep = (props) => { if (typeof props !== 'object' || props === null) { return props @@ -67,14 +69,14 @@ export const navTo = function(url, { onBack = null } = {}) { const userStore = useUserStore(); - if(isJumping) return - isJumping=true + if (isJumping) return + isJumping = true if (needLogin && !userStore.hasLogin) { setTimeout(() => { uni.navigateTo({ url: '/pages/login/login' }); - isJumping=false + isJumping = false }, 170); return; } @@ -94,7 +96,7 @@ export const navTo = function(url, { uni.navigateTo({ url: finalUrl }); - isJumping=false + isJumping = false }, 170); }; @@ -553,11 +555,51 @@ function isEmptyObject(obj) { } +export function sm4Decrypt(key, value, mode = "hex") { + try { + if (key.length !== 32) { + alert('密钥必须是32位16进制字符串(128位)'); + return; + } + const decrypted = sm4.decrypt(value, key, { + mode: 'ecb', + cipherType: mode === 'hex' ? 'hex' : 'base64', + padding: 'pkcs#5' + }); + + return decrypted + + } catch (e) { + console.log('解密失败') + } +} + +export function sm4Encrypt(key, value, mode = "hex") { + try { + + if (key.length !== 32) { + alert('密钥必须是32位16进制字符串(128位)'); + return; + } + + const encrypted = sm4.encrypt(value, key, { + mode: 'ecb', + cipherType: mode === 'hex' ? 'hex' : 'base64', + padding: 'pkcs#5' + }); + + return encrypted + + } catch (e) { + console.log('加密失败') + } +} + + export const $api = { msg, prePage, sleep, - request, createRequest, streamRequest, chatRequest, @@ -595,4 +637,5 @@ export default { insertSortData, isInWechatMiniProgramWebview, isEmptyObject, + sm4Decrypt, } \ No newline at end of file diff --git a/components/selectJobs/selectJobs.vue b/components/selectJobs/selectJobs.vue index 22c6aac..09cc886 100644 --- a/components/selectJobs/selectJobs.vue +++ b/components/selectJobs/selectJobs.vue @@ -32,7 +32,7 @@ --> + +
diff --git a/pages.json b/pages.json index fab2998..37782d1 100644 --- a/pages.json +++ b/pages.json @@ -1,288 +1,284 @@ { - "pages": [ - //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages - { - "path": "pages/index/index", - "style": { - "navigationBarTitleText": "青岛智慧就业平台", - // #ifdef H5 - "navigationStyle": "custom" - // #endif - } - }, - { - "path": "pages/mine/mine", - "style": { - "navigationBarTitleText": "我的", - "navigationStyle": "custom" - } - }, - { - "path": "pages/msglog/msglog", - "style": { - "navigationBarTitleText": "消息", - "navigationStyle": "custom", - "enablePullDownRefresh": false - } - }, - { - "path": "pages/careerfair/careerfair", - "style": { - "navigationBarTitleText": "招聘会", - "navigationStyle": "custom" - } - }, - { - "path": "pages/login/login", - "style": { - "navigationBarTitleText": "AI+就业服务程序", - "navigationStyle": "custom" - } - }, - { - "path": "pages/nearby/nearby", - "style": { - "navigationBarTitleText": "附近", - "navigationBarBackgroundColor": "#4778EC", - "navigationBarTextStyle": "white", - "navigationStyle": "custom" - } - }, - { - "path": "pages/chat/chat", - "style": { - "navigationBarTitleText": "AI+", - "navigationBarBackgroundColor": "#4778EC", - "navigationBarTextStyle": "white", - "enablePullDownRefresh": false, - // #ifdef H5 - "navigationStyle": "custom" - //#endif - } - }, - { - "path": "pages/search/search", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - } - ], - "subpackages": [ - { - "root": "packageA", - "pages": [ + "pages": [ + //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages { - "path": "pages/choiceness/choiceness", - "style": { - "navigationBarTitleText": "精选", - "navigationBarBackgroundColor": "#4778EC", - "navigationBarTextStyle": "white", - "navigationStyle": "custom" - } + "path": "pages/index/index", + "style": { + "navigationBarTitleText": "青岛智慧就业平台", + // #ifdef H5 + "navigationStyle": "custom" + // #endif + } }, { - "path": "pages/post/post", - "style": { - "navigationBarTitleText": "职位详情", - "navigationBarBackgroundColor": "#4778EC", - "navigationBarTextStyle": "white", - "navigationStyle": "custom" - } + "path": "pages/mine/mine", + "style": { + "navigationBarTitleText": "我的", + "navigationStyle": "custom" + } }, { - "path": "pages/UnitDetails/UnitDetails", - "style": { - "navigationBarTitleText": "单位详情", - "navigationBarBackgroundColor": "#4778EC", - "navigationBarTextStyle": "white", - "navigationStyle": "custom" - } + "path": "pages/msglog/msglog", + "style": { + "navigationBarTitleText": "消息", + "navigationStyle": "custom", + "enablePullDownRefresh": false + } }, { - "path": "pages/exhibitors/exhibitors", - "style": { - "navigationBarTitleText": "参展单位", - "navigationBarBackgroundColor": "#4778EC", - "navigationBarTextStyle": "white", - "navigationStyle": "custom" - } + "path": "pages/careerfair/careerfair", + "style": { + "navigationBarTitleText": "招聘会", + "navigationStyle": "custom" + } }, { - "path": "pages/myResume/myResume", - "style": { - "navigationBarTitleText": "我的简历", - "navigationBarBackgroundColor": "#FFFFFF", - "navigationStyle": "custom" - } + "path": "pages/login/login", + "style": { + "navigationBarTitleText": "AI+就业服务程序", + "navigationStyle": "custom" + } }, { - "path": "pages/vCard/vCard", - "style": { - "navigationBarTitleText": "点子名片", - "navigationBarBackgroundColor": "#FFFFFF", - "navigationStyle": "custom" - } + "path": "pages/nearby/nearby", + "style": { + "navigationBarTitleText": "附近", + "navigationBarBackgroundColor": "#4778EC", + "navigationBarTextStyle": "white", + "navigationStyle": "custom" + } }, { - "path": "pages/Intendedposition/Intendedposition", - "style": { - "navigationBarTitleText": "投递记录", - "navigationBarBackgroundColor": "#FFFFFF" - } + "path": "pages/chat/chat", + "style": { + "navigationBarTitleText": "AI+", + "navigationBarBackgroundColor": "#4778EC", + "navigationBarTextStyle": "white", + "enablePullDownRefresh": false, + // #ifdef H5 + "navigationStyle": "custom" + //#endif + } }, { - "path": "pages/collection/collection", - "style": { - "navigationBarTitleText": "我的收藏", - "navigationBarBackgroundColor": "#FFFFFF", - "navigationStyle": "custom" - } - }, - { - "path": "pages/browseJob/browseJob", - "style": { - "navigationBarTitleText": "我的浏览", - "navigationBarBackgroundColor": "#FFFFFF", - "navigationStyle": "custom" - } - }, - { - "path": "pages/addPosition/addPosition", - "style": { - "navigationBarTitleText": "添加岗位", - "navigationStyle": "custom" - } - }, - { - "path": "pages/selectDate/selectDate", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, - { - "path": "pages/personalInfo/personalInfo", - "style": { - "navigationBarTitleText": "个人信息", - "navigationStyle": "custom" - } - }, - { - "path": "pages/jobExpect/jobExpect", - "style": { - "navigationBarTitleText": "求职期望", - "navigationStyle": "custom" - } - }, - { - "path": "pages/workExp/workExp", - "style": { - "navigationBarTitleText": "工作经历", - "navigationStyle": "custom" - } - }, - { - "path": "pages/reservation/reservation", - "style": { - "navigationBarTitleText": "我的预约", - "navigationBarBackgroundColor": "#FFFFFF" - } - }, - { - "path": "pages/choicenessList/choicenessList", - "style": { - "navigationBarTitleText": "精选企业", - "navigationBarBackgroundColor": "#FFFFFF", - "navigationStyle": "custom" - } - }, - { - "path": "pages/newJobPosition/newJobPosition", - "style": { - "navigationBarTitleText": "新职位推荐", - "navigationBarBackgroundColor": "#FFFFFF" - } - }, - { - "path": "pages/systemNotification/systemNotification", - "style": { - "navigationBarTitleText": "系统通知", - "navigationBarBackgroundColor": "#FFFFFF" - } - }, - { - "path": "pages/tiktok/tiktok", - "style": { - "navigationBarTitleText": "", - "navigationBarBackgroundColor": "#FFFFFF", - "navigationStyle": "custom" - } - }, - { - "path": "pages/moreJobs/moreJobs", - "style": { - "navigationBarTitleText": "更多岗位", - "navigationBarBackgroundColor": "#FFFFFF" - } + "path": "pages/search/search", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } } - ] - } - ], - "tabBar": { - "custom": true, - "display": "none", - "color": "#5E5F60", - "selectedColor": "#256BFA", - "borderStyle": "black", - "backgroundColor": "#ffffff", - "midButton": { - "width": "50px", - "height": "50px", - "backgroundImage": "static/tabbar/logo2copy.png" + ], + "subpackages": [{ + "root": "packageA", + "pages": [{ + "path": "pages/choiceness/choiceness", + "style": { + "navigationBarTitleText": "精选", + "navigationBarBackgroundColor": "#4778EC", + "navigationBarTextStyle": "white", + "navigationStyle": "custom" + } + }, + { + "path": "pages/post/post", + "style": { + "navigationBarTitleText": "职位详情", + "navigationBarBackgroundColor": "#4778EC", + "navigationBarTextStyle": "white", + "navigationStyle": "custom" + } + }, + { + "path": "pages/UnitDetails/UnitDetails", + "style": { + "navigationBarTitleText": "单位详情", + "navigationBarBackgroundColor": "#4778EC", + "navigationBarTextStyle": "white", + "navigationStyle": "custom" + } + }, + { + "path": "pages/exhibitors/exhibitors", + "style": { + "navigationBarTitleText": "参展单位", + "navigationBarBackgroundColor": "#4778EC", + "navigationBarTextStyle": "white", + "navigationStyle": "custom" + } + }, + { + "path": "pages/myResume/myResume", + "style": { + "navigationBarTitleText": "我的简历", + "navigationBarBackgroundColor": "#FFFFFF", + "navigationStyle": "custom" + } + }, + { + "path": "pages/vCard/vCard", + "style": { + "navigationBarTitleText": "点子名片", + "navigationBarBackgroundColor": "#FFFFFF", + "navigationStyle": "custom" + } + }, + { + "path": "pages/Intendedposition/Intendedposition", + "style": { + "navigationBarTitleText": "投递记录", + "navigationBarBackgroundColor": "#FFFFFF" + } + }, + { + "path": "pages/collection/collection", + "style": { + "navigationBarTitleText": "我的收藏", + "navigationBarBackgroundColor": "#FFFFFF", + "navigationStyle": "custom" + } + }, + { + "path": "pages/browseJob/browseJob", + "style": { + "navigationBarTitleText": "我的浏览", + "navigationBarBackgroundColor": "#FFFFFF", + "navigationStyle": "custom" + } + }, + { + "path": "pages/addPosition/addPosition", + "style": { + "navigationBarTitleText": "添加岗位", + "navigationStyle": "custom" + } + }, + { + "path": "pages/selectDate/selectDate", + "style": { + "navigationBarTitleText": "", + "navigationStyle": "custom" + } + }, + { + "path": "pages/personalInfo/personalInfo", + "style": { + "navigationBarTitleText": "个人信息", + "navigationStyle": "custom" + } + }, + { + "path": "pages/jobExpect/jobExpect", + "style": { + "navigationBarTitleText": "求职期望", + "navigationStyle": "custom" + } + }, + { + "path": "pages/workExp/workExp", + "style": { + "navigationBarTitleText": "工作经历", + "navigationStyle": "custom" + } + }, + { + "path": "pages/reservation/reservation", + "style": { + "navigationBarTitleText": "我的预约", + "navigationBarBackgroundColor": "#FFFFFF" + } + }, + { + "path": "pages/choicenessList/choicenessList", + "style": { + "navigationBarTitleText": "精选企业", + "navigationBarBackgroundColor": "#FFFFFF", + "navigationStyle": "custom" + } + }, + { + "path": "pages/newJobPosition/newJobPosition", + "style": { + "navigationBarTitleText": "新职位推荐", + "navigationBarBackgroundColor": "#FFFFFF" + } + }, + { + "path": "pages/systemNotification/systemNotification", + "style": { + "navigationBarTitleText": "系统通知", + "navigationBarBackgroundColor": "#FFFFFF" + } + }, + { + "path": "pages/tiktok/tiktok", + "style": { + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#FFFFFF", + "navigationStyle": "custom" + } + }, + { + "path": "pages/moreJobs/moreJobs", + "style": { + "navigationBarTitleText": "更多岗位", + "navigationBarBackgroundColor": "#FFFFFF" + } + } + ] + }], + "tabBar": { + "custom": true, + "display": "none", + "color": "#5E5F60", + "selectedColor": "#256BFA", + "borderStyle": "black", + "backgroundColor": "#ffffff", + "midButton": { + "width": "50px", + "height": "50px", + "backgroundImage": "static/tabbar/logo2copy.png" + }, + "list": [{ + "pagePath": "pages/index/index", + "iconPath": "static/tabbar/calendar.png", + "selectedIconPath": "static/tabbar/calendared.png", + "text": "职位" + }, + { + "pagePath": "pages/careerfair/careerfair", + "iconPath": "static/tabbar/post.png", + "selectedIconPath": "static/tabbar/posted.png", + "text": "招聘会" + }, + { + "pagePath": "pages/chat/chat", + "iconPath": "static/tabbar/logo3.png", + "selectedIconPath": "static/tabbar/logo3.png" + }, + { + "pagePath": "pages/msglog/msglog", + "iconPath": "static/tabbar/chat4.png", + "selectedIconPath": "static/tabbar/chat4ed.png", + "text": "消息" + }, + { + "pagePath": "pages/mine/mine", + "iconPath": "static/tabbar/mine.png", + "selectedIconPath": "static/tabbar/mined.png", + "text": "我的" + } + ] }, - "list": [ - { - "pagePath": "pages/index/index", - "iconPath": "static/tabbar/calendar.png", - "selectedIconPath": "static/tabbar/calendared.png", - "text": "职位" - }, - { - "pagePath": "pages/careerfair/careerfair", - "iconPath": "static/tabbar/post.png", - "selectedIconPath": "static/tabbar/posted.png", - "text": "招聘会" - }, - { - "pagePath": "pages/chat/chat", - "iconPath": "static/tabbar/logo3.png", - "selectedIconPath": "static/tabbar/logo3.png" - }, - { - "pagePath": "pages/msglog/msglog", - "iconPath": "static/tabbar/chat4.png", - "selectedIconPath": "static/tabbar/chat4ed.png", - "text": "消息" - }, - { - "pagePath": "pages/mine/mine", - "iconPath": "static/tabbar/mine.png", - "selectedIconPath": "static/tabbar/mined.png", - "text": "我的" - } - ] - }, - "globalStyle": { - "navigationBarTextStyle": "black", - "navigationBarTitleText": "uni-app", - "navigationBarBackgroundColor": "#F8F8F8", - "backgroundColor": "#F8F8F8", - // "enablePullDownRefresh": false, - // "navigationStyle": "custom", - "rpxCalcBaseDeviceWidth": 375, - "rpxCalcMaxDeviceWidth": 750, - "rpxCalcIncludeWidth": 750 - }, - "uniIdRouter": {} -} + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "uni-app", + "navigationBarBackgroundColor": "#F8F8F8", + "backgroundColor": "#F8F8F8", + // "enablePullDownRefresh": false, + // "navigationStyle": "custom", + "rpxCalcBaseDeviceWidth": 375, + "rpxCalcMaxDeviceWidth": 750, + "rpxCalcIncludeWidth": 750 + }, + "uniIdRouter": {} +} \ No newline at end of file diff --git a/pages/chat/components/ai-paging.vue b/pages/chat/components/ai-paging.vue index be41efd..42699bc 100644 --- a/pages/chat/components/ai-paging.vue +++ b/pages/chat/components/ai-paging.vue @@ -250,8 +250,6 @@ import { ref, inject, nextTick, - defineProps, - defineEmits, onMounted, onUnmounted, toRaw, diff --git a/pages/chat/components/popupbadFeeback.vue b/pages/chat/components/popupbadFeeback.vue index ccf32a7..ebdc864 100644 --- a/pages/chat/components/popupbadFeeback.vue +++ b/pages/chat/components/popupbadFeeback.vue @@ -37,7 +37,7 @@