|
|
|
@ -137,7 +137,7 @@
|
|
|
|
|
import {imghost} from '@/config/host.js' |
|
|
|
|
import MzSubsection from '@/components/MzSubsection/Index.vue'; |
|
|
|
|
import api from '@/utils/functions.js'; |
|
|
|
|
import {appletLogin, testLogin, userDetail} from "@/api/user"; |
|
|
|
|
import {appletLogin, cloudLogin, testLogin, userDetail} from "@/api/user"; |
|
|
|
|
import {CLOUD_CLIENT_ID, CLOUD_LOGIN_PATH} from "../../config/config"; |
|
|
|
|
import {cloud_host} from "../../config/host"; |
|
|
|
|
|
|
|
|
@ -161,8 +161,21 @@ export default {
|
|
|
|
|
privateStatus:false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
|
|
|
|
|
|
onLoad(params) { |
|
|
|
|
if(params.code){ |
|
|
|
|
cloudLogin({code:params.code}).then(res => { |
|
|
|
|
if(res.code === 200){ |
|
|
|
|
uni.setStorageSync('token',res.data.token); |
|
|
|
|
uni.setStorageSync('user',res.data); |
|
|
|
|
this.$store.commit('userInfo', res.data); |
|
|
|
|
uni.redirectTo({ |
|
|
|
|
url:'/pages/Index/index' |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
uni.$u.toast('登录失败'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
api() { |
|
|
|
@ -225,7 +238,7 @@ export default {
|
|
|
|
|
this.$refs.popup.close(); |
|
|
|
|
}, |
|
|
|
|
peopleCloudLogin(){ |
|
|
|
|
window.location.href = `${cloud_host}/oauth/?client_id=${CLOUD_CLIENT_ID}&response_type=code&redirect_uri=${CLOUD_LOGIN_PATH}&scope=read`; |
|
|
|
|
window.location.href = `${cloud_host}/oauth/authorize?client_id=${CLOUD_CLIENT_ID}&response_type=code&redirect_uri=${CLOUD_LOGIN_PATH}&scope=read`; |
|
|
|
|
// console.log(url) |
|
|
|
|
// uni.redirectTo({ |
|
|
|
|
// url:url |
|
|
|
|