parent
9aef056550
commit
b68839128f
|
|
@ -245,6 +245,7 @@ import wechatOa, { UrlScene } from '@/utils/wechat'
|
||||||
// #endif
|
// #endif
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||||
import { computed, reactive, ref, shallowRef, watch } from 'vue'
|
import { computed, reactive, ref, shallowRef, watch } from 'vue'
|
||||||
|
import { storeToRefs } from 'pinia'
|
||||||
|
|
||||||
enum LoginWayEnum {
|
enum LoginWayEnum {
|
||||||
ACCOUNT = 1,
|
ACCOUNT = 1,
|
||||||
|
|
@ -258,7 +259,8 @@ isWeixin.value = isWeixinClient()
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
const { userInfo, isLogin } = storeToRefs(userStore)
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const showModel = ref(false)
|
const showModel = ref(false)
|
||||||
const uCodeRef = shallowRef()
|
const uCodeRef = shallowRef()
|
||||||
|
|
@ -329,7 +331,8 @@ const loginFun = async () => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
uni.$u.toast(error)
|
uni.$u.toast(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const loginHandle = async (data: any) => {
|
const loginHandle = async (data: any) => {
|
||||||
const { token, mobile } = data
|
const { token, mobile } = data
|
||||||
|
|
@ -467,7 +470,6 @@ onLoad(async () => {
|
||||||
const data = await oaLogin(options)
|
const data = await oaLogin(options)
|
||||||
if (data) {
|
if (data) {
|
||||||
loginData.value = data
|
loginData.value = data
|
||||||
|
|
||||||
loginHandle(loginData.value)
|
loginHandle(loginData.value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -479,7 +481,10 @@ onLoad(async () => {
|
||||||
wechatOa.setAuthData()
|
wechatOa.setAuthData()
|
||||||
}
|
}
|
||||||
//#endif
|
//#endif
|
||||||
})
|
})
|
||||||
|
if (isLogin.value == true) {
|
||||||
|
window.location.href = '/mobile/pages/user/user'
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@
|
||||||
uni.setNavigationBarColor({
|
uni.setNavigationBarColor({
|
||||||
frontColor: '#000000',
|
frontColor: '#000000',
|
||||||
})
|
})
|
||||||
console.log(123123)
|
|
||||||
}
|
}
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const { userInfo, isLogin } = storeToRefs(userStore)
|
const { userInfo, isLogin } = storeToRefs(userStore)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue