1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

后台管理修改密码

This commit is contained in:
程序员小墨 2023-04-24 22:45:57 +08:00
parent 9a8f3d050c
commit d3fb7827f1
3 changed files with 167 additions and 167 deletions

View File

@ -29,7 +29,6 @@ export function getOrderDetail(params) {
* @returns
*/
export function deliverOrder(params) {
console.log("params", params)
return send_request({
url: '/shop/order/manage/deliverOrder',
method: 'POST',

View File

@ -24,6 +24,24 @@ export function userLogout() {
return null;
};
/**
* 修改密码
* @returns
*/
export function updatePwd({ oldpwd, newpwd }) {
let userId = localStorage.getItem("ms_user_id")
return send_request({
url: '/user/updatePwd',
method: 'POST',
useQS: true,
params: {
"userId": userId,
"oldpwd": oldpwd,
"newpwd": newpwd,
},
});
};
/**
* 获取用户列表
* @returns

View File

@ -16,7 +16,6 @@
</span>
</div>
<div class="info-name">{{ name }}</div>
<!-- <div class="info-desc">不可能我的代码怎么可能会有bug</div> -->
</div>
</el-card>
</el-col>
@ -38,9 +37,6 @@
<el-form-item label="确认密码:">
<el-input type="password" v-model="form.new1"></el-input>
</el-form-item>
<!-- <el-form-item label="个人简介:">
<el-input v-model="form.desc"></el-input>
</el-form-item> -->
<el-form-item>
<el-button type="primary" @click="onSubmit">保存</el-button>
</el-form-item>
@ -70,7 +66,7 @@ import VueCropper from 'vue-cropperjs';
import 'cropperjs/dist/cropper.css';
import avatar from '../assets/img/img.jpg';
import { ElMessage, ElMessageBox, ElLoading } from 'element-plus';
import send_request from '../utils/send_request';
import * as userApi from '../api/user';
const name = localStorage.getItem('ms_username');
const user_id = localStorage.getItem('ms_user_id');
@ -104,29 +100,16 @@ const onSubmit = async () => {
ElMessageBox.confirm('确认要修改密码吗?', '提示', {
type: 'warning'
}).then(async () => {
userApi.updatePwd({
oldpwd: form.old,
newpwd: form.new,
}).then((data) => {
data && ElMessage.success(data);
})
.then(async () => {
console.log("send_request v1/user/alterPSW")
const loading = ElLoading.service({
lock: true,
text: '请稍候',
background: 'rgba(0, 0, 0, 0.7)',
});
// await send_request('v1/user/alterPSW', "POST", {
// "userId": form.user_id,
// "oldPSW": form.old,
// "newPSW": form.new
// }, (data: any) => {
// console.log(data);
// ElMessage.success('');
// // tableData.value.splice(index, 1);
// })
loading.close();
})
.catch(() => {
}).catch((err) => {
ElMessage.success('删除失败');
console.log("err", err)
});
return;