添加小程序授权登录,修改appid
This commit is contained in:
parent
527cf837fc
commit
d31059a2cf
2
env/.env
vendored
2
env/.env
vendored
@ -2,7 +2,7 @@ VITE_APP_TITLE = 'unibest'
|
|||||||
VITE_APP_PORT = 9000
|
VITE_APP_PORT = 9000
|
||||||
|
|
||||||
VITE_UNI_APPID = '__UNI__D1E5001'
|
VITE_UNI_APPID = '__UNI__D1E5001'
|
||||||
VITE_WX_APPID = 'wxe2428e8fe6767e45'
|
VITE_WX_APPID = 'wxdee751952c8c2027'
|
||||||
|
|
||||||
# h5部署网站的base,配置到 manifest.config.ts 里的 h5.router.base
|
# h5部署网站的base,配置到 manifest.config.ts 里的 h5.router.base
|
||||||
VITE_APP_PUBLIC_BASE=/
|
VITE_APP_PUBLIC_BASE=/
|
||||||
|
@ -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'
|
import { http } from '@/utils/http'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -63,8 +69,8 @@ export function getWxCode() {
|
|||||||
return new Promise<UniApp.LoginRes>((resolve, reject) => {
|
return new Promise<UniApp.LoginRes>((resolve, reject) => {
|
||||||
uni.login({
|
uni.login({
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
success: res => resolve(res),
|
success: (res) => resolve(res),
|
||||||
fail: err => reject(new Error(err)),
|
fail: (err) => reject(new Error(err)),
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -81,3 +87,7 @@ export function getWxCode() {
|
|||||||
export function wxLogin(data: { code: string }) {
|
export function wxLogin(data: { code: string }) {
|
||||||
return http.post<IUserLogin>('/user/wxLogin', data)
|
return http.post<IUserLogin>('/user/wxLogin', data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function routineLoginApi(data: { code: string }) {
|
||||||
|
return http.post('/api/auth/routineLogin', data)
|
||||||
|
}
|
||||||
|
@ -83,7 +83,7 @@
|
|||||||
},
|
},
|
||||||
"quickapp": {},
|
"quickapp": {},
|
||||||
"mp-weixin": {
|
"mp-weixin": {
|
||||||
"appid": "wxe2428e8fe6767e45",
|
"appid": "wxdee751952c8c2027",
|
||||||
"setting": {
|
"setting": {
|
||||||
"urlCheck": false,
|
"urlCheck": false,
|
||||||
"es6": true,
|
"es6": true,
|
||||||
|
@ -101,7 +101,7 @@
|
|||||||
<view
|
<view
|
||||||
class="p-1"
|
class="p-1"
|
||||||
style="display: inline-block; width: 300rpx"
|
style="display: inline-block; width: 300rpx"
|
||||||
@click="goToShop('https://shop.lihaink.cn/')"
|
@click="goToShop()"
|
||||||
v-for="item in product_30.list"
|
v-for="item in product_30.list"
|
||||||
>
|
>
|
||||||
<wd-card custom-class="card-content">
|
<wd-card custom-class="card-content">
|
||||||
@ -426,7 +426,7 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
// import { toLogin } from '@/libs/login.js'
|
// import { toLogin } from '@/libs/login.js'
|
||||||
import { getProductAPI } from '@/service/crmeb/product'
|
import { getProductAPI } from '@/service/crmeb/product.ts'
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
getProduct(30)
|
getProduct(30)
|
||||||
@ -478,9 +478,10 @@ function more() {
|
|||||||
}
|
}
|
||||||
function goToShop() {
|
function goToShop() {
|
||||||
// if (this.isLogin) {
|
// 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({
|
uni.navigateTo({
|
||||||
url: `/pages/web_view/index?local_url=${urls}&title=区域特产`,
|
url: `/pages/web_view/index?local_url=${urls}&title=区域特产&target=${target}`,
|
||||||
})
|
})
|
||||||
// } else {
|
// } else {
|
||||||
// this.openAuto()
|
// this.openAuto()
|
||||||
|
@ -44,7 +44,8 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
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 || ''
|
this.title = option.title || ''
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: this.title, // 运行时修改标题
|
title: this.title, // 运行时修改标题
|
||||||
|
Loading…
x
Reference in New Issue
Block a user