diff --git a/api/member.js b/api/member.js new file mode 100644 index 0000000..257801c --- /dev/null +++ b/api/member.js @@ -0,0 +1,46 @@ +import util from '../common/util.js' + +/*export const getUserInfo = (data = {}) => { + return util.request( + '/api/my/userInfo', + (res) => { + console.log('用户信息请求成功:', res); + }, + {data}, + + (err) => { + console.log('用户信息请求失败:', err); + } + ); +}; +*/ + +import { http } from '../utils/http' + + +/** + * 用户信息获取接口 + * @param data + * @returns {Promise} + */ +export const getUserInfo = (data) => { + return http({ + method: 'POST', + url: '/api/my/userInfo', + data: + data + , + }) +} + + + + + + + + + + + + diff --git a/api/setting/general.js b/api/setting/general.js new file mode 100644 index 0000000..ea0a395 --- /dev/null +++ b/api/setting/general.js @@ -0,0 +1,13 @@ +import { http } from '../utils/http' + + + +export const getSetting = (data) => { + return http({ + method: 'POST', + url: '/api/my/getSetting', + data: + data + , + }) +} diff --git a/api/setting/nextPwd.js b/api/setting/nextPwd.js new file mode 100644 index 0000000..3508c99 --- /dev/null +++ b/api/setting/nextPwd.js @@ -0,0 +1,16 @@ +import {http} from '../../utils/http' + +/** + * 修改密码 + * @param data + * @returns {*} + */ +export const updatePassword = (data) => { + return http({ + method: 'POST', + url: '/api/my/updatePassword', + data: + data + , + }) +} diff --git a/api/setting/password.js b/api/setting/password.js new file mode 100644 index 0000000..daf81f2 --- /dev/null +++ b/api/setting/password.js @@ -0,0 +1,31 @@ +import {http} from '../../utils/http' + +/** + * 验证码发送 + * @param data + * @returns {*} + */ +export const sendEmail = (data) => { + return http({ + method: 'POST', + url: '/UserLogin/sendEmail', + data: + data + , + }) +} + +/** + * 验证码验证 + * @param data + * @returns {*} + */ +export const validateCode = (data) => { + return http({ + method: 'POST', + url: '/api/my/validateCode', + data: + data + , + }) +} diff --git a/pages/home/member.vue b/pages/home/member.vue index 4805ac3..8de12f4 100644 --- a/pages/home/member.vue +++ b/pages/home/member.vue @@ -1,294 +1,305 @@ \ No newline at end of file diff --git a/pages/setting/account.vue b/pages/setting/account.vue index 5dd5a60..1c1607a 100644 --- a/pages/setting/account.vue +++ b/pages/setting/account.vue @@ -15,21 +15,21 @@ 昵称 - DeepChart + {{userInfoRes.dcname}} ID - {{ jwcode }} + {{ userInfoRes.dccode }} 密码 - qwertyuiop + {{userInfoRes.password}} @@ -71,10 +71,27 @@ ref, onMounted } from 'vue' + import {getUserInfo} from "@/api/member"; const iSMT = ref(0) - const jwcode = ref('90047681') + // const dccode = ref('') + const userInfoRes = ref({}) const showLogout = ref(false) - + + const userInfoPromise = getUserInfo() + userInfoPromise.then(res => { + if (res.code === 200){ + userInfoRes.value.dccode = res.data.dccode; + userInfoRes.value.dcname = res.data.dcname; + userInfoRes.value.password = res.data.password; + console.log('用户信息', res.data) + }else{ + uni.showToast({ + title: '用户信息请求失败', + icon: 'none', + }) + } + + }) const handleConfirmLogout = () => { showLogout.value = false uni.showToast({ diff --git a/pages/setting/general.vue b/pages/setting/general.vue index cbf21c0..a9a5931 100644 --- a/pages/setting/general.vue +++ b/pages/setting/general.vue @@ -1,165 +1,182 @@ \ No newline at end of file diff --git a/pages/setting/nextPwd.vue b/pages/setting/nextPwd.vue index e55d771..7d410d5 100644 --- a/pages/setting/nextPwd.vue +++ b/pages/setting/nextPwd.vue @@ -1,144 +1,175 @@ \ No newline at end of file diff --git a/pages/setting/password.vue b/pages/setting/password.vue index fec980a..6425aec 100644 --- a/pages/setting/password.vue +++ b/pages/setting/password.vue @@ -1,171 +1,207 @@ \ No newline at end of file diff --git a/utils/http.js b/utils/http.js index a446baf..724ebd6 100644 --- a/utils/http.js +++ b/utils/http.js @@ -1,6 +1,7 @@ import { useUserStore } from "../stores/modules/userInfo" -const baseURL = "https://hwjb.homilychart.com/testApi" +// const baseURL = "https://hwjb.homilychart.com/testApi" +const baseURL = "http://192.168.40.8:9000" const httpInterceptor = { @@ -39,8 +40,8 @@ const httpInterceptor = { //4 添加token,优先用store,没有则回退到body中的token,保持与Apifox一致 const memberStore = useUserStore() // const token = memberStore.userInfo?.token || options.data?.token - options.header.token = '790750702588f1ea79f24dc56ccd5d8a' - const token = '790750702588f1ea79f24dc56ccd5d8a' + options.header.token = '1' + const token = '1' if (token) { options.header.token = token }