系统切换优化

This commit is contained in:
aixianling
2022-01-28 16:49:59 +08:00
parent 208354cb64
commit 9aab400c05
3 changed files with 18 additions and 5 deletions

View File

@@ -6,7 +6,7 @@
<ai-result v-if="result.tips" v-bind="result"/>
<input v-if="!!$route.query.code" class="codeText" :value="$route.query.code"/>
<div class="codeBtn" @click="handleLogin">去登录</div>
<u-radio-group v-model="currentLib" @change="getApps">
<u-radio-group v-model="currentLib" @change="handleSwitchSystem">
<u-radio v-for="(op,i) in libs" :key="i" :name="op.dir">{{ op.label }}</u-radio>
</u-radio-group>
<input class="codeText" v-model="search" placeholder="搜索要查找的应用"/>
@@ -17,7 +17,7 @@
</template>
<script>
import {mapActions, mapState} from 'vuex'
import {mapActions, mapMutations, mapState} from 'vuex'
import AiResult from "../components/AiResult";
import AiSelect from "../components/AiSelect";
@@ -48,6 +48,7 @@ export default {
}
},
methods: {
...mapMutations(['logout']),
...mapActions(['agentSign']),
handleGotoApp(app) {
uni.navigateTo({url: `/${this.currentLib}${app.path}`})
@@ -65,6 +66,12 @@ export default {
this.apps.push({key, name, path: path.replace(/^\.(.+).vue$/g, '$1')})
}
})
},
handleSwitchSystem() {
this.$http.defaults.baseURL = this.currentLib == "apps" ? "/lan" :
this.currentLib == "sass" ? "/saas" : "/"
this.getApps()
this.logout()
}
},
onLoad() {