个人信息接口替换

pull/13/head
落日晚风 2023-11-03 18:04:17 +08:00
parent f4c1b30f2e
commit cfa35b2c6f
3 changed files with 15 additions and 4 deletions

View File

@ -1,16 +1,26 @@
import request from '@/sheep/request';
import request2 from '@/sheep/request2';
import $platform from '@/sheep/platform';
export default {
profile: () =>
request({
url: '/user/api/user/profile',
request2({
url: 'member/user/get',
method: 'GET',
custom: {
showLoading: false,
auth: true,
},
}),
// profile: () =>
// request({
// url: '/user/api/user/profile',
// method: 'GET',
// custom: {
// showLoading: false,
// auth: true,
// },
// }),
update: (data) =>
request({
url: '/user/api/user/update',

View File

@ -62,6 +62,7 @@
//
const userInfo = computed(() => sheep.$store('user').userInfo);
console.log(userInfo)
//
const isLogin = computed(() => sheep.$store('user').isLogin);

View File

@ -44,8 +44,8 @@ const user = defineStore({
actions: {
// 获取个人信息
async getInfo() {
const { error, data } = await userApi.profile();
if (error !== 0) return;
const { code, data } = await userApi.profile();
if (code !== 0) return;
this.userInfo = data;
return Promise.resolve(data);