修复:用户资料及认证提交页面,需求定制页面
This commit is contained in:
@@ -3,6 +3,7 @@ import type { ApiResult } from '@/api';
|
||||
import type { User } from '@/api/system/user/model';
|
||||
import type { UpdatePasswordParam } from './model';
|
||||
import type {CmsWebsite, CmsWebsiteParam} from "~/api/cms/cmsWebsite/model";
|
||||
import {COMMON_API_URL} from "~/config";
|
||||
|
||||
/**
|
||||
* 获取网站信息
|
||||
@@ -27,7 +28,7 @@ export async function getUserInfo(): Promise<User> {
|
||||
const config = useRuntimeConfig();
|
||||
const res = await request.get<ApiResult<User>>(config.public.apiServer + '/auth/user',{
|
||||
headers: {
|
||||
TenantId: `${localStorage.getItem('TID_ADMIN')}`
|
||||
TenantId: `${localStorage.getItem('ServerTenantId')}`
|
||||
}
|
||||
});
|
||||
if (res.code === 0 && res.data) {
|
||||
@@ -36,6 +37,18 @@ export async function getUserInfo(): Promise<User> {
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
export async function updateUser(data: User){
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
COMMON_API_URL + '/auth/user',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message ?? '修改成功';
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务器时间(实时)
|
||||
* @return
|
||||
|
||||
Reference in New Issue
Block a user