Skip to content

Commit

Permalink
fix:增加 抖音 原生 sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
dongfengtao committed Mar 14, 2024
1 parent 1d0cfdb commit 180d814
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 5 deletions.
99 changes: 99 additions & 0 deletions examples/miniapp-tt/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions examples/miniapp-tt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"author": "",
"license": "",
"devDependencies": {
"@authing/miniapp-jsencrypt": "^5.1.8",
"@authing/miniapp-sm2encrypt": "^5.1.8",
"@authing/miniapp-tt": "^5.1.16-alpha.3",
"@douyin-microapp/typings": "latest"
}
}
22 changes: 21 additions & 1 deletion examples/miniapp-tt/pages/index/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
const app = getApp()
// index.ts
import { Authing } from '@authing/miniapp-tt'

// // 按需使用,加密密码
// // import { encryptFunction } from '@authing/miniapp-jsencrypt'

// import { encryptFunction } from '@authing/miniapp-sm2encrypt'
// const AUTHING_EXT_IDP_CONN_IDENTIFIER = "douyin-mini2"

// const APP_SECRET = '04093a8d20472bc1ea7d2207d69751ca99895d82';
// const APP_ID = 'ttcad4bc6955e5062401';
// const authing = new Authing({
// appId: '65e817bc434b729d058140a0',
// host: 'https://minnappauthing.why.lixpng.top',
// userPoolId: '6321a29180d12ab3a3e35306',
// encryptFunction
// })

// const app = getApp()

// console.log(Authing,'AuthingAuthingdfft')

Page({
data: {
Expand Down
36 changes: 35 additions & 1 deletion examples/miniapp-tt/pages/index/index.ttml
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
<view class="intro">Welcome to Mini Program</view>
<button bindtap="loginByCode">loginByCode</button>
<button open-type="getPhoneNumber" bindgetphonenumber="loginByPhone">loginByPhone</button>
<button open-type="getPhoneNumber" bindgetphonenumber="getPhone">getPhone</button>
<button bindtap="loginByPassword">loginByPassword</button>

<!-- 发送手机短信验证码 -->
<button bindtap="sendSms">sendSms</button>
<button bindtap="bindPhone">bindPhone</button>
<button bindtap="updatePhone">updatePhone</button>
<!-- 使用手机短信验证码登录 -->
<button bindtap="loginByPassCode">loginByPassCode</button>
<!-- 发送邮箱验证码 -->
<button bindtap="sendEmailCode">sendEmailCode</button>
<!-- 绑定邮箱 -->
<button bindtap="bindEmail">bindEmail</button>
<!-- 修改邮箱 -->
<button bindtap="updateEmail">updateEmail</button>
<button bindtap="deleteAccount">deleteAccount</button>

<!-- 解密数据 -->
<button bindtap="decryptData">decryptData</button>


<button bindtap="refreshToken">refreshToken</button>
<button bindtap="updatePassword">updatePassword</button>
<button bindtap="getUserInfo">getUserInfo</button>
<button bindtap="updateAvatar">updateAvatar</button>
<button bindtap="updateUserInfo">updateUserInfo</button>

<button bindtap="logout">logout</button>

<button bindtap="getLoginState">getLoginState</button>
<button bindtap="clearLoginState">clearLoginState</button>

<button bindtap="getShareInfo">getShareInfo</button>
20 changes: 19 additions & 1 deletion examples/miniapp-tt/project.config.json
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
{"setting":{"urlCheck":true,"es6":true,"postcss":true,"minified":true,"newFeature":true,"autoCompile":true,"compileHotReLoad":true,"nativeCompile":true,"useCompilerPlugins":["typescript"]},"appid":"ttcad4bc6955e5062401","projectname":"miniapp-tt","douyinProjectType":"native"}
{
"setting": {
"urlCheck": true,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true,
"autoCompile": true,
"compileHotReLoad": true,
"nativeCompile": true,
"useCompilerPlugins": ["typescript"]
},
"packOptions": {
"npm": true
},
"appid": "ttcad4bc6955e5062401",
"projectname": "miniapp-tt",
"douyinProjectType": "native"
}
2 changes: 1 addition & 1 deletion packages/miniapp/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

// development mode:
// npm run dev modes=wx,ali,.....
// npm run dev modes=wx,Taro,uni,tt.....

// production mode:
// npm run prod modes=wx,ali,baidu,tt......
Expand Down
2 changes: 1 addition & 1 deletion scripts/transfer-miniapp-libs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const resolve = (dir, file = '') =>{
return path.resolve(__dirname, '../', dir, file)
}

const platforms = ['taro', 'uni', 'wx']
const platforms = ['taro', 'uni', 'wx', 'tt']

readyGo()

Expand Down

0 comments on commit 180d814

Please sign in to comment.