This commit is contained in:
zhanchao 2026-02-08 09:51:56 +08:00
parent 714d478946
commit 1b654215f0
3 changed files with 32 additions and 58 deletions

64
package-lock.json generated
View File

@ -1,34 +1,34 @@
{ {
"name": "ykt-wxapp", "name": "ykt-wxapp",
"version": "1.0.0", "version": "1.0.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "ykt-wxapp", "name": "ykt-wxapp",
"version": "1.0.0", "version": "1.0.0",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"tim-upload-plugin": "^1.4.2", "tim-upload-plugin": "^1.4.2",
"tim-wx-sdk": "^2.27.6" "tim-wx-sdk": "^2.27.6"
}, },
"devDependencies": {} "devDependencies": {}
}, },
"node_modules/dayjs": { "node_modules/dayjs": {
"version": "1.11.19", "version": "1.11.19",
"resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.19.tgz", "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.19.tgz",
"integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==" "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw=="
}, },
"node_modules/tim-upload-plugin": { "node_modules/tim-upload-plugin": {
"version": "1.4.3", "version": "1.4.3",
"resolved": "https://registry.npmmirror.com/tim-upload-plugin/-/tim-upload-plugin-1.4.3.tgz", "resolved": "https://registry.npmmirror.com/tim-upload-plugin/-/tim-upload-plugin-1.4.3.tgz",
"integrity": "sha512-3ZmbA36dr3eG9YGDon9MLBUtbNawYWkL+TBa+VS0Uviguc7PlVSOIVRG2C4irXX16slDT2Kj+HAZapp+Xqp2xg==" "integrity": "sha512-3ZmbA36dr3eG9YGDon9MLBUtbNawYWkL+TBa+VS0Uviguc7PlVSOIVRG2C4irXX16slDT2Kj+HAZapp+Xqp2xg=="
}, },
"node_modules/tim-wx-sdk": { "node_modules/tim-wx-sdk": {
"version": "2.27.6", "version": "2.27.6",
"resolved": "https://registry.npmmirror.com/tim-wx-sdk/-/tim-wx-sdk-2.27.6.tgz", "resolved": "https://registry.npmmirror.com/tim-wx-sdk/-/tim-wx-sdk-2.27.6.tgz",
"integrity": "sha512-zB+eRdmigdhEDeqrXC0bLJonUQZzS5uKNPLFtrje503WAnmuxVQjq/n4Zle4FYHG4FiKHKhsrVd0aCYXABlFEg==" "integrity": "sha512-zB+eRdmigdhEDeqrXC0bLJonUQZzS5uKNPLFtrje503WAnmuxVQjq/n4Zle4FYHG4FiKHKhsrVd0aCYXABlFEg=="
} }
} }
} }

View File

@ -53,12 +53,6 @@
"style": { "style": {
"navigationBarTitleText": "阳性发现" "navigationBarTitleText": "阳性发现"
} }
},
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "授权登录"
}
} }
], ],
"subPackages": [ "subPackages": [

View File

@ -93,26 +93,6 @@ function toMpOauth() {
}); });
} }
function toMpOauth() {
// snsapi_base
// TODO: YOUR_MP_APPID appid
// redirect_uri www.youcan365.com
const MP_APPID = __VITE_ENV__.MP_WX_MP_APP_ID;
const REDIRECT_URI = "https://www.youcan365.com/wx-callback";
const state = `ykt_wxapp_${Date.now()}`;
const oauthUrl =
`https://open.weixin.qq.com/connect/oauth2/authorize` +
`?appid=${MP_APPID}` +
`&redirect_uri=${encodeURIComponent(REDIRECT_URI)}` +
`&response_type=code` +
`&scope=snsapi_base` +
`&state=${encodeURIComponent(state)}` +
`#wechat_redirect`;
uni.navigateTo({
url: `/pages/webview/webview?purpose=mp_oauth&url=${encodeURIComponent(oauthUrl)}`,
});
}
async function getPhoneNumber(e) { async function getPhoneNumber(e) {
console.log('e', e); console.log('e', e);
const phoneCode = e && e.detail && e.detail.code; const phoneCode = e && e.detail && e.detail.code;