网格员账号登录跳转

This commit is contained in:
2025-12-16 17:40:00 +08:00
parent 4fbd32156d
commit 4ef77b2251
5 changed files with 50 additions and 12 deletions

View File

@@ -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',

View File

@@ -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'
})
}

View File

@@ -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 => {
}
}
// 跳转到素质测评

View File

@@ -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硬编码baseUrlmain分支使用合并到main时不会影响现有功能
baseUrl: 'http://222.80.110.161:11111/sdrc-api', // 正式环境在济南人才上部署(不要轻易连接)
baseUrl: 'http://222.80.110.161:80/sdrc-api', // 正式环境在济南人才上部署(不要轻易连接)
// 方式2引用根目录config.js的baseUrlCareerMap分支可选方式如需使用请注释掉方式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接口专用与其他接口路径不一致

View File

@@ -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,