feat: 合并Gin_Vue

This commit is contained in:
TsMask
2023-10-16 17:12:24 +08:00
parent 771320a839
commit 743568861d
77 changed files with 734 additions and 1870 deletions

View File

@@ -7,6 +7,7 @@ import { updateUserProfile, uploadAvatar } from '@/api/profile';
import { regExpEmail, regExpMobile, regExpNick } from '@/utils/regular-utils';
import useUserStore from '@/store/modules/user';
import useDictStore from '@/store/modules/dict';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
const uerStore = useUserStore();
const { getDict } = useDictStore();
@@ -49,7 +50,7 @@ function fnFinish() {
updateUserProfile(form).then(res => {
hide();
stateForm.formClick = false;
if (res.code === 200) {
if (res.code === RESULT_CODE_SUCCESS) {
Modal.success({
title: '提示',
content: `用户基本信息修改成功!`,
@@ -97,7 +98,7 @@ function fnUpload(up: UploadRequestOption) {
uploadAvatar(formData).then(res => {
upState.value = false;
hide();
if (res.code === 200) {
if (res.code === RESULT_CODE_SUCCESS) {
message.success('头像上传/变更成功', 3);
uerStore.setAvatar(res.data);
} else {

View File

@@ -5,6 +5,7 @@ import { updateUserPwd } from '@/api/profile';
import { regExpPasswd } from '@/utils/regular-utils';
import useUserStore from '@/store/modules/user';
import { useRouter } from 'vue-router';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
const { userName, fnLogOut } = useUserStore();
const router = useRouter();
@@ -48,8 +49,7 @@ function fnFinish() {
const hide = message.loading('请稍等...', 0);
updateUserPwd(state.form.oldPassword, state.form.confirmPassword)
.then(res => {
hide();
if (res.code === 200) {
if (res.code === RESULT_CODE_SUCCESS) {
Modal.success({
title: '提示',
content: `恭喜您,${userName} 账号密码修改成功!`,
@@ -63,6 +63,7 @@ function fnFinish() {
}
})
.finally(() => {
hide();
state.formClick = false;
});
},