feat:增加 area 地区
This commit is contained in:
24
apps/web-antd/src/api/system/area/index.ts
Normal file
24
apps/web-antd/src/api/system/area/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace SystemAreaApi {
|
||||
/** 地区信息 */
|
||||
export interface SystemArea {
|
||||
id?: number;
|
||||
name: string;
|
||||
code: string;
|
||||
parentId?: number;
|
||||
sort?: number;
|
||||
status?: number;
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得地区树 */
|
||||
export function getAreaTree() {
|
||||
return requestClient.get<SystemAreaApi.SystemArea[]>('/system/area/tree');
|
||||
}
|
||||
|
||||
/** 获得 IP 对应的地区名 */
|
||||
export function getAreaByIp(ip: string) {
|
||||
return requestClient.get<string>(`/system/area/get-by-ip?ip=${ip}`);
|
||||
}
|
||||
Reference in New Issue
Block a user