提交 993460c6 authored 作者: lihuihui's avatar lihuihui

修改密码更换头像

上级 974691aa
......@@ -22,4 +22,8 @@ export default class OtherAction extends BaseACTION {
* 文件上传
*/
uploadFile (obj) { return Other.uploadFile(obj).then(res => res) }
/**
* 调用个人信心 - 修改密码
*/
updatePwd (obj) { return Other.updatePwd(obj).then(res => res) }
}
......@@ -38,6 +38,7 @@ const cAction = {
* @param {[function]} obj.finallyCallback 最终finally回调,必传
*/
export const request = (obj) => {
console.log(obj, '===========')
cAction[obj.actionName][obj.functionName](obj.data).then(res => {
obj.thenCallback(res)
}).catch(e => {
......
import BaseAPI from './base_api'
import _ from 'lodash'
export default class OtherAPI extends BaseAPI {
/**
......@@ -10,4 +11,11 @@ export default class OtherAPI extends BaseAPI {
* @param {[object]} obj
*/
uploadFile = (obj = {}) => this.post('/util/upload-file', obj, { headers: { 'Content-Type': 'multipart/form-data' } })
/**
* 个人信息 - 修改密码
* @param {[string]} obj.old_password 验证码
* @param {[string]} obj.new_password 新的密码
* @param {[string]} obj.service 这里 一直是定值 h5.ezijing.com
*/
updatePwd = (obj = {}) => this.post('/user_center/change_password', _.assignIn(obj, { service: 'h5.ezijing.com' }), { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
}
......@@ -27,6 +27,7 @@
<script>
import { request } from '@action'
import md5 from 'js-md5'
export default {
components: { },
......@@ -65,10 +66,10 @@ export default {
if (valid) {
request({
component: this,
actionName: 'loginAction',
actionName: 'Other',
functionName: 'updatePwd',
data: {
old_password: Md5('uokoaduw' + this.accountSetPwd.oldPwd.split('').reverse().join('') + 'auhgniq'),
old_password: md5('uokoaduw' + this.accountSetPwd.oldPwd.split('').reverse().join('') + 'auhgniq'),
new_password: this.accountSetPwd.newPwdAgain
},
thenCallback: data => {
......
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"js-cookie": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-2.2.1.tgz",
"integrity": "sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ=="
},
"js-md5": {
"version": "0.7.3",
"resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz",
"integrity": "sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ=="
}
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论