添加小程序授权登录,修改appid
Some checks are pending
Auto Merge Main to Other Branches / Merge main into i18n (push) Waiting to run
Auto Merge Main to Other Branches / Merge main into base-sard-ui (push) Waiting to run

This commit is contained in:
lewis 2025-08-30 17:12:04 +08:00
parent 527cf837fc
commit d31059a2cf
5 changed files with 22 additions and 10 deletions

2
env/.env vendored
View File

@ -2,7 +2,7 @@ VITE_APP_TITLE = 'unibest'
VITE_APP_PORT = 9000
VITE_UNI_APPID = '__UNI__D1E5001'
VITE_WX_APPID = 'wxe2428e8fe6767e45'
VITE_WX_APPID = 'wxdee751952c8c2027'
# h5部署网站的base配置到 manifest.config.ts 里的 h5.router.base
VITE_APP_PUBLIC_BASE=/

View File

@ -1,4 +1,10 @@
import type { ICaptcha, IUpdateInfo, IUpdatePassword, IUserInfoVo, IUserLogin } from './login.typings'
import type {
ICaptcha,
IUpdateInfo,
IUpdatePassword,
IUserInfoVo,
IUserLogin,
} from './login.typings'
import { http } from '@/utils/http'
/**
@ -63,8 +69,8 @@ export function getWxCode() {
return new Promise<UniApp.LoginRes>((resolve, reject) => {
uni.login({
provider: 'weixin',
success: res => resolve(res),
fail: err => reject(new Error(err)),
success: (res) => resolve(res),
fail: (err) => reject(new Error(err)),
})
})
}
@ -81,3 +87,7 @@ export function getWxCode() {
export function wxLogin(data: { code: string }) {
return http.post<IUserLogin>('/user/wxLogin', data)
}
export function routineLoginApi(data: { code: string }) {
return http.post('/api/auth/routineLogin', data)
}

View File

@ -83,7 +83,7 @@
},
"quickapp": {},
"mp-weixin": {
"appid": "wxe2428e8fe6767e45",
"appid": "wxdee751952c8c2027",
"setting": {
"urlCheck": false,
"es6": true,

View File

@ -101,7 +101,7 @@
<view
class="p-1"
style="display: inline-block; width: 300rpx"
@click="goToShop('https://shop.lihaink.cn/')"
@click="goToShop()"
v-for="item in product_30.list"
>
<wd-card custom-class="card-content">
@ -426,7 +426,7 @@
<script lang="ts" setup>
// import { toLogin } from '@/libs/login.js'
import { getProductAPI } from '@/service/crmeb/product'
import { getProductAPI } from '@/service/crmeb/product.ts'
onLoad(() => {
getProduct(30)
@ -478,9 +478,10 @@ function more() {
}
function goToShop() {
// if (this.isLogin) {
let urls = 'https://shop.lihaink.cn/'
const target = encodeURIComponent('/pages/goods_cate/goods_cate')
let urls = 'https://test.shop.lihaink.cn/pages/user/login'
uni.navigateTo({
url: `/pages/web_view/index?local_url=${urls}&title=区域特产`,
url: `/pages/web_view/index?local_url=${urls}&title=区域特产&target=${target}`,
})
// } else {
// this.openAuto()

View File

@ -44,7 +44,8 @@ export default defineComponent({
},
},
onLoad(option) {
this.local_url = decodeURIComponent(getUrlCrmeb() + option.local_url)
// this.local_url = decodeURIComponent(getUrlCrmeb() + option.local_url)
this.local_url = option.local_url + '?target=' + option.target
this.title = option.title || ''
uni.setNavigationBarTitle({
title: this.title, //