-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(utils): 新增 getWechatPublicAccountQrcodeUrl
- Loading branch information
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { getWechatPublicAccountQrcodeUrl } from './getWechatPublicAccountQrcodeUrl' | ||
|
||
describe('getWechatPublicAccountQrcodeUrl', () => { | ||
test('表现正常', () => { | ||
expect(getWechatPublicAccountQrcodeUrl('rmrbwx')).toBe( | ||
'https://open.weixin.qq.com/qr/code?username=rmrbwx', | ||
) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* 获取微信公众号的二维码链接。 | ||
* | ||
* @param accountId 公众号 ID | ||
* @returns 返回二维码链接 | ||
* @example | ||
* ```typescript | ||
* getWechatPublicAccountQrcodeUrl('rmrbwx') | ||
* // => https://open.weixin.qq.com/qr/code?username=rmrbwx | ||
* ``` | ||
*/ | ||
export function getWechatPublicAccountQrcodeUrl(accountId: string): string { | ||
return `https://open.weixin.qq.com/qr/code?username=${accountId}` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters