From 4ef77b225157805de45f477c82e0b51dbdc5b45d Mon Sep 17 00:00:00 2001 From: shirlwang <15254118591@163.com> Date: Tue, 16 Dec 2025 17:40:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=91=98=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apiRc/login.js | 10 +++++++++- apiRc/user/user.js | 6 +++--- pages/index/components/index-one.vue | 18 ++++++++++++++---- utilsRc/config.js | 8 ++++---- utilsRc/store/modules/user.js | 20 ++++++++++++++++++++ 5 files changed, 50 insertions(+), 12 deletions(-) diff --git a/apiRc/login.js b/apiRc/login.js index c085b13..eb70902 100644 --- a/apiRc/login.js +++ b/apiRc/login.js @@ -1,7 +1,7 @@ /* * @Date: 2025-10-31 11:06:15 * @LastEditors: shirlwang - * @LastEditTime: 2025-11-03 15:51:28 + * @LastEditTime: 2025-12-16 16:29:33 */ import request from '@/utilsRc/request' @@ -13,6 +13,14 @@ export function login(data) { params: data, }) } +// 登录方法 +export function loginByUserId(data) { + return request({ + method: 'get', + url: '/ksSso/getTjmhTokenById?userId='+data, + // params: data, + }) +} export function smsLogin(data) { return request({ method: 'post', diff --git a/apiRc/user/user.js b/apiRc/user/user.js index a40ac31..7e9279b 100644 --- a/apiRc/user/user.js +++ b/apiRc/user/user.js @@ -1,14 +1,14 @@ /* * @Date: 2025-01-XX - * @LastEditors: - * @LastEditTime: + * @LastEditors: shirlwang + * @LastEditTime: 2025-12-16 16:35:06 */ import request from '@/utilsRc/request' // 获取用户信息(职业规划推荐用) export function appUserInfo() { return request({ - fullUrl: 'http://222.80.110.161:11111/api/ks/app/user/appUserInfo', + fullUrl: 'http://222.80.110.161:80/api/ks/app/user/appUserInfo', method: 'get' }) } diff --git a/pages/index/components/index-one.vue b/pages/index/components/index-one.vue index 91012f3..6f7933f 100644 --- a/pages/index/components/index-one.vue +++ b/pages/index/components/index-one.vue @@ -1099,10 +1099,20 @@ import storeRc from '@/utilsRc/store/index.js'; function goRc(){ if (checkLogin()) { let userInfo = uni.getStorageSync('userInfo') - storeRc.dispatch('LoginByUserInfo', userInfo).then(res => { - // console.log(res, "'res"); - navTo('/packageRc/pages/index/index'); - }); + if(userInfo.isCompanyUser == 2){ + storeRc.dispatch('LoginByID', userInfo.userId).then(res => { + storeRc.dispatch('GetInfo').then(res => { + navTo('/packageRc/pages/daiban/daiban'); + }); + }); + }else if(userInfo.isCompanyUser == 1){ + storeRc.dispatch('LoginByUserInfo', userInfo).then(res => { + navTo('/packageRc/pages/index/index'); + }) + }else{ + showToast('企业账号无法查看此模块~'); + } + // storeRc.dispatch('LoginByID', userInfo.userId).then(res => { } } // 跳转到素质测评 diff --git a/utilsRc/config.js b/utilsRc/config.js index c29333e..c500ebb 100644 --- a/utilsRc/config.js +++ b/utilsRc/config.js @@ -2,7 +2,7 @@ * @Descripttion: * @Author: lip * @Date: 2022-12-28 13:59:09 - * @LastEditors: lip + * @LastEditors: shirlwang */ // 应用全局配置 import config from '@/config.js' @@ -10,7 +10,7 @@ import config from '@/config.js' let exports = { // ========== baseUrl 配置方式选择 ========== // 方式1:硬编码baseUrl(main分支使用,合并到main时不会影响现有功能) - baseUrl: 'http://222.80.110.161:11111/sdrc-api', // 正式环境在济南人才上部署(不要轻易连接) + baseUrl: 'http://222.80.110.161:80/sdrc-api', // 正式环境在济南人才上部署(不要轻易连接) // 方式2:引用根目录config.js的baseUrl(CareerMap分支可选方式,如需使用请注释掉方式1,取消注释此方式) // baseUrl: config.baseUrl, // 引用根目录config.js的baseUrl,避免重复配置 @@ -26,13 +26,13 @@ let exports = { // baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 已从根目录config.js引用,不再重复配置 // ========== 职业图谱专用baseUrl ========== - zytpBaseUrl: 'http://222.80.110.161:11111/career-map/api/ks_zytp/admin-api/zytp', + zytpBaseUrl: 'http://222.80.110.161:80/career-map/api/ks_zytp/admin-api/zytp', // ========== 用户接口专用baseUrl(其他用户接口使用) ========== userBaseUrl: 'http://ks.zhaopinzao8dian.com/api/ks', // 用户相关接口使用根目录config.js的baseUrl // ========== appUserInfo接口专用baseUrl ========== - appUserInfoBaseUrl: 'http://222.80.110.161:11111/api/ks', // appUserInfo接口专用,与其他接口路径不一致 + appUserInfoBaseUrl: 'http://222.80.110.161:80/api/ks', // appUserInfo接口专用,与其他接口路径不一致 diff --git a/utilsRc/store/modules/user.js b/utilsRc/store/modules/user.js index b3a0f55..1b39a00 100644 --- a/utilsRc/store/modules/user.js +++ b/utilsRc/store/modules/user.js @@ -4,6 +4,7 @@ import constant from '@/utilsRc/constant' import { login, // logout, + loginByUserId, getInfo, register, smsLogin, @@ -107,6 +108,25 @@ const user = { }) }) }, + // 网格员登录 + LoginByID({ + commit, + // state + }, userInfo) { + + return new Promise((resolve, reject) => { + // const info = JSON.parse(JSON.stringify(userInfo)) + // info.password = '04' + sm2.doEncrypt(info.password, state.publicKey, 0) + // info.username = '04' + sm2.doEncrypt(info.username, state.publicKey, 0) + loginByUserId(userInfo).then(res => { + setToken(res.token) + commit('SET_TOKEN', res.token) + resolve(res) + }).catch(error => { + reject(error) + }) + }) + }, // 登录 Login({ commit,