Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/taro-cli/templates/default/_env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 配置文档参考 https://taro-docs.jd.com/docs/next/env-mode-config
# 复制本文件到 .env.development / .env.production / .env.test 后按环境填写
TARO_APP_ID="请替换为你的小程序 AppID"
2 changes: 2 additions & 0 deletions packages/taro-cli/templates/default/_gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ node_modules/
.DS_Store
.swc
*.local
.env*
!.env.example
3 changes: 3 additions & 0 deletions packages/taro-cli/templates/default/template_creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ const handler = {
'/_env.test' () {
return { setPageName: `/.env.test` }
},
'/_env.example' () {
return { setPageName: `/.env.example` }
},
'/_eslintrc' () {
return { setPageName: `/.eslintrc` }
},
Expand Down
15 changes: 12 additions & 3 deletions packages/taro/types/api/storage/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,20 @@ declare module '../../index' {
/** 本地缓存中指定的 key */
key: string
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
complete?: (res: TaroGeneral.CallbackResult) => void
complete?: (res: SuccessCallbackResult) => void
/** 接口调用失败的回调函数 */
fail?: (res: TaroGeneral.CallbackResult) => void
/** 接口调用成功的回调函数 */
success?: (res: TaroGeneral.CallbackResult) => void
success?: (res: SuccessCallbackResult) => void
}

interface SuccessCallbackResult extends Omit<TaroGeneral.CallbackResult, 'errMsg'> {
/** 调用结果 */
errMsg?: string
/** 是否执行成功
* @supported alipay
*/
success?: boolean
}
}

Expand Down Expand Up @@ -192,7 +201,7 @@ declare module '../../index' {
* ```
* @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.setStorage.html
*/
setStorage(option: setStorage.Option): Promise<TaroGeneral.CallbackResult>
setStorage(option: setStorage.Option): Promise<setStorage.SuccessCallbackResult>

/** 根据 URL 销毁存在内存中的数据
* @supported weapp
Expand Down