Compare commits
4 Commits
production
...
5497398498
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5497398498 | ||
|
|
e67c53404b | ||
|
|
60a0448aa7 | ||
| ca7273f152 |
114
App.vue
114
App.vue
@@ -3,29 +3,26 @@ import { reactive, inject, onMounted } from 'vue';
|
|||||||
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app';
|
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app';
|
||||||
import useUserStore from './stores/useUserStore';
|
import useUserStore from './stores/useUserStore';
|
||||||
import useDictStore from './stores/useDictStore';
|
import useDictStore from './stores/useDictStore';
|
||||||
const { $api, navTo, appendScriptTagElement, aes_Decrypt, sm2_Decrypt } = inject('globalFunction');
|
const { $api, navTo, appendScriptTagElement } = inject('globalFunction');
|
||||||
import config from '@/config.js';
|
import config from '@/config.js';
|
||||||
|
|
||||||
const appword = 'aKd20dbGdFvmuwrt'; // 固定值
|
|
||||||
|
|
||||||
onLaunch((options) => {
|
onLaunch((options) => {
|
||||||
getUserInfo();
|
useUserStore().initSeesionId(); //更新
|
||||||
// useUserStore().initSeesionId(); //更新
|
|
||||||
useDictStore().getDictData();
|
useDictStore().getDictData();
|
||||||
// uni.hideTabBar();
|
uni.hideTabBar();
|
||||||
// 登录
|
// 登录
|
||||||
// let token = uni.getStorageSync('token') || ''; // 同步获取 缓存信息
|
let token = uni.getStorageSync('token') || ''; // 同步获取 缓存信息
|
||||||
// if (token) {
|
if (token) {
|
||||||
// useUserStore()
|
useUserStore()
|
||||||
// .loginSetToken(token)
|
.loginSetToken(token)
|
||||||
// .then(() => {
|
.then(() => {
|
||||||
// $api.msg('登录成功');
|
$api.msg('登录成功');
|
||||||
// });
|
});
|
||||||
// } else {
|
} else {
|
||||||
// uni.redirectTo({
|
uni.redirectTo({
|
||||||
// url: '/pages/login/login',
|
url: '/pages/login/login',
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {});
|
onMounted(() => {});
|
||||||
@@ -37,87 +34,6 @@ onShow(() => {
|
|||||||
onHide(() => {
|
onHide(() => {
|
||||||
console.log('App Hide');
|
console.log('App Hide');
|
||||||
});
|
});
|
||||||
|
|
||||||
function getUserInfo() {
|
|
||||||
lightAppJssdk.user.getUserInfoWithEncryptedParamByAppId({
|
|
||||||
appId: 'qdsrgznrgpp', // 接入方在成功创建应用后自动生成
|
|
||||||
success: function (data) {
|
|
||||||
if (data == '未登录') onLoginApp();
|
|
||||||
else {
|
|
||||||
if (typeof data == 'string') data = JSON.parse(data);
|
|
||||||
|
|
||||||
const sm2_privateKey = '7e14966df4ecd4241ed082ef716d82b52113cb5899ebdc704a98844d0a32b0dc';
|
|
||||||
let sm2_encrypt_result = data.data;
|
|
||||||
let sm2_decrypt_result = sm2_Decrypt(sm2_encrypt_result, sm2_privateKey);
|
|
||||||
|
|
||||||
if (typeof sm2_decrypt_result == 'string') sm2_decrypt_result = JSON.parse(sm2_decrypt_result);
|
|
||||||
|
|
||||||
// 其次,对sm2解密后的结果进行 aes解密
|
|
||||||
// aes解密需要用到 appword , 为固定值,使用示例代码中的即可
|
|
||||||
let aes_encrypt_result = sm2_decrypt_result.data;
|
|
||||||
let aes_decrypt_result = aes_Decrypt(aes_encrypt_result, appword);
|
|
||||||
|
|
||||||
// 加密
|
|
||||||
loginCallback(aes_decrypt_result);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: function (data) {
|
|
||||||
console.log('err', data);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 使用jssdk调用登录页面
|
|
||||||
*/
|
|
||||||
function onLoginApp() {
|
|
||||||
lightAppJssdk.user.loginapp({
|
|
||||||
success: function (data) {
|
|
||||||
if (data == '未登录') {
|
|
||||||
//取消登录或登录失败,关闭页面
|
|
||||||
oncloseWindow();
|
|
||||||
} else {
|
|
||||||
getUserInfo();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: function (data) {
|
|
||||||
//关闭页面
|
|
||||||
oncloseWindow();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关闭容器
|
|
||||||
*/
|
|
||||||
function oncloseWindow() {
|
|
||||||
lightAppJssdk.navigation.close({
|
|
||||||
success: function (data) {},
|
|
||||||
fail: function (data) {},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function loginCallback(userInfo) {
|
|
||||||
let params = {
|
|
||||||
username: userInfo,
|
|
||||||
};
|
|
||||||
$api.createRequest('/app/login', params, 'post').then((resData) => {
|
|
||||||
useUserStore()
|
|
||||||
.loginSetToken(resData.token)
|
|
||||||
.then((resume) => {
|
|
||||||
if (resume.data.jobTitleId) {
|
|
||||||
useUserStore().initSeesionId();
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/index/index',
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.redirectTo({
|
|
||||||
url: '/pages/login/login',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import useUserStore from "../stores/useUserStore";
|
import useUserStore from "../stores/useUserStore";
|
||||||
import {
|
import {
|
||||||
request,
|
|
||||||
createRequest,
|
createRequest,
|
||||||
uploadFile
|
uploadFile
|
||||||
} from "../utils/request";
|
} from "../utils/request";
|
||||||
@@ -8,6 +7,9 @@ import streamRequest, {
|
|||||||
chatRequest
|
chatRequest
|
||||||
} from "../utils/streamRequest.js";
|
} from "../utils/streamRequest.js";
|
||||||
|
|
||||||
|
const sm4 = typeof window.sm4 !== 'undefined' ? window.sm4 :
|
||||||
|
(typeof window.smCrypto !== 'undefined' ? window.smCrypto.sm4 : null);
|
||||||
|
|
||||||
export const CloneDeep = (props) => {
|
export const CloneDeep = (props) => {
|
||||||
if (typeof props !== 'object' || props === null) {
|
if (typeof props !== 'object' || props === null) {
|
||||||
return props
|
return props
|
||||||
@@ -552,31 +554,52 @@ function isEmptyObject(obj) {
|
|||||||
return obj && typeof obj === 'object' && !Array.isArray(obj) && Object.keys(obj).length === 0;
|
return obj && typeof obj === 'object' && !Array.isArray(obj) && Object.keys(obj).length === 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function aes_Decrypt(word, key) {
|
|
||||||
var key = CryptoJS.enc.Utf8.parse(key) //转为128bit
|
export function sm4Decrypt(key, value, mode = "hex") {
|
||||||
var srcs = CryptoJS.enc.Hex.parse(word) //转为16进制
|
try {
|
||||||
var str = CryptoJS.enc.Base64.stringify(srcs) //变为Base64编码的字符串
|
if (key.length !== 32) {
|
||||||
var decrypt = CryptoJS.AES.decrypt(str, key, {
|
alert('密钥必须是32位16进制字符串(128位)');
|
||||||
mode: CryptoJS.mode.ECB,
|
return;
|
||||||
spadding: CryptoJS.pad.Pkcs7
|
}
|
||||||
})
|
const decrypted = sm4.decrypt(value, key, {
|
||||||
return decrypt.toString(CryptoJS.enc.Utf8)
|
mode: 'ecb',
|
||||||
|
cipherType: mode === 'hex' ? 'hex' : 'base64',
|
||||||
|
padding: 'pkcs#5'
|
||||||
|
});
|
||||||
|
|
||||||
|
return decrypted
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
console.log('解密失败')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function sm4Encrypt(key, value, mode = "hex") {
|
||||||
|
try {
|
||||||
|
|
||||||
export function sm2_Decrypt(word, key) {
|
if (key.length !== 32) {
|
||||||
return SM.decrypt(word, key);
|
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 function sm2_Encrypt(word, key) {
|
|
||||||
return SM.encrypt(word, key);
|
|
||||||
}
|
|
||||||
|
|
||||||
export const $api = {
|
export const $api = {
|
||||||
msg,
|
msg,
|
||||||
prePage,
|
prePage,
|
||||||
sleep,
|
sleep,
|
||||||
request,
|
|
||||||
createRequest,
|
createRequest,
|
||||||
streamRequest,
|
streamRequest,
|
||||||
chatRequest,
|
chatRequest,
|
||||||
@@ -584,8 +607,7 @@ export const $api = {
|
|||||||
uploadFile,
|
uploadFile,
|
||||||
formatFileSize,
|
formatFileSize,
|
||||||
sendingMiniProgramMessage,
|
sendingMiniProgramMessage,
|
||||||
copyText,
|
copyText
|
||||||
aes_Decrypt,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -615,7 +637,5 @@ export default {
|
|||||||
insertSortData,
|
insertSortData,
|
||||||
isInWechatMiniProgramWebview,
|
isInWechatMiniProgramWebview,
|
||||||
isEmptyObject,
|
isEmptyObject,
|
||||||
aes_Decrypt,
|
sm4Decrypt,
|
||||||
sm2_Decrypt,
|
|
||||||
sm2_Encrypt
|
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, defineProps, onMounted, computed } from 'vue';
|
import { ref, onMounted, computed } from 'vue';
|
||||||
import { useReadMsg } from '@/stores/useReadMsg';
|
import { useReadMsg } from '@/stores/useReadMsg';
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
currentpage: {
|
currentpage: {
|
||||||
|
|||||||
19
config.js
19
config.js
@@ -1,8 +1,9 @@
|
|||||||
export default {
|
export default {
|
||||||
baseUrl: 'https://fw.rc.qingdao.gov.cn/rgpp-api/api', // 内网
|
// baseUrl: 'http://39.98.44.136:8080', // 测试
|
||||||
// baseUrl: 'https://qd.zhaopinzao8dian.com/api', // 测试
|
baseUrl: 'https://qd.zhaopinzao8dian.com/api', // 测试
|
||||||
// baseUrl: "http://192.168.98.110:18181",
|
// baseUrl: 'http://10.133.17.161:8080/api', // 测试
|
||||||
// baseUrl: "http://192.168.3.19:8080",
|
// baseUrl: 'http://192.168.3.19:8080', // 测试
|
||||||
|
// baseUrl: 'http://39.98.44.136:6009', // 测试
|
||||||
// sseAI+
|
// sseAI+
|
||||||
// StreamBaseURl: 'http://39.98.44.136:8000',
|
// StreamBaseURl: 'http://39.98.44.136:8000',
|
||||||
StreamBaseURl: 'https://qd.zhaopinzao8dian.com/ai',
|
StreamBaseURl: 'https://qd.zhaopinzao8dian.com/ai',
|
||||||
@@ -18,10 +19,6 @@ export default {
|
|||||||
OnlyUseCachedDB: false,
|
OnlyUseCachedDB: false,
|
||||||
// 使用模拟定位
|
// 使用模拟定位
|
||||||
UsingSimulatedPositioning: true,
|
UsingSimulatedPositioning: true,
|
||||||
// 私钥
|
|
||||||
pubilcKey: '',
|
|
||||||
// 公钥
|
|
||||||
privateKey: '',
|
|
||||||
// 应用信息
|
// 应用信息
|
||||||
appInfo: {
|
appInfo: {
|
||||||
// 应用名称
|
// 应用名称
|
||||||
@@ -75,5 +72,11 @@ export default {
|
|||||||
title: '找工作,用 AI 更高效|青岛市智能求职平台',
|
title: '找工作,用 AI 更高效|青岛市智能求职平台',
|
||||||
desc: '融合海量岗位、智能简历匹配、竞争力分析,助你精准锁定理想职位!',
|
desc: '融合海量岗位、智能简历匹配、竞争力分析,助你精准锁定理想职位!',
|
||||||
imgUrl: 'https://qd.zhaopinzao8dian.com/file/csn/qd_shareLogo.jpg',
|
imgUrl: 'https://qd.zhaopinzao8dian.com/file/csn/qd_shareLogo.jpg',
|
||||||
|
},
|
||||||
|
sm4Config: {
|
||||||
|
key: '86C63180C1306ABC4D8F989E0A0BC9F3',
|
||||||
|
mode: 'ECB', // default
|
||||||
|
iv: 'UISwD9fW6cFh9SNS', // default is null
|
||||||
|
cipherType: 'base64' // default is base64
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -49,7 +49,6 @@ export function useTTSPlayer() {
|
|||||||
const newUtterance = new SpeechSynthesisUtterance(filteredText); // Use filtered text
|
const newUtterance = new SpeechSynthesisUtterance(filteredText); // Use filtered text
|
||||||
utteranceRef.value = newUtterance;
|
utteranceRef.value = newUtterance;
|
||||||
|
|
||||||
newUtterance.lang = 'zh-CN';
|
|
||||||
newUtterance.rate = options.rate || 1;
|
newUtterance.rate = options.rate || 1;
|
||||||
newUtterance.pitch = options.pitch || 1;
|
newUtterance.pitch = options.pitch || 1;
|
||||||
if (options.voice) {
|
if (options.voice) {
|
||||||
|
|||||||
10
index.html
10
index.html
@@ -18,17 +18,15 @@
|
|||||||
</script>
|
</script>
|
||||||
<title></title>
|
<title></title>
|
||||||
<!-- vconsole -->
|
<!-- vconsole -->
|
||||||
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
|
<!-- <script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var vConsole = new window.VConsole();
|
var vConsole = new window.VConsole();
|
||||||
vConsole.destroy();
|
vConsole.destroy();
|
||||||
</script>
|
</script> -->
|
||||||
<!-- 爱山东jssdk -->
|
<!-- 爱山东jssdk -->
|
||||||
<script type="text/javascript" src="https://isdapp.shandong.gov.cn/jmopen/jssdk/index.js"></script>
|
<!-- <script type="text/javascript" src="https://isdapp.shandong.gov.cn/jmopen/jssdk/index.js"></script> -->
|
||||||
|
|
||||||
<script type="text/javascript" src="./static/encryption/aes.js"></script>
|
<script type="module" src="./static/js/sm4.min.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="./static/encryption/SM.js"></script>
|
|
||||||
</head>
|
</head>
|
||||||
<!-- <body> -->
|
<!-- <body> -->
|
||||||
<div id="app"><!--app-html--></div>
|
<div id="app"><!--app-html--></div>
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
"locale": "zh-Hans",
|
"locale": "zh-Hans",
|
||||||
"h5": {
|
"h5": {
|
||||||
"router": {
|
"router": {
|
||||||
"base": "./",
|
"base": "/app/",
|
||||||
"mode": "hash"
|
"mode": "hash"
|
||||||
},
|
},
|
||||||
"title": "青岛智慧就业服务",
|
"title": "青岛智慧就业服务",
|
||||||
@@ -97,9 +97,6 @@
|
|||||||
"serviceHost": ""
|
"serviceHost": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"devServer": {
|
|
||||||
"https": false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -37,8 +37,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="des-card" style="margin-top: 24rpx">
|
<view class="des-card" style="margin-top: 24rpx">
|
||||||
<view class="fl_box fl_justbet">
|
<view class="fl_box fl_justbet">
|
||||||
<view>求职意向岗位</view>
|
<view style="white-space:nowrap">求职意向岗位</view>
|
||||||
<view>{{ userInfo.jobIntention || "-" }}</view>
|
<view class="line_1" style="padding-left:40rpx" >{{ userInfo.jobIntention || userInfo.jobTitle?.join(',') || '-' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="fl_box fl_justbet">
|
<view class="fl_box fl_justbet">
|
||||||
<view>毕业学校</view>
|
<view>毕业学校</view>
|
||||||
|
|||||||
536
pages.json
536
pages.json
@@ -1,288 +1,284 @@
|
|||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/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": [
|
|
||||||
{
|
{
|
||||||
"path": "pages/choiceness/choiceness",
|
"path": "pages/index/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "精选",
|
"navigationBarTitleText": "青岛智慧就业平台",
|
||||||
"navigationBarBackgroundColor": "#4778EC",
|
// #ifdef H5
|
||||||
"navigationBarTextStyle": "white",
|
"navigationStyle": "custom"
|
||||||
"navigationStyle": "custom"
|
// #endif
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/post/post",
|
"path": "pages/mine/mine",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "职位详情",
|
"navigationBarTitleText": "我的",
|
||||||
"navigationBarBackgroundColor": "#4778EC",
|
"navigationStyle": "custom"
|
||||||
"navigationBarTextStyle": "white",
|
}
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/UnitDetails/UnitDetails",
|
"path": "pages/msglog/msglog",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "单位详情",
|
"navigationBarTitleText": "消息",
|
||||||
"navigationBarBackgroundColor": "#4778EC",
|
"navigationStyle": "custom",
|
||||||
"navigationBarTextStyle": "white",
|
"enablePullDownRefresh": false
|
||||||
"navigationStyle": "custom"
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/exhibitors/exhibitors",
|
"path": "pages/careerfair/careerfair",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "参展单位",
|
"navigationBarTitleText": "招聘会",
|
||||||
"navigationBarBackgroundColor": "#4778EC",
|
"navigationStyle": "custom"
|
||||||
"navigationBarTextStyle": "white",
|
}
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/myResume/myResume",
|
"path": "pages/login/login",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "我的简历",
|
"navigationBarTitleText": "AI+就业服务程序",
|
||||||
"navigationBarBackgroundColor": "#FFFFFF",
|
"navigationStyle": "custom"
|
||||||
"navigationStyle": "custom"
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/vCard/vCard",
|
"path": "pages/nearby/nearby",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "点子名片",
|
"navigationBarTitleText": "附近",
|
||||||
"navigationBarBackgroundColor": "#FFFFFF",
|
"navigationBarBackgroundColor": "#4778EC",
|
||||||
"navigationStyle": "custom"
|
"navigationBarTextStyle": "white",
|
||||||
}
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/Intendedposition/Intendedposition",
|
"path": "pages/chat/chat",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "投递记录",
|
"navigationBarTitleText": "AI+",
|
||||||
"navigationBarBackgroundColor": "#FFFFFF"
|
"navigationBarBackgroundColor": "#4778EC",
|
||||||
}
|
"navigationBarTextStyle": "white",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
// #ifdef H5
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
//#endif
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/collection/collection",
|
"path": "pages/search/search",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "我的收藏",
|
"navigationBarTitleText": "",
|
||||||
"navigationBarBackgroundColor": "#FFFFFF",
|
"navigationStyle": "custom"
|
||||||
"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"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
}
|
"subpackages": [{
|
||||||
],
|
"root": "packageA",
|
||||||
"tabBar": {
|
"pages": [{
|
||||||
"custom": true,
|
"path": "pages/choiceness/choiceness",
|
||||||
"display": "none",
|
"style": {
|
||||||
"color": "#5E5F60",
|
"navigationBarTitleText": "精选",
|
||||||
"selectedColor": "#256BFA",
|
"navigationBarBackgroundColor": "#4778EC",
|
||||||
"borderStyle": "black",
|
"navigationBarTextStyle": "white",
|
||||||
"backgroundColor": "#ffffff",
|
"navigationStyle": "custom"
|
||||||
"midButton": {
|
}
|
||||||
"width": "50px",
|
},
|
||||||
"height": "50px",
|
{
|
||||||
"backgroundImage": "static/tabbar/logo2copy.png"
|
"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": [
|
"globalStyle": {
|
||||||
{
|
"navigationBarTextStyle": "black",
|
||||||
"pagePath": "pages/index/index",
|
"navigationBarTitleText": "uni-app",
|
||||||
"iconPath": "static/tabbar/calendar.png",
|
"navigationBarBackgroundColor": "#F8F8F8",
|
||||||
"selectedIconPath": "static/tabbar/calendared.png",
|
"backgroundColor": "#F8F8F8",
|
||||||
"text": "职位"
|
// "enablePullDownRefresh": false,
|
||||||
},
|
// "navigationStyle": "custom",
|
||||||
{
|
"rpxCalcBaseDeviceWidth": 375,
|
||||||
"pagePath": "pages/careerfair/careerfair",
|
"rpxCalcMaxDeviceWidth": 750,
|
||||||
"iconPath": "static/tabbar/post.png",
|
"rpxCalcIncludeWidth": 750
|
||||||
"selectedIconPath": "static/tabbar/posted.png",
|
},
|
||||||
"text": "招聘会"
|
"uniIdRouter": {}
|
||||||
},
|
}
|
||||||
{
|
|
||||||
"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": {}
|
|
||||||
}
|
|
||||||
@@ -250,8 +250,6 @@ import {
|
|||||||
ref,
|
ref,
|
||||||
inject,
|
inject,
|
||||||
nextTick,
|
nextTick,
|
||||||
defineProps,
|
|
||||||
defineEmits,
|
|
||||||
onMounted,
|
onMounted,
|
||||||
onUnmounted,
|
onUnmounted,
|
||||||
toRaw,
|
toRaw,
|
||||||
@@ -448,7 +446,7 @@ const scrollToBottom = throttle(function () {
|
|||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
function getGuess() {
|
function getGuess() {
|
||||||
$api.chatRequest('/guest', { sessionId: chatSessionID.value }, 'POST').then((res) => {
|
$api.chatRequest('/app/chat/guest', { sessionId: chatSessionID.value }, 'POST').then((res) => {
|
||||||
guessList.value = res.data;
|
guessList.value = res.data;
|
||||||
showGuess.value = true;
|
showGuess.value = true;
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, inject, defineEmits } from 'vue';
|
import { ref, inject } from 'vue';
|
||||||
const emit = defineEmits(['onSend']);
|
const emit = defineEmits(['onSend']);
|
||||||
const { $api } = inject('globalFunction');
|
const { $api } = inject('globalFunction');
|
||||||
const popup = ref(null);
|
const popup = ref(null);
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ onLoad(() => {
|
|||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
// 获取消息列表
|
// 获取消息列表
|
||||||
// useReadMsg().fetchMessages();
|
useReadMsg().fetchMessages();
|
||||||
});
|
});
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
|
|||||||
@@ -109,6 +109,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</tabcontrolVue>
|
</tabcontrolVue>
|
||||||
<SelectJobs ref="selectJobsModel"></SelectJobs>
|
<SelectJobs ref="selectJobsModel"></SelectJobs>
|
||||||
|
<view class="backdoor" @click="loginbackdoor">后门</view>
|
||||||
</AppLayout>
|
</AppLayout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -125,7 +126,7 @@ const { getDictSelectOption, oneDictData } = useDictStore();
|
|||||||
const openSelectPopup = inject('openSelectPopup');
|
const openSelectPopup = inject('openSelectPopup');
|
||||||
// status
|
// status
|
||||||
const selectJobsModel = ref();
|
const selectJobsModel = ref();
|
||||||
const tabCurrent = ref(1);
|
const tabCurrent = ref(0);
|
||||||
const salay = [2, 5, 10, 15, 20, 25, 30, 50, 80, 100];
|
const salay = [2, 5, 10, 15, 20, 25, 30, 50, 80, 100];
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
station: [],
|
station: [],
|
||||||
@@ -149,8 +150,7 @@ const fromValue = reactive({
|
|||||||
});
|
});
|
||||||
|
|
||||||
onLoad((parmas) => {
|
onLoad((parmas) => {
|
||||||
console.log(parmas);
|
// getTreeselect();
|
||||||
getTreeselect();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {});
|
onMounted(() => {});
|
||||||
@@ -244,6 +244,23 @@ function getTreeselect() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function loginbackdoor() {
|
||||||
|
$api.createRequest('/app/mock/login', {}, 'post').then((resData) => {
|
||||||
|
$api.msg('模拟帐号密码测试登录成功');
|
||||||
|
loginSetToken(resData.token).then((resume) => {
|
||||||
|
if (resume.data.jobTitleId) {
|
||||||
|
// 设置推荐列表,每次退出登录都需要更新
|
||||||
|
useUserStore().initSeesionId();
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/index/index',
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
nextStep();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 登录
|
// 登录
|
||||||
function loginTest() {
|
function loginTest() {
|
||||||
// uni.share({
|
// uni.share({
|
||||||
@@ -290,6 +307,12 @@ function complete() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="stylus" scoped>
|
<style lang="stylus" scoped>
|
||||||
|
.backdoor{
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
top: 500rpx;
|
||||||
|
background: red
|
||||||
|
}
|
||||||
.input-nx
|
.input-nx
|
||||||
position: relative
|
position: relative
|
||||||
border-bottom: 2rpx solid #EBEBEB
|
border-bottom: 2rpx solid #EBEBEB
|
||||||
|
|||||||
@@ -45,9 +45,7 @@
|
|||||||
<text v-if="userInfo.jobTitle.length - 1 !== index">|</text>
|
<text v-if="userInfo.jobTitle.length - 1 !== index">|</text>
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="top-btn button-click" >
|
<view class="top-btn button-click">电子名片</view>
|
||||||
电子名片
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="card-main">
|
<view class="card-main">
|
||||||
<view class="main-title">服务专区</view>
|
<view class="main-title">服务专区</view>
|
||||||
@@ -132,7 +130,6 @@ const isAbove90 = (percent) => parseFloat(percent) < 90;
|
|||||||
|
|
||||||
function getUserstatistics() {
|
function getUserstatistics() {
|
||||||
$api.createRequest('/app/user/statistics').then((resData) => {
|
$api.createRequest('/app/user/statistics').then((resData) => {
|
||||||
console.log(resData);
|
|
||||||
counts.value = resData.data;
|
counts.value = resData.data;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
7
static/js/sm4.min.js
vendored
Normal file
7
static/js/sm4.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -180,7 +180,7 @@ const useChatGroupDBStore = defineStore("messageGroup", () => {
|
|||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
$api.streamRequest('/chat', params, onDataReceived, onError, onComplete);
|
$api.streamRequest('/app/chat/chat', params, onDataReceived, onError, onComplete);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
reject(err);
|
reject(err);
|
||||||
@@ -230,7 +230,7 @@ const useChatGroupDBStore = defineStore("messageGroup", () => {
|
|||||||
|
|
||||||
// 云端数据
|
// 云端数据
|
||||||
function getHistory() {
|
function getHistory() {
|
||||||
$api.chatRequest('/getHistory').then((res) => {
|
$api.chatRequest('/app/chat/getHistory').then((res) => {
|
||||||
if (!res.data.list.length) return
|
if (!res.data.list.length) return
|
||||||
let tabel = parseHistory(res.data.list)
|
let tabel = parseHistory(res.data.list)
|
||||||
if (tabel && tabel.length) {
|
if (tabel && tabel.length) {
|
||||||
@@ -250,7 +250,7 @@ const useChatGroupDBStore = defineStore("messageGroup", () => {
|
|||||||
const params = {
|
const params = {
|
||||||
sessionId: chatSessionID.value
|
sessionId: chatSessionID.value
|
||||||
}
|
}
|
||||||
$api.chatRequest('/detail', params, 'GET', loading).then((res) => {
|
$api.chatRequest('/app/chat/detail', params, 'GET', loading).then((res) => {
|
||||||
let list = parseHistoryDetail(res.data.list, chatSessionID.value)
|
let list = parseHistoryDetail(res.data.list, chatSessionID.value)
|
||||||
if (list.length) {
|
if (list.length) {
|
||||||
baseDB.db.add(massageName.value, list).then((ids) => {
|
baseDB.db.add(massageName.value, list).then((ids) => {
|
||||||
|
|||||||
113
utils/request.js
113
utils/request.js
@@ -1,76 +1,20 @@
|
|||||||
import config from "@/config.js"
|
import config from "@/config.js"
|
||||||
import {
|
|
||||||
sm2_Decrypt,
|
|
||||||
sm2_Encrypt
|
|
||||||
} from '@/common/globalFunction';
|
|
||||||
import useUserStore from '@/stores/useUserStore';
|
import useUserStore from '@/stores/useUserStore';
|
||||||
|
import {
|
||||||
|
sm4Decrypt,
|
||||||
|
sm4Encrypt
|
||||||
|
} from '../common/globalFunction';
|
||||||
|
|
||||||
|
|
||||||
|
const needToEncrypt = [
|
||||||
export function request({
|
["post", "/app/login"],
|
||||||
url,
|
["get", "/app/user/resume"],
|
||||||
method = 'GET',
|
["post", "/app/user/resume"],
|
||||||
data = {},
|
["post", "/app/user/experience/edit"],
|
||||||
load = false,
|
["post", "/app/user/experience/delete"],
|
||||||
header = {}
|
["get", "/app/user/experience/getSingle/{value}"],
|
||||||
} = {}) {
|
["get", "/app/user/experience/list"]
|
||||||
|
]
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
if (load) {
|
|
||||||
uni.showLoading({
|
|
||||||
title: '请稍候',
|
|
||||||
mask: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
let Authorization = ''
|
|
||||||
if (useUserStore().token) {
|
|
||||||
Authorization = `${useUserStore().userInfo.token}${useUserStore().token}`
|
|
||||||
}
|
|
||||||
uni.request({
|
|
||||||
url: config.baseUrl + url,
|
|
||||||
method,
|
|
||||||
data: data,
|
|
||||||
header: {
|
|
||||||
'Authorization': Authorization || '',
|
|
||||||
},
|
|
||||||
success: resData => {
|
|
||||||
// 响应拦截
|
|
||||||
if (resData.statusCode === 200) {
|
|
||||||
const {
|
|
||||||
code,
|
|
||||||
msg
|
|
||||||
} = resData.data
|
|
||||||
if (code === 200) {
|
|
||||||
resolve(resData.data)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
uni.showToast({
|
|
||||||
title: msg,
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (resData.data?.code === 401 || resData.data?.code === 402) {
|
|
||||||
useUserStore().logOut()
|
|
||||||
uni.showToast({
|
|
||||||
title: '登录过期,请重新登录',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const err = new Error('请求出现异常,请联系工作人员')
|
|
||||||
err.error = resData
|
|
||||||
reject(err)
|
|
||||||
},
|
|
||||||
fail: err => reject(err),
|
|
||||||
complete() {
|
|
||||||
if (load) {
|
|
||||||
uni.hideLoading();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param url String,请求的地址,默认:none
|
* @param url String,请求的地址,默认:none
|
||||||
@@ -94,15 +38,44 @@ export function createRequest(url, data = {}, method = 'GET', loading = false, h
|
|||||||
|
|
||||||
const header = headers || {};
|
const header = headers || {};
|
||||||
header["Authorization"] = encodeURIComponent(Authorization);
|
header["Authorization"] = encodeURIComponent(Authorization);
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------
|
||||||
|
// 检查当前请求是否需要加密
|
||||||
|
const isEncrypt = needToEncrypt.some(item => {
|
||||||
|
const matchMethod = item[0].toLowerCase() === method.toLowerCase();
|
||||||
|
const matchUrl = item[1].includes('{') ?
|
||||||
|
url.startsWith(item[1].split('/{')[0]) // 检查动态路径的前缀
|
||||||
|
:
|
||||||
|
item[1] === url; // 检查静态路径
|
||||||
|
return matchMethod && matchUrl;
|
||||||
|
});
|
||||||
|
|
||||||
|
let requestData = data;
|
||||||
|
|
||||||
|
if (isEncrypt) {
|
||||||
|
const jsonData = JSON.stringify(data);
|
||||||
|
const encryptedBody = sm4Encrypt(config.sm4Config.key, jsonData);
|
||||||
|
requestData = {
|
||||||
|
encrypted: true,
|
||||||
|
encryptedData: encryptedBody,
|
||||||
|
timestamp: Date.now()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// ------------------------------------------------------------------
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
uni.request({
|
uni.request({
|
||||||
url: config.baseUrl + url,
|
url: config.baseUrl + url,
|
||||||
method: method,
|
method: method,
|
||||||
data: data,
|
data: requestData,
|
||||||
header,
|
header,
|
||||||
success: resData => {
|
success: resData => {
|
||||||
// 响应拦截
|
// 响应拦截
|
||||||
if (resData.statusCode === 200) {
|
if (resData.statusCode === 200) {
|
||||||
|
if (resData.data.encrypted) {
|
||||||
|
const decryptedData = sm4Decrypt(config
|
||||||
|
.sm4Config.key, resData.data.encryptedData)
|
||||||
|
resData.data = JSON.parse(decryptedData)
|
||||||
|
}
|
||||||
const {
|
const {
|
||||||
code,
|
code,
|
||||||
msg
|
msg
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export default function StreamRequest(url, data = {}, onDataReceived, onError, o
|
|||||||
};
|
};
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(config.StreamBaseURl + url, {
|
const response = await fetch(config.baseUrl + url, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers,
|
headers,
|
||||||
body: JSON.stringify(data)
|
body: JSON.stringify(data)
|
||||||
@@ -46,6 +46,7 @@ export default function StreamRequest(url, data = {}, onDataReceived, onError, o
|
|||||||
let lines = buffer.split("\n");
|
let lines = buffer.split("\n");
|
||||||
buffer = lines.pop(); // 可能是不完整的 JSON 片段,留待下次解析
|
buffer = lines.pop(); // 可能是不完整的 JSON 片段,留待下次解析
|
||||||
for (let line of lines) {
|
for (let line of lines) {
|
||||||
|
line = line.slice(5).trim()
|
||||||
if (line.startsWith("data: ")) {
|
if (line.startsWith("data: ")) {
|
||||||
const jsonData = line.slice(6).trim();
|
const jsonData = line.slice(6).trim();
|
||||||
if (jsonData === "[DONE]") {
|
if (jsonData === "[DONE]") {
|
||||||
@@ -104,7 +105,7 @@ export function chatRequest(url, data = {}, method = 'GET', loading = false, hea
|
|||||||
header["Authorization"] = encodeURIComponent(Authorization);
|
header["Authorization"] = encodeURIComponent(Authorization);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
uni.request({
|
uni.request({
|
||||||
url: config.StreamBaseURl + url,
|
url: config.baseUrl + url,
|
||||||
method: method,
|
method: method,
|
||||||
data: data,
|
data: data,
|
||||||
header,
|
header,
|
||||||
|
|||||||
Reference in New Issue
Block a user