前端修改部分响应

This commit is contained in:
砂糖
2025-08-06 10:45:52 +08:00
parent e0e6babe83
commit 5127bb1145
5 changed files with 4666 additions and 11 deletions

View File

@@ -52,9 +52,9 @@ spring:
driverClassName: com.mysql.cj.jdbc.Driver
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
url: jdbc:mysql://47.117.71.33:11293/gear?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
username: root
password: root
password: Fuande@666
# 从库数据源
slave:
lazy: true

View File

@@ -30,6 +30,7 @@
"jsencrypt": "3.3.2",
"nprogress": "0.2.0",
"pinia": "3.0.2",
"sortablejs": "^1.15.6",
"splitpanes": "4.0.4",
"vue": "3.5.16",
"vue-cropper": "1.1.1",

4654
ruoyi-ui3/pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -26,8 +26,8 @@ const useUserStore = defineStore(
const uuid = userInfo.uuid
return new Promise((resolve, reject) => {
login(username, password, code, uuid).then(res => {
setToken(res.token)
this.token = res.token
setToken(res.data.token)
this.token = res.data.token
resolve()
}).catch(error => {
reject(error)
@@ -38,14 +38,14 @@ const useUserStore = defineStore(
getInfo() {
return new Promise((resolve, reject) => {
getInfo().then(res => {
const user = res.user
const user = res.data.user
let avatar = user.avatar || ""
if (!isHttp(avatar)) {
avatar = (isEmpty(avatar)) ? defAva : import.meta.env.VITE_APP_BASE_API + avatar
}
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
this.roles = res.roles
this.permissions = res.permissions
if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
this.roles = res.data.roles
this.permissions = res.data.permissions
} else {
this.roles = ['ROLE_DEFAULT']
}

View File

@@ -140,10 +140,10 @@ function handleLogin() {
function getCode() {
getCodeImg().then(res => {
captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled
captchaEnabled.value = res.data.captchaEnabled === undefined ? true : res.data.captchaEnabled
if (captchaEnabled.value) {
codeUrl.value = "data:image/gif;base64," + res.img
loginForm.value.uuid = res.uuid
codeUrl.value = "data:image/gif;base64," + res.data.img
loginForm.value.uuid = res.data.uuid
}
})
}