产品库开发环境已调整好
This commit is contained in:
@@ -4,14 +4,11 @@
|
||||
<!-- <div class="iconfont iconfont-iconjuminxinxi"/>-->
|
||||
<!-- <div class="iconfont iconfont-iconLogo"/>-->
|
||||
<ai-result v-if="result.tips" v-bind="result"/>
|
||||
<template v-if="isDev">
|
||||
<input v-if="!!$route.query.code" class="codeText" :value="$route.query.code"/>
|
||||
<div class="codeBtn" @click="devGetCode">获取code</div>
|
||||
<div flex class="appsPane wrap">
|
||||
<b v-for="app in apps" :key="app.key" @tap="gotoApp(app.key)">{{ app.name }}</b>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<input v-if="!!$route.query.code" class="codeText" :value="$route.query.code"/>
|
||||
<div class="codeBtn" @click="handleLogin">去登录</div>
|
||||
<div flex class="appsPane wrap">
|
||||
<b v-for="app in apps" :key="app.key" @tap="redirectTo(app.path)">{{ app.name }}</b>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@@ -28,9 +25,6 @@ export default {
|
||||
...mapState(['token', 'apps', 'openUser', 'user']),
|
||||
currentApp() {
|
||||
return this.apps.find(e => e.key == this.$route.query.app) || {}
|
||||
},
|
||||
isDev() {
|
||||
return this.$route.hash == "#dev"
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -40,49 +34,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['getToken', 'getAccount', 'agentSign', 'getUserInfo', 'getCode', 'closeAgent']),
|
||||
initAccess() {
|
||||
if (this.$route.hash == "#error" || this.isDev) {
|
||||
return Promise.resolve()
|
||||
} else if (this.$route.hash == "#form") {
|
||||
if (this.openUser?.openId || !!this.$route.query.preview) {
|
||||
this.openForm()
|
||||
} else if (this.$route.query?.code) {
|
||||
this.getToken(this.$route.query?.code)
|
||||
.then(() => this.getUserInfo())
|
||||
.then(() => this.openForm())
|
||||
} else this.getCode(location.href)
|
||||
} else if (this.token) {//获取账号信息
|
||||
return this.getAccount()
|
||||
} else if (this.$route.query?.code) {//获取token
|
||||
return this.getToken(this.$route.query?.code)
|
||||
} else {//获取应用配置
|
||||
this.getCode(location.href)
|
||||
}
|
||||
},
|
||||
openForm() {
|
||||
this.redirectTo("/askForm/askForm")
|
||||
},
|
||||
redirectTo(path) {
|
||||
let {query, hash} = this.$route
|
||||
delete query.app
|
||||
uni.redirectTo({
|
||||
uni.navigateTo({
|
||||
url: `/pages${path}`, success: () => {
|
||||
this.$router.push({query, hash})
|
||||
}
|
||||
})
|
||||
},
|
||||
gotoApp(app) {
|
||||
uni.reLaunch({url: '/pages/loading?app=' + app})
|
||||
},
|
||||
devGetCode() {
|
||||
this.getCode(location.origin + '/pages/loading#dev')
|
||||
handleLogin() {
|
||||
uni.navigateTo({url: "./login"})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
uni.showLoading({
|
||||
title: "加载中"
|
||||
})
|
||||
uni.hideLoading()
|
||||
this.result = {
|
||||
tips: "欢迎进入开发应用",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user