fix: add wx-login check
This commit is contained in:
@@ -24,10 +24,10 @@ export type WxToken = {
|
||||
* @param code
|
||||
* @returns
|
||||
*/
|
||||
export const fetchToken = async (code: string): Promise<WxToken> => {
|
||||
export const fetchToken = async (code: string, type: 'open' | 'mp' = 'open'): Promise<WxToken> => {
|
||||
let appId = config.wxOpen.appId;
|
||||
let appSecret = config.wxOpen.appSecret;
|
||||
if (!appId && !appSecret) {
|
||||
if (type === 'mp') {
|
||||
appId = config.wx.appId;
|
||||
appSecret = config.wx.appSecret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user