响应结果集结构更改

master
DongZeLiang 2023-09-29 15:56:38 +08:00
parent 146e5b6b88
commit e766adb916
29 changed files with 89 additions and 89 deletions

View File

@ -46,4 +46,4 @@ function install() {
export default {
install,
}
}

View File

@ -172,11 +172,11 @@ export default {
//
let quill = this.Quill;
//
if (res.code == 200) {
if (res.data.code == 200) {
//
let length = quill.getSelection().index;
// res.url
quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.fileName);
// res.data.url
quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.data.fileName);
//
quill.setSelection(length + 1);
} else {

View File

@ -146,13 +146,13 @@ export default {
},
//
handleUploadSuccess(res, file) {
if (res.code === 200) {
this.uploadList.push({ name: res.fileName, url: res.fileName });
if (res.data.code === 200) {
this.uploadList.push({ name: res.data.fileName, url: res.data.fileName });
this.uploadedSuccessfully();
} else {
this.number--;
this.$modal.closeLoading();
this.$modal.msgError(res.msg);
this.$modal.msgError(res.data.msg);
this.$refs.fileUpload.handleRemove(file);
this.uploadedSuccessfully();
}

View File

@ -19,7 +19,7 @@
>
<i class="el-icon-plus"></i>
</el-upload>
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip">
请上传
@ -154,13 +154,13 @@ export default {
},
//
handleUploadSuccess(res, file) {
if (res.code === 200) {
this.uploadList.push({ name: res.fileName, url: res.fileName });
if (res.data.code === 200) {
this.uploadList.push({ name: res.data.fileName, url: res.data.fileName });
this.uploadedSuccessfully();
} else {
this.number--;
this.$modal.closeLoading();
this.$modal.msgError(res.msg);
this.$modal.msgError(res.data.msg);
this.$refs.imageUpload.handleRemove(file);
this.uploadedSuccessfully();
}

View File

@ -19,7 +19,7 @@ export default {
const isBlob = blobValidate(res.data);
if (isBlob) {
const blob = new Blob([res.data])
this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
this.saveAs(blob, decodeURIComponent(res.data.headers['download-filename']))
} else {
this.printErrMsg(res.data);
}
@ -36,7 +36,7 @@ export default {
const isBlob = blobValidate(res.data);
if (isBlob) {
const blob = new Blob([res.data])
this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
this.saveAs(blob, decodeURIComponent(res.data.headers['download-filename']))
} else {
this.printErrMsg(res.data);
}

View File

@ -41,8 +41,8 @@ const user = {
const uuid = userInfo.uuid
return new Promise((resolve, reject) => {
login(username, password, code, uuid).then(res => {
setToken(res.token)
commit('SET_TOKEN', res.token)
setToken(res.data)
commit('SET_TOKEN', res.data)
resolve()
}).catch(error => {
reject(error)
@ -54,11 +54,11 @@ const user = {
GetInfo({ commit, state }) {
return new Promise((resolve, reject) => {
getInfo().then(res => {
const user = res.user
const user = res.data.user
const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', res.roles)
commit('SET_PERMISSIONS', res.permissions)
if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', res.data.roles)
commit('SET_PERMISSIONS', res.data.permissions)
} else {
commit('SET_ROLES', ['ROLE_DEFAULT'])
}

View File

@ -38,7 +38,7 @@ export const options = {
function responseConverter(response, dictMeta) {
const dicts = response.content instanceof Array ? response.content : response
if (dicts === undefined) {
console.warn(`no dict data of "${dictMeta.type}" found in the response`)
console.warn(`在响应中未找到“${dictMeta.type}”的字典数据`)
return []
}
return dicts.map(d => dictConverter(d, dictMeta))

View File

@ -110,10 +110,10 @@ export default {
methods: {
getCode() {
getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
this.captchaEnabled = res.data.captchaEnabled === undefined ? true : res.data.captchaEnabled;
if (this.captchaEnabled) {
this.codeUrl = "data:image/gif;base64," + res.img;
this.loginForm.uuid = res.uuid;
this.codeUrl = "data:image/gif;base64," + res.data.img;
this.loginForm.uuid = res.data.uuid;
}
});
},

View File

@ -356,8 +356,8 @@ export default {
getList() {
this.loading = true;
listJob(this.queryParams).then(response => {
this.jobList = response.rows;
this.total = response.total;
this.jobList = response.data.rows;
this.total = response.data.total;
this.loading = false;
});
},

View File

@ -233,8 +233,8 @@ export default {
getList() {
this.loading = true;
listJobLog(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.jobLogList = response.rows;
this.total = response.total;
this.jobLogList = response.data.rows;
this.total = response.data.total;
this.loading = false;
}
);

View File

@ -175,8 +175,8 @@ export default {
getList() {
this.loading = true;
list(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.list = response.rows;
this.total = response.total;
this.list = response.data.rows;
this.total = response.data.total;
this.loading = false;
}
);

View File

@ -92,8 +92,8 @@ export default {
getList() {
this.loading = true;
list(this.queryParams).then(response => {
this.list = response.rows;
this.total = response.total;
this.list = response.data.rows;
this.total = response.data.total;
this.loading = false;
});
},

View File

@ -254,8 +254,8 @@ export default {
getList() {
this.loading = true;
list(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
this.list = response.rows;
this.total = response.total;
this.list = response.data.rows;
this.total = response.data.total;
this.loading = false;
}
);

View File

@ -113,10 +113,10 @@ export default {
methods: {
getCode() {
getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
this.captchaEnabled = res.data.captchaEnabled === undefined ? true : res.data.captchaEnabled;
if (this.captchaEnabled) {
this.codeUrl = "data:image/gif;base64," + res.img;
this.registerForm.uuid = res.uuid;
this.codeUrl = "data:image/gif;base64," + res.data.img;
this.registerForm.uuid = res.data.uuid;
}
});
},

View File

@ -240,8 +240,8 @@ export default {
getList() {
this.loading = true;
listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.configList = response.rows;
this.total = response.total;
this.configList = response.data.rows;
this.total = response.data.total;
this.loading = false;
}
);

View File

@ -295,8 +295,8 @@ export default {
getList() {
this.loading = true;
listData(this.queryParams).then(response => {
this.dataList = response.rows;
this.total = response.total;
this.dataList = response.data.rows;
this.total = response.data.total;
this.loading = false;
});
},
@ -399,4 +399,4 @@ export default {
}
}
};
</script>
</script>

View File

@ -244,8 +244,8 @@ export default {
getList() {
this.loading = true;
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.typeList = response.rows;
this.total = response.total;
this.typeList = response.data.rows;
this.total = response.data.total;
this.loading = false;
}
);
@ -344,4 +344,4 @@ export default {
}
}
};
</script>
</script>

View File

@ -224,8 +224,8 @@ export default {
getList() {
this.loading = true;
listNotice(this.queryParams).then(response => {
this.noticeList = response.rows;
this.total = response.total;
this.noticeList = response.data.rows;
this.total = response.data.total;
this.loading = false;
});
},

View File

@ -214,8 +214,8 @@ export default {
getList() {
this.loading = true;
listPost(this.queryParams).then(response => {
this.postList = response.rows;
this.total = response.total;
this.postList = response.data.rows;
this.total = response.data.total;
this.loading = false;
});
},

View File

@ -143,8 +143,8 @@ export default {
getList() {
this.loading = true;
allocatedUserList(this.queryParams).then(response => {
this.userList = response.rows;
this.total = response.total;
this.userList = response.data.rows;
this.total = response.data.total;
this.loading = false;
}
);
@ -196,4 +196,4 @@ export default {
}
}
};
</script>
</script>

View File

@ -349,8 +349,8 @@ export default {
getList() {
this.loading = true;
listRole(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.roleList = response.rows;
this.total = response.total;
this.roleList = response.data.rows;
this.total = response.data.total;
this.loading = false;
}
);
@ -382,14 +382,14 @@ export default {
/** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect(roleId) {
return roleMenuTreeselect(roleId).then(response => {
this.menuOptions = response.menus;
this.menuOptions = response.data.menus;
return response;
});
},
/** 根据角色ID查询部门树结构 */
getDeptTree(roleId) {
return deptTreeSelect(roleId).then(response => {
this.deptOptions = response.depts;
this.deptOptions = response.data.depts;
return response;
});
},
@ -514,7 +514,7 @@ export default {
this.open = true;
this.$nextTick(() => {
roleMenu.then(res => {
let checkedKeys = res.checkedKeys
let checkedKeys = res.data.checkedKeys
checkedKeys.forEach((v) => {
this.$nextTick(()=>{
this.$refs.menu.setChecked(v, true ,false);
@ -540,7 +540,7 @@ export default {
this.openDataScope = true;
this.$nextTick(() => {
deptTreeSelect.then(res => {
this.$refs.dept.setCheckedKeys(res.checkedKeys);
this.$refs.dept.setCheckedKeys(res.data.checkedKeys);
});
});
this.title = "分配数据权限";
@ -602,4 +602,4 @@ export default {
}
}
};
</script>
</script>

View File

@ -103,8 +103,8 @@ export default {
//
getList() {
unallocatedUserList(this.queryParams).then(res => {
this.userList = res.rows;
this.total = res.total;
this.userList = res.data.rows;
this.total = res.data.total;
});
},
/** 搜索按钮操作 */
@ -126,8 +126,8 @@ export default {
return;
}
authUserSelectAll({ roleId: roleId, userIds: userIds }).then(res => {
this.$modal.msgSuccess(res.msg);
if (res.code === 200) {
this.$modal.msgSuccess(res.data.msg);
if (res.data.code === 200) {
this.visible = false;
this.$emit("ok");
}

View File

@ -33,7 +33,7 @@
</template>
</el-table-column>
</el-table>
<pagination v-show="total>0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" />
<el-form label-width="100px">
@ -71,8 +71,8 @@ export default {
if (userId) {
this.loading = true;
getAuthRole(userId).then((response) => {
this.form = response.user;
this.roles = response.roles;
this.form = response.data.user;
this.roles = response.data.roles;
this.total = this.roles.length;
this.$nextTick(() => {
this.roles.forEach((row) => {
@ -114,4 +114,4 @@ export default {
},
},
};
</script>
</script>

View File

@ -462,7 +462,7 @@ export default {
this.getList();
this.getDeptTree();
this.getConfigKey("sys.user.initPassword").then(response => {
this.initPassword = response.msg;
this.initPassword = response.data.msg;
});
},
methods: {
@ -470,8 +470,8 @@ export default {
getList() {
this.loading = true;
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.userList = response.rows;
this.total = response.total;
this.userList = response.data.rows;
this.total = response.data.total;
this.loading = false;
}
);
@ -562,8 +562,8 @@ export default {
handleAdd() {
this.reset();
getUser().then(response => {
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.postOptions = response.data.posts;
this.roleOptions = response.data.roles;
this.open = true;
this.title = "添加用户";
this.form.password = this.initPassword;
@ -574,11 +574,11 @@ export default {
this.reset();
const userId = row.userId || this.ids;
getUser(userId).then(response => {
this.form = response.data;
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.$set(this.form, "postIds", response.postIds);
this.$set(this.form, "roleIds", response.roleIds);
this.form = response.data.sysUser;
this.postOptions = response.data.posts;
this.roleOptions = response.data.roles;
this.$set(this.form, "postIds", response.data.postIds);
this.$set(this.form, "roleIds", response.data.roleIds);
this.open = true;
this.title = "修改用户";
this.form.password = "";
@ -658,7 +658,7 @@ export default {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.data.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
//
@ -667,4 +667,4 @@ export default {
}
}
};
</script>
</script>

View File

@ -81,9 +81,9 @@ export default {
methods: {
getUser() {
getUserProfile().then(response => {
this.user = response.data;
this.roleGroup = response.roleGroup;
this.postGroup = response.postGroup;
this.user = response.data.sysUser;
this.roleGroup = response.data.roleGroup;
this.postGroup = response.data.postGroup;
});
}
}

View File

@ -135,7 +135,7 @@ export default {
formData.append("avatarfile", data);
uploadAvatar(formData).then(response => {
this.open = false;
this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
this.options.img = process.env.VUE_APP_BASE_API + response.data.imgUrl;
store.commit('SET_AVATAR', this.options.img);
this.$modal.msgSuccess("修改成功");
this.visible = false;

View File

@ -183,7 +183,7 @@ export default {
const basicForm = this.$refs.basicInfo.$refs.basicInfoForm;
const genForm = this.$refs.genInfo.$refs.genInfoForm;
Promise.all([basicForm, genForm].map(this.getFormPromise)).then(res => {
const validateResult = res.every(item => !!item);
const validateResult = res.data.every(item => !!item);
if (validateResult) {
const genTable = Object.assign({}, basicForm.model, genForm.model);
genTable.columns = this.columns;
@ -194,8 +194,8 @@ export default {
parentMenuId: genTable.parentMenuId
};
updateGenTable(genTable).then(res => {
this.$modal.msgSuccess(res.msg);
if (res.code === 200) {
this.$modal.msgSuccess(res.data.msg);
if (res.data.code === 200) {
this.close();
}
});

View File

@ -85,8 +85,8 @@ export default {
getList() {
listDbTable(this.queryParams).then(res => {
if (res.code === 200) {
this.dbTableList = res.rows;
this.total = res.total;
this.dbTableList = res.data.rows;
this.total = res.data.total;
}
});
},

View File

@ -244,8 +244,8 @@ export default {
getList() {
this.loading = true;
listTable(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.tableList = response.rows;
this.total = response.total;
this.tableList = response.data.rows;
this.total = response.data.total;
this.loading = false;
}
);