用户信息加密方法待更新

This commit is contained in:
2026-02-24 10:13:06 +08:00
parent c1a77cfd9b
commit 6fcf6e8a70
7 changed files with 107 additions and 57 deletions

33
package-lock.json generated
View File

@@ -1,35 +1,32 @@
{ {
"name": "ks-app-employment-service",
"lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "lockfileVersion": 1,
"": { "dependencies": {
"dependencies": { "@dcloudio/uni-ui": {
"@dcloudio/uni-ui": "^1.5.11",
"dayjs": "^1.11.19",
"sm-crypto": "^0.3.13"
}
},
"node_modules/@dcloudio/uni-ui": {
"version": "1.5.11", "version": "1.5.11",
"resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.5.11.tgz", "resolved": "https://registry.npmmirror.com/@dcloudio/uni-ui/-/uni-ui-1.5.11.tgz",
"integrity": "sha512-DBtk046ofmeFd82zRI7d89SoEwrAxYzUN3WVPm1DIBkpLPG5F5QDNkHMnZGu2wNrMEmGBjBpUh3vqEY1L3jaMw==" "integrity": "sha512-DBtk046ofmeFd82zRI7d89SoEwrAxYzUN3WVPm1DIBkpLPG5F5QDNkHMnZGu2wNrMEmGBjBpUh3vqEY1L3jaMw=="
}, },
"node_modules/dayjs": { "crypto-js": {
"version": "3.3.0",
"resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-3.3.0.tgz",
"integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q=="
},
"dayjs": {
"version": "1.11.19", "version": "1.11.19",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz", "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.19.tgz",
"integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==" "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw=="
}, },
"node_modules/jsbn": { "jsbn": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", "resolved": "https://registry.npmmirror.com/jsbn/-/jsbn-1.1.0.tgz",
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="
}, },
"node_modules/sm-crypto": { "sm-crypto": {
"version": "0.3.13", "version": "0.3.13",
"resolved": "https://registry.npmmirror.com/sm-crypto/-/sm-crypto-0.3.13.tgz", "resolved": "https://registry.npmmirror.com/sm-crypto/-/sm-crypto-0.3.13.tgz",
"integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==", "integrity": "sha512-ztNF+pZq6viCPMA1A6KKu3bgpkmYti5avykRHbcFIdSipFdkVmfUw2CnpM2kBJyppIalqvczLNM3wR8OQ0pT5w==",
"dependencies": { "requires": {
"jsbn": "^1.1.0" "jsbn": "^1.1.0"
} }
} }

View File

@@ -1,6 +1,7 @@
{ {
"dependencies": { "dependencies": {
"@dcloudio/uni-ui": "^1.5.11", "@dcloudio/uni-ui": "^1.5.11",
"crypto-js": "^3.3.0",
"dayjs": "^1.11.19", "dayjs": "^1.11.19",
"sm-crypto": "^0.3.13" "sm-crypto": "^0.3.13"
}, },

View File

@@ -28,12 +28,12 @@
<view > <view >
<view class="gk-l-i-bottom" v-html="item.content"></view> <view class="gk-l-i-bottom" v-html="item.content"></view>
</view> </view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</AppLayout> </AppLayout>
</template> </template>
@@ -42,6 +42,9 @@ import { inject, ref, reactive, onMounted } from "vue";
const { $api, navTo, navBack, vacanciesTo } = inject("globalFunction"); const { $api, navTo, navBack, vacanciesTo } = inject("globalFunction");
import config from "@/config.js"; import config from "@/config.js";
import AppLayout from "@/components/AppLayout/AppLayout.vue"; import AppLayout from "@/components/AppLayout/AppLayout.vue";
import CryptoJS from 'crypto-js'
const title = ref(""); const title = ref("");
const baseUrl = config.imgBaseUrl; const baseUrl = config.imgBaseUrl;
const pageSize=ref(10) const pageSize=ref(10)
@@ -49,7 +52,27 @@ const pageNum=ref(1)
const totalNum=ref(0) const totalNum=ref(0)
// Tab 控制 // Tab 控制
const currentTab = ref("train"); // 默认显示培训公告 const currentTab = ref("train"); // 默认显示培训公告
async function loginA(){
const form={
usertype: "2",
enterprisecode: '91310101MA1FPX1234',
enterprisename: 'tt',
contactperson: "",
contactphone: "",
idno: "",
name: ""
}
//用户信息加密方法待更新
// const key = '9zS+DFKrzxvosO82mTcPJQ=='
// const secretKey = CryptoJS.enc.Utf8.parse(key);//key 为你的秘钥
// const srcs = CryptoJS.enc.Utf8.parse(form.idno);
// // AES 加密
// const encrypted = CryptoJS.AES.encrypt(srcs, secretKey, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7}).toString()
// console.log('AES Encrypted:111', encrypted)
// form.idno=encrypted
var resLogin = await $api.myRequest('/auth/login2/ks',form,'post',10100);
console.log("resLogin",resLogin)
}
function switchTab(tabName) { function switchTab(tabName) {
currentTab.value = tabName; currentTab.value = tabName;
getPolicyData('refresh',currentTab) getPolicyData('refresh',currentTab)
@@ -65,6 +88,7 @@ const getBackgroundStyle = (imageName) => ({
}); });
onMounted(() => { onMounted(() => {
getPolicyData('refresh',currentTab); getPolicyData('refresh',currentTab);
loginA()
}); });
const policyList = ref([]); const policyList = ref([]);
function getPolicyData(type = 'add',currentTab='train') { function getPolicyData(type = 'add',currentTab='train') {
@@ -92,7 +116,7 @@ function getPolicyData(type = 'add',currentTab='train') {
policyList.value=resData.rows policyList.value=resData.rows
totalNum.value=resData.total totalNum.value=resData.total
} }
}); });
} }
if (type === 'add' && pageNum.value < maxPage) { if (type === 'add' && pageNum.value < maxPage) {
@@ -200,4 +224,4 @@ function goPolicyDetail(item) {
margin-top: 12rpx; margin-top: 12rpx;
} }
} }
</style> </style>

View File

@@ -22,7 +22,7 @@
<image src="/packageB/static/images/train/arrow.png" mode=""></image> <image src="/packageB/static/images/train/arrow.png" mode=""></image>
</view> </view>
</view> </view>
</view> </view>
<view class="btns" @click="jumps('/packageB/train/mockExam/examList')"> <view class="btns" @click="jumps('/packageB/train/mockExam/examList')">
<image src="/packageB/static/images/train/mnks-k.png" mode=""></image> <image src="/packageB/static/images/train/mnks-k.png" mode=""></image>
@@ -33,7 +33,7 @@
<image src="/packageB/static/images/train/arrow.png" mode=""></image> <image src="/packageB/static/images/train/arrow.png" mode=""></image>
</view> </view>
</view> </view>
</view> </view>
<!-- <view class="btns" @click="jumps('/packageB/train/wrongAnswer/mistakeNotebook')"> <!-- <view class="btns" @click="jumps('/packageB/train/wrongAnswer/mistakeNotebook')">
<image src="/packageB/static/images/train/ctb-k.png" mode=""></image> <image src="/packageB/static/images/train/ctb-k.png" mode=""></image>
@@ -44,7 +44,7 @@
<image src="/packageB/static/images/train/arrow.png" mode=""></image> <image src="/packageB/static/images/train/arrow.png" mode=""></image>
</view> </view>
</view> </view>
</view> --> </view> -->
</view> </view>
</view> </view>
@@ -57,6 +57,7 @@ import { onLoad, onShow } from '@dcloudio/uni-app';
const { $api, navTo, vacanciesTo, formatTotal, config } = inject('globalFunction'); const { $api, navTo, vacanciesTo, formatTotal, config } = inject('globalFunction');
import useUserStore from '@/stores/useUserStore'; import useUserStore from '@/stores/useUserStore';
import useDictStore from '@/stores/useDictStore'; import useDictStore from '@/stores/useDictStore';
import CryptoJS from 'crypto-js'
onLoad(() => { onLoad(() => {
thirdLogin() thirdLogin()
@@ -81,6 +82,12 @@ async function thirdLogin(){
contactperson: "", contactperson: "",
contactphone: "", contactphone: "",
} }
//用户信息加密方法待更新
// let key = '9zS+DFKrzxvosO82mTcPJQ=='
// let secretKey = CryptoJS.enc.Utf8.parse(key);//key 为你的秘钥
// let srcs = CryptoJS.enc.Utf8.parse(form.idno);
// let encrypted = CryptoJS.AES.encrypt(srcs, secretKey, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7}).toString()
// form.idno=encrypted
}else if (uni.getStorageSync('userInfo').isCompanyUser=='0') { }else if (uni.getStorageSync('userInfo').isCompanyUser=='0') {
form={ form={
usertype: "2", usertype: "2",
@@ -181,7 +188,7 @@ async function thirdLogin(){
} }
} }
} }
} }
</style> </style>

View File

@@ -17,12 +17,12 @@
placeholder="输入" placeholder="输入"
placeholder-class="inputplace" placeholder-class="inputplace"
/> />
<uni-icons <uni-icons
v-if="searchKeyword" v-if="searchKeyword"
class="clear-icon" class="clear-icon"
type="clear" type="clear"
size="24" size="24"
color="#999" color="#999"
@click="clearSearch" @click="clearSearch"
/> />
</view> </view>
@@ -35,8 +35,8 @@
<view class="title-line"></view> <view class="title-line"></view>
</view> </view>
<view class="video-grid" v-if="dataList.length>0"> <view class="video-grid" v-if="dataList.length>0">
<view <view
v-for="item in dataList" v-for="item in dataList"
:key="item.category_value" :key="item.category_value"
class="train-item" class="train-item"
> >
@@ -66,6 +66,7 @@ import { inject, ref, reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app'; import { onLoad } from '@dcloudio/uni-app';
const { $api, navTo, navBack } = inject('globalFunction'); const { $api, navTo, navBack } = inject('globalFunction');
import config from "@/config.js" import config from "@/config.js"
import CryptoJS from 'crypto-js'
// state // state
const title = ref(''); const title = ref('');
@@ -130,7 +131,7 @@ function getDataList(type = 'add') {
dataList.value=dataList.value.concat(resData.rows) dataList.value=dataList.value.concat(resData.rows)
totalNum.value=resData.total totalNum.value=resData.total
}); });
} }
} }
@@ -157,6 +158,12 @@ async function thirdLogin(){
contactperson: "", contactperson: "",
contactphone: "", contactphone: "",
} }
//用户信息加密方法待更新
// let key = '9zS+DFKrzxvosO82mTcPJQ=='
// let secretKey = CryptoJS.enc.Utf8.parse(key);//key 为你的秘钥
// let srcs = CryptoJS.enc.Utf8.parse(form.idno);
// let encrypted = CryptoJS.AES.encrypt(srcs, secretKey, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7}).toString()
// form.idno=encrypted
}else if (uni.getStorageSync('userInfo').isCompanyUser=='0') { }else if (uni.getStorageSync('userInfo').isCompanyUser=='0') {
form={ form={
usertype: "2", usertype: "2",
@@ -238,9 +245,9 @@ image {
line-height: 38rpx; line-height: 38rpx;
margin-left: 10rpx; margin-left: 10rpx;
} }
} }
} }
.heng{ .heng{
width: 120rpx; width: 120rpx;

View File

@@ -17,12 +17,12 @@
placeholder="输入视频名称" placeholder="输入视频名称"
placeholder-class="inputplace" placeholder-class="inputplace"
/> />
<uni-icons <uni-icons
v-if="searchKeyword" v-if="searchKeyword"
class="clear-icon" class="clear-icon"
type="clear" type="clear"
size="24" size="24"
color="#999" color="#999"
@click="clearSearch" @click="clearSearch"
/> />
</view> </view>
@@ -35,16 +35,16 @@
<view class="title-line"></view> <view class="title-line"></view>
</view> </view>
<view class="video-grid" v-if="dataList.length>0"> <view class="video-grid" v-if="dataList.length>0">
<view <view
v-for="video in dataList" v-for="video in dataList"
:key="video.id || video.videoId" :key="video.id || video.videoId"
class="video-item" class="video-item"
:style="getItemBackgroundStyle('video-bg.png')" :style="getItemBackgroundStyle('video-bg.png')"
@click="playVideo(video)" @click="playVideo(video)"
> >
<view class="video-cover"> <view class="video-cover">
<image <image
:src="trainVideoImgUrl+ video.cover" :src="trainVideoImgUrl+ video.cover"
mode="aspectFill" mode="aspectFill"
></image> ></image>
</view> </view>
@@ -63,6 +63,7 @@ import { inject, ref, reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app'; import { onLoad } from '@dcloudio/uni-app';
const { $api, navTo, navBack } = inject('globalFunction'); const { $api, navTo, navBack } = inject('globalFunction');
import config from "@/config.js" import config from "@/config.js"
import CryptoJS from 'crypto-js'
// state // state
const title = ref(''); const title = ref('');
@@ -133,7 +134,7 @@ function getDataList(type = 'add') {
}); });
} }
} }
// 播放视频 // 播放视频
async function playVideo(video) { async function playVideo(video) {
@@ -155,6 +156,12 @@ async function thirdLogin(){
contactperson: "", contactperson: "",
contactphone: "", contactphone: "",
} }
//用户信息加密方法待更新
// let key = '9zS+DFKrzxvosO82mTcPJQ=='
// let secretKey = CryptoJS.enc.Utf8.parse(key);//key 为你的秘钥
// let srcs = CryptoJS.enc.Utf8.parse(form.idno);
// let encrypted = CryptoJS.AES.encrypt(srcs, secretKey, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7}).toString()
// form.idno=encrypted
}else if (uni.getStorageSync('userInfo').isCompanyUser=='0') { }else if (uni.getStorageSync('userInfo').isCompanyUser=='0') {
form={ form={
usertype: "2", usertype: "2",

View File

@@ -162,6 +162,7 @@
} from "@/utils/tabbarManager"; } from "@/utils/tabbarManager";
import WxAuthLogin from "@/components/WxAuthLogin/WxAuthLogin.vue"; import WxAuthLogin from "@/components/WxAuthLogin/WxAuthLogin.vue";
import config from "@/config.js"; import config from "@/config.js";
import CryptoJS from 'crypto-js'
const { const {
longitudeVal, longitudeVal,
latitudeVal latitudeVal
@@ -270,6 +271,12 @@
contactperson: "", contactperson: "",
contactphone: "", contactphone: "",
} }
//用户信息加密方法待更新
// let key = '9zS+DFKrzxvosO82mTcPJQ=='
// let secretKey = CryptoJS.enc.Utf8.parse(key);//key 为你的秘钥
// let srcs = CryptoJS.enc.Utf8.parse(form.idno);
// let encrypted = CryptoJS.AES.encrypt(srcs, secretKey, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7}).toString()
// form.idno=encrypted
}else if (uni.getStorageSync('userInfo') && uni.getStorageSync('userInfo').isCompanyUser=='0') { }else if (uni.getStorageSync('userInfo') && uni.getStorageSync('userInfo').isCompanyUser=='0') {
form={ form={
usertype: "2", usertype: "2",
@@ -309,7 +316,7 @@
// wxAuthLoginRef.value?.open(); // wxAuthLoginRef.value?.open();
// }); // });
// }); // });
watch(() => userInfo.value.userType, (newVal) => { watch(() => userInfo.value.userType, (newVal) => {
if(newVal=='ent'){ if(newVal=='ent'){
showTabar.value = true showTabar.value = true
}else{ }else{
@@ -408,18 +415,18 @@
}; };
async function getHeart() { async function getHeart() {
const raw = uni.getStorageSync("Padmin-Token"); const raw = uni.getStorageSync("Padmin-Token");
const token = typeof raw === "string" ? raw.trim() : ""; const token = typeof raw === "string" ? raw.trim() : "";
var isLogins = await thirdLogin(); var isLogins = await thirdLogin();
const headers = token ? { const headers = token ? {
Authorization: raw.startsWith("Bearer ") ? raw : `Bearer ${token}` Authorization: raw.startsWith("Bearer ") ? raw : `Bearer ${token}`
} : {}; } : {};
$api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => { $api.myRequest("/dashboard/auth/heart", {}, "POST", 10100, headers).then((resData) => {
if (isLogins) { if (isLogins) {
isLogin.value = true; isLogin.value = true;