| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- import flyio from "../flyio";
- import { ApiCaptchaResponse, ApiResponse, DictItem, ConfigItem } from "@/types";
- import { SmsRequestDTO } from "@/types/user";
- /**
- * 获取配置属性
- * @returns
- */
- export function getConfig() {
- return flyio.get('/front/comm/config') as Promise<ApiResponse<ConfigItem[]>>;
- }
- /**
- * 获取字典数据
- * @param dictTypes 字典类型列表,逗号分隔
- * @returns
- */
- export function getDictData(dictTypes: string) {
- return flyio.get(`/front/comm/dict/${dictTypes}`) as Promise<ApiResponse<Record<string, DictItem[]>>>;
- }
- /**
- * 发送短信验证码, 发送验证码(不验重,验证码,不登陆), 适用于账号登录
- * @param params 包含手机号等参数的对象
- * @returns
- */
- export function sendSmsNoValidationNoToken(params: SmsRequestDTO) {
- // 使用POST方法,参数通过URL查询字符串传递
- return flyio.post('/front/comm/sendSmsNoValidationNoToken', null, { params }) as Promise<ApiResponse<any>>;
- }
- /**
- * 发送短信验证码, 发送验证码(验重,验证码,不登陆), 适用于账号注册
- * @param params 包含手机号等参数的对象
- * @returns
- */
- export function sendSmsNoToken(params: SmsRequestDTO) {
- return flyio.post('/front/comm/sendSmsNoToken', null, { params }) as Promise<ApiResponse<any>>;
- }
- /**
- * 发送短信验证码, 发送验证码(不验重,无验证码,需登陆), 适用于登录后的校验
- * @param params 包含手机号等参数的对象
- * @returns
- */
- export function sendSms(params: SmsRequestDTO) {
- return flyio.post('/front/comm/sendSms', null, { params }) as Promise<ApiResponse<any>>;
- }
- /**
- * 获取省份列表
- * @returns
- */
- export function getProvinces() {
- return flyio.get('/front/user/provinces') as Promise<ApiResponse<DictItem[]>>;
- }
- /**
- * 获取考生类别
- * @returns
- */
- export function getExamTypes(location: string) {
- return flyio.get('/front/user/examTypes', { location }) as Promise<ApiResponse<DictItem[]>>;
- }
- /**
- * 获取专业列表
- * @returns
- */
- export function getExamMajors(location: string, examType: string) {
- return flyio.get('/front/user/examMajors', { location, examType }) as Promise<ApiResponse<DictItem[]>>;
- }
- /**
- * 获取毕业年份列表
- * @returns
- */
- export function getGraduateYears(location: string, examType: string) {
- return flyio.get('/front/user/graduateYears', { location, examType }) as Promise<ApiResponse<DictItem[]>>;
- }
- /**
- * 获取验证码图片
- * @returns
- */
- export function getCaptchaImage() {
- return flyio.get('/captchaImage') as Promise<ApiCaptchaResponse>;
- }
|