|
|
@@ -63,15 +63,48 @@
|
|
|
const openId = ref('');
|
|
|
|
|
|
// 新增变量
|
|
|
- const fromAppShare = ref(true) // 是否来自APP分享
|
|
|
+ const fromAppShare = ref(false) // 是否来自APP分享
|
|
|
|
|
|
const store = useIsCanBack();
|
|
|
|
|
|
onLoad((options) => {
|
|
|
+ console.log('options.from',options);
|
|
|
+ if(options.from == 'my'){
|
|
|
+ fromAppShare.value = true
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ console.log('1111111111');
|
|
|
if (options.from === 'appcx') {
|
|
|
id.value = options.id
|
|
|
fromPage.value = options.from;
|
|
|
}
|
|
|
+ uni.login().then(res1 => {
|
|
|
+ console.log('res2222222', res1);
|
|
|
+ code.value = res1.code
|
|
|
+ httpApi.loginApplet({
|
|
|
+ code: res1.code,
|
|
|
+ }).then(result => {
|
|
|
+ console.log('result2222', result);
|
|
|
+ openId.value = result.data.openId
|
|
|
+ if (result.data.bind) {
|
|
|
+ // 保存用户信息
|
|
|
+ if (result.data.loginVo.type == 4) {
|
|
|
+ cacheManager.set('auth', result.data.loginVo)
|
|
|
+ store.setIsCanBack(false)
|
|
|
+ gotoPage();
|
|
|
+ } else if (result.data.loginVo.type == 6) {
|
|
|
+ cacheManager.set('auth', result.data.loginVo)
|
|
|
+ store.setIsCanBack(false)
|
|
|
+ gotoPage2();
|
|
|
+ } else {
|
|
|
+ toast('登录失败,您的身份有误,请联系管理员。')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ fromAppShare.value = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
getAllImg();
|
|
|
})
|
|
|
|