Skip to content

Commit

Permalink
support client credentials & password mode
Browse files Browse the repository at this point in the history
  • Loading branch information
freedomkk-qfeng committed Jul 15, 2023
1 parent d99a9be commit 502b73f
Show file tree
Hide file tree
Showing 5 changed files with 321 additions and 378 deletions.
14 changes: 13 additions & 1 deletion front-standalone/src/api/playground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type Result = {
}
}

/** authorization_code */
/** Step 2 */
/** Get access_token with code */
export const fetchACToken = (data) => {
Expand All @@ -26,4 +27,15 @@ export const fetchRefreshToken = (data) => {
/** Get data from API */
export const fetchApiData = (data) => {
return http.post<Result>("/api", data);
}
}


/** Client Credentials */
export const fetchACTokenByClient = (data) => {
return http.post<Result>("/oauth2/client_credentials", data);
};

/** Password */
export const fetchACTokenByPassword = (data) => {
return http.post<Result>("/oauth2/password", data);
};
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const responseInfo = reactive({
});
const rawJsonInfo = reactive({});
const exampleInfo = reactive({});
const isWrapReq = ref(true);//控制body是否自动换行
const isWrapRes = ref(true);//控制body是否自动换行
function updateReqAndRes() {
Expand Down

0 comments on commit 502b73f

Please sign in to comment.