产品库工程目录调整
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<b v-for="app in apps" :key="app.key" @tap="redirectTo(app.path)">{{ app.name }}</b>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
</template>0
|
||||
|
||||
<script>
|
||||
import {mapActions, mapState} from 'vuex'
|
||||
@@ -22,14 +22,15 @@ export default {
|
||||
components: {UTag, AiResult},
|
||||
inject: ['root'],
|
||||
computed: {
|
||||
...mapState(['token', 'apps', 'openUser', 'user']),
|
||||
...mapState(['token', 'openUser', 'user']),
|
||||
currentApp() {
|
||||
return this.apps.find(e => e.key == this.$route.query.app) || {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
result: {}
|
||||
result: {},
|
||||
apps: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -38,16 +39,30 @@ export default {
|
||||
let {query, hash} = this.$route
|
||||
delete query.app
|
||||
uni.navigateTo({
|
||||
url: `/pages${path}`, success: () => {
|
||||
url: `/apps${path}`, success: () => {
|
||||
this.$router.push({query, hash})
|
||||
},
|
||||
fail: err => {
|
||||
console.error(err)
|
||||
}
|
||||
})
|
||||
},
|
||||
handleLogin() {
|
||||
uni.navigateTo({url: "./login"})
|
||||
},
|
||||
getApps() {
|
||||
this.apps = []
|
||||
let applications = require.context('../apps', true, /\.(\/.+)\/App[^\/]+\.vue$/)
|
||||
applications.keys().map(path => {
|
||||
if (applications(path).default) {
|
||||
let {name: key, appName: name} = applications(path).default
|
||||
this.apps.push({key, name, path: path.replace(/^\.(.+).vue$/g, '$1')})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getApps()
|
||||
this.result = {
|
||||
tips: "欢迎进入开发应用",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user