禅道bug修复

This commit is contained in:
BianLzhaoMin 2025-04-17 09:38:55 +08:00
parent d4cb7678f4
commit 0abf93c8c6
5 changed files with 29 additions and 18 deletions

View File

@ -1 +1,2 @@
VITE_API_BASE_URL = http://192.168.0.14:11997 # VITE_API_BASE_URL = http://192.168.0.14:11997
VITE_API_BASE_URL = /api

View File

@ -162,15 +162,10 @@ const getUserInfo = () => {
// //
memberStore.setUserInfo(res.data) memberStore.setUserInfo(res.data)
if (res.data.loginType.includes(1)) {
uni.$u.toast('登录成功') uni.$u.toast('登录成功')
setTimeout(() => { setTimeout(() => {
uni.switchTab({ url: '/pages/workbenches/index' }) uni.switchTab({ url: '/pages/workbenches/index' })
}, 500) }, 500)
} else {
uni.$u.toast('当前用户暂无登录APP权限请联系管理员')
}
} }
}) })
} }

View File

@ -1,18 +1,32 @@
import { http } from '@/utils/http' import { http } from '@/utils/http'
import { encrypt, decrypt } from '@/utils/encrypt' // 引入加解密方法
// 登录接口 // 登录接口
export const loginApi = (data) => { export const loginApi = (data) => {
return http({ return http({
method: 'POST', method: 'POST',
url: '/imgTool/login', url: '/imgTool/loginApp',
isEncrypt: true, // isEncrypt: true,
isPassWord: false, // isPassWord: false,
data, data,
header: { header: {
'Content-Type': 'application/x-www-form-urlencoded', 'Content-Type': 'application/x-www-form-urlencoded',
}, },
}) })
} }
// 登录接口
// export const loginApi = (data) => {
// return http({
// method: 'POST',
// url: '/imgTool/login',
// isEncrypt: true,
// isPassWord: false,
// data,
// header: {
// 'Content-Type': 'application/x-www-form-urlencoded',
// },
// })
// }
// 获取用户信息 // 获取用户信息
export const getUserInfoApi = () => { export const getUserInfoApi = () => {
return http({ return http({

View File

@ -85,6 +85,7 @@ export const http = (options) => {
uni.request({ uni.request({
...options, ...options,
success(res) { success(res) {
console.log(res, 'res')
// 1. 判断是否请求成功 // 1. 判断是否请求成功
if (res.statusCode >= 200 && res.statusCode < 300) { if (res.statusCode >= 200 && res.statusCode < 300) {
if (res.data.code >= 200 && res.data.code < 300) { if (res.data.code >= 200 && res.data.code < 300) {
@ -105,7 +106,7 @@ export const http = (options) => {
} else if (res.data.code === 500) { } else if (res.data.code === 500) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: `${res.data.msg}`, title: res?.data?.message,
}) })
} }
} else if (res.statusCode === 401) { } else if (res.statusCode === 401) {
@ -122,7 +123,7 @@ export const http = (options) => {
// 3. 其他错误 // 3. 其他错误
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '请求失败,请切换网络后尝试', title: res?.data?.message || '请求失败,请切换网络后尝试',
}) })
reject(res) reject(res)
} }
@ -131,7 +132,7 @@ export const http = (options) => {
fail(err) { fail(err) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '请求失败,请切换网络后尝试', title: err?.message || '请求失败,请切换网络后尝试',
}) })
console.log(err, '请求失败') console.log(err, '请求失败')
reject(err) reject(err)

View File

@ -8,9 +8,9 @@ export default defineConfig({
proxy: { proxy: {
// 在此处编写代理规则 // 在此处编写代理规则
'/api': { '/api': {
// target: 'http://192.168.0.133:11997', // 梁超 target: 'http://192.168.0.133:11997', // 梁超
// target: 'http://192.168.0.137:11997', // 方亮 // target: 'http://192.168.0.137:11997', // 方亮
target: 'http://192.168.0.60:11997', // 赵福海 // target: 'http://192.168.0.60:11997', // 赵福海
// target: 'http://192.168.0.39:11997', // 陈长文 // target: 'http://192.168.0.39:11997', // 陈长文
changeOrigin: true, changeOrigin: true,
rewrite: (path) => { rewrite: (path) => {