禅道bug修复
This commit is contained in:
parent
d4cb7678f4
commit
0abf93c8c6
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -162,15 +162,10 @@ const getUserInfo = () => {
|
||||||
|
|
||||||
// 存储用户信息
|
// 存储用户信息
|
||||||
memberStore.setUserInfo(res.data)
|
memberStore.setUserInfo(res.data)
|
||||||
|
uni.$u.toast('登录成功')
|
||||||
if (res.data.loginType.includes(1)) {
|
setTimeout(() => {
|
||||||
uni.$u.toast('登录成功')
|
uni.switchTab({ url: '/pages/workbenches/index' })
|
||||||
setTimeout(() => {
|
}, 500)
|
||||||
uni.switchTab({ url: '/pages/workbenches/index' })
|
|
||||||
}, 500)
|
|
||||||
} else {
|
|
||||||
uni.$u.toast('当前用户暂无登录APP权限,请联系管理员')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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({
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue