第一次提交
This commit is contained in:
24
src/api/login/wx-official/index.ts
Normal file
24
src/api/login/wx-official/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
/**
|
||||
* 微信公众号授权登录
|
||||
*/
|
||||
export async function getCode() {
|
||||
const res = await request.get<ApiResult<unknown>>('/wx-official/code');
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信公众号授权登录
|
||||
*/
|
||||
export async function wxOfficialLogin() {
|
||||
const res = await request.get<ApiResult<unknown>>('/wx-official');
|
||||
console.log(res.data);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
Reference in New Issue
Block a user