2025-05-06 22:16:31 +08:00

31 lines
773 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import api from "../interceptor"
/**
* 鉴权签名接口
* @param ctx
*/
export default async function GetAuth(ctx) {
const params = ctx.request.body
// 为了方便存在全局
global.appKey = params.appKey
global.appSecret = params.appSecret
// [只为验证鉴权,可删除]
await api
.post("/v2/app/start", {})
.then(({ data }) => {
// 非文档描述性codesign success
if (data.code === -400) {
ctx.body = {
msg: "auth success",
type: "success",
state: 200
}
} else {
ctx.body = data
}
})
.catch(err => {
ctx.body = err
})
}