Merge remote-tracking branch 'remotes/origin/master' into minJeecg

# Conflicts:
#	env/.env.development
This commit is contained in:
lagos 2025-09-05 08:13:31 +08:00
commit 4b526dd5b4
7 changed files with 117 additions and 65 deletions

View File

@ -8,6 +8,7 @@ VITE_SHOW_SOURCEMAP = true
#VITE_WEBAPP = 'D://opt//AppUpdateTest' #VITE_WEBAPP = 'D://opt//AppUpdateTest'
VITE_WEBAPP = '' VITE_WEBAPP = ''
#VITE_SERVER_BASEURL = 'http://10.75.15.247:8080/jeecg-boot' #VITE_SERVER_BASEURL = 'http://10.75.15.247:8080/jeecg-boot'
#VITE_SERVER_BASEURL = 'http://10.96.108.144:8080/jeecg-boot'
VITE_SERVER_BASEURL = 'http://10.75.173.194:8080/jeecg-boot' VITE_SERVER_BASEURL = 'http://10.75.173.194:8080/jeecg-boot'
#VITE_SERVER_BASEURL = 'https://36.112.48.190/jeecg-boot' #VITE_SERVER_BASEURL = 'https://36.112.48.190/jeecg-boot'

View File

@ -17,8 +17,8 @@ export default defineManifestConfig({
name: VITE_APP_TITLE, name: VITE_APP_TITLE,
appid: VITE_UNI_APPID, appid: VITE_UNI_APPID,
description: '', description: '',
versionName: '2.1.0', versionName: '2.2.0',
versionCode: '20250808', versionCode: '20250903',
transformPx: false, transformPx: false,
locale: VITE_FALLBACK_LOCALE, // 'zh-Hans' locale: VITE_FALLBACK_LOCALE, // 'zh-Hans'
/* 5+App特有相关 */ /* 5+App特有相关 */

View File

@ -13,6 +13,7 @@ interface LoginParams {
*/ */
export function loginApi(config : LoginParams) { export function loginApi(config : LoginParams) {
// captcha/sys/login,/sys/sinopecLogin // captcha/sys/login,/sys/sinopecLogin
console.log('----',config)
const url = config.captcha ? '/sys/login' : '/sys/sinopecLogin'; const url = config.captcha ? '/sys/login' : '/sys/sinopecLogin';
return http({ return http({
url, url,

View File

@ -9,9 +9,7 @@ export function queryPostByUserIdApi(userid : string) {
return http({ return http({
url: '/sys/user/queryPostByUserId', url: '/sys/user/queryPostByUserId',
method: 'GET', method: 'GET',
data: { data: { userid }
userid
}
}); });
} }
@ -29,10 +27,19 @@ export function editUserApi(config : object) {
} }
/*根据部门Cod和角色Id查询用户信息*/ /*根据部门Cod和角色Id查询用户信息*/
export function queryUserByOrgRoleApi(config : object) { export function queryUserByOrgRoleApi(config : object) {
return http({ return http({
url: '/cxcChangesInPersonnel/cxcChangesInPersonnel/queryByDepCodRoleId', url: '/cxcChangesInPersonnel/cxcChangesInPersonnel/queryByDepCodRoleId',
method: 'GET', method: 'GET',
data: config data: config
}) })
}
/*根据劳动合同号查询用户信息*/
export function queryUsernameByLdhth(ldhth : string) {
return http({
url: '/sys/user/queryUsernameByLdhth',
method: 'GET',
data: { ldhth }
})
} }

View File

@ -2,8 +2,8 @@
"name": "数智产销", "name": "数智产销",
"appid": "__UNI__9F097F0", "appid": "__UNI__9F097F0",
"description": "", "description": "",
"versionName": "2.1.0", "versionName": "2.2.0",
"versionCode": "20250808", "versionCode": "20250903",
"transformPx": false, "transformPx": false,
"app-plus": { "app-plus": {
"usingComponents": true, "usingComponents": true,

View File

@ -17,13 +17,13 @@
<view class="account-login-area"> <view class="account-login-area">
<view class="box account"> <view class="box account">
<wd-icon name="user" size="15px"></wd-icon> <wd-icon name="user" size="15px"></wd-icon>
<wd-text text="账号:"></wd-text> <wd-text text=""></wd-text>
<wd-input class="uni-input" placeholder="请输入统一身份认证" v-model.trim="userName"></wd-input> <wd-input class="uni-input" placeholder="统一身份/劳动合同号" v-model.trim="userName"></wd-input>
</view> </view>
<view class="box password"> <view class="box password">
<wd-icon name="lock-on" size="15px"></wd-icon> <wd-icon name="lock-on" size="15px"></wd-icon>
<wd-text text="密码:"></wd-text> <wd-text text=""></wd-text>
<input class="uni-input" placeholder="请输入密码" :password="showPassword" <input class="uni-input" placeholder="密码" :password="showPassword"
v-model.trim="password" /> v-model.trim="password" />
<wd-icon v-if="showPassword" name="eye-close" size="18px" <wd-icon v-if="showPassword" name="eye-close" size="18px"
@click="handleChangePassword"></wd-icon> @click="handleChangePassword"></wd-icon>
@ -52,15 +52,32 @@
</PageLayout> </PageLayout>
</template> </template>
<script lang="ts" setup> <script setup>
import { useToast } from 'wot-design-uni' import {
import { ref } from 'vue' useToast
import { useUserStore } from '@/store/user' } from 'wot-design-uni'
import { http } from '@/utils/http' import {
import { HOME_PAGE } from '@/common/constants' ref
import { useRouter } from '@/plugin/uni-mini-router' } from 'vue'
import {
useUserStore
} from '@/store/user'
import {
http
} from '@/utils/http'
import {
HOME_PAGE
} from '@/common/constants'
import {
useRouter
} from '@/plugin/uni-mini-router'
import Base64 from 'base-64'; import Base64 from 'base-64';
import { loginApi } from '@/api/system'; import {
loginApi
} from '@/api/system';
import {
queryUsernameByLdhth
} from '@/api/system/user';
defineOptions({ defineOptions({
name: 'login', name: 'login',
@ -75,7 +92,8 @@
const showPassword = ref(true) // const showPassword = ref(true) //
const remPW = ref(false) // const remPW = ref(false) //
/**h5系统信息中没有appWgtVersion值*/ /**h5系统信息中没有appWgtVersion值*/
const version = uni.getSystemInfoSync().appWgtVersion ? uni.getSystemInfoSync().appWgtVersion : uni.getSystemInfoSync().appVersion const version = uni.getSystemInfoSync().appWgtVersion ? uni.getSystemInfoSync().appWgtVersion : uni.getSystemInfoSync()
.appVersion
const toast = useToast() const toast = useToast()
const userStore = useUserStore() const userStore = useUserStore()
const handleChangePassword = () => { const handleChangePassword = () => {
@ -92,58 +110,85 @@
uni.setStorageSync('accountpassword', JSON.stringify(localObj)) uni.setStorageSync('accountpassword', JSON.stringify(localObj))
uni.setStorageSync('savePwd', remPW.value) uni.setStorageSync('savePwd', remPW.value)
} }
const handleLogin = () => { const handleLogin = async () => {
if (userName.value.length === 0) { if (userName.value.length === 0) {
toast.warning('请输入统一身份认证') toast.warning('请输入统一身份/劳动合同号')
return return
} }
if (password.value.length === 0) { if (password.value.length === 0) {
toast.warning('请输入密码') toast.warning('请输入密码')
return return
} }
let un = Base64.encode(encodeURIComponent(userName.value)) const params = {
let pw = Base64.encode(encodeURIComponent(password.value)) username: userName.value,
loading.value = true password: password.value,
/*生产环境 begin */ };
// loginApi({ username: un, password: pw }) /*判断是否是六位纯数字*/
/*开发环境 begin */ if (userName.value.match(/^\d{6}$/)) {
loginApi({ username: userName.value, password: password.value, captcha: 'app' }) await queryUsernameByLdhth(userName.value).then(res => {
.then((res : any) => { if (res) {
if (res.success) { params = {
const { result } = res username: Base64.encode(encodeURIComponent(userName.value)),
const userInfo = result.userInfo password: Base64.encode(encodeURIComponent(password.value)),
userStore.setUserInfo({ };
...userInfo,
token: result.token,
userid: userInfo.id,
username: userInfo.username,
realname: userInfo.realname,
avatar: userInfo.avatar,
post: userInfo.post,
tenantId: userInfo.loginTenantId,
localStorageTime: +new Date(),
})
savePwd() //
uni.setStorageSync('logintime', Date.now()) //
router.pushTab({ path: HOME_PAGE })
} else { } else {
res.message == '数据库中已存在该记录' ? res.message = '请使用统一身份账号登录' : res.message params.captcha = 'app';
if (!res.success) {
try {
// JSON message JSON
const response = JSON.parse(res.message);
if (response.error_description === '用户名或密码错误') {
res.message = '用户名或密码错误';
}
} catch (e) {
}
}
toast.warning(res.message)
} }
}) })
.finally(() => { } else {
loading.value = false /*开发环境 */
}) // params.captcha = 'app';
/*生产环境 */
params = {
username: Base64.encode(encodeURIComponent(userName.value)),
password: Base64.encode(encodeURIComponent(password.value)),
};
}
login(params)
}
const login = async (params) => {
loading.value = true
try {
// API
const res = await loginApi(params);
if (res.success) {
const {
result
} = res
const userInfo = result.userInfo
userStore.setUserInfo({
...userInfo,
token: result.token,
userid: userInfo.id,
username: userInfo.username,
realname: userInfo.realname,
avatar: userInfo.avatar,
post: userInfo.post,
tenantId: userInfo.loginTenantId,
localStorageTime: +new Date(),
})
savePwd() //
uni.setStorageSync('logintime', Date.now()) //
router.pushTab({
path: HOME_PAGE
})
} else {
res.message == '数据库中已存在该记录' ? res.message = '请使用统一身份账号登录' : res.message
if (!res.success) {
try {
// JSON message JSON
const response = JSON.parse(res.message);
if (response.error_description === '用户名或密码错误') {
res.message = '用户名或密码错误';
}
} catch (e) {}
}
toast.warning(res.message)
}
} finally {
loading.value = false;
}
} }
onLoad(() => { onLoad(() => {

View File

@ -235,9 +235,7 @@ export const useUpdateApp = defineStore('updateApp', () => {
if (webApp) {// upDateAppApi by min if (webApp) {// upDateAppApi by min
path = webApp path = webApp
} }
console.log(22222222222222222)
upDateAppApi(path).then(async (res : any) => { upDateAppApi(path).then(async (res : any) => {
console.log(3333333333)
let { let {
result result
} = res } = res