整合小程序库
This commit is contained in:
@@ -30,11 +30,10 @@
|
||||
<div class="appName fill" v-text="app.name"/>
|
||||
</div>
|
||||
</div>
|
||||
<AiLogin ref="login" @success="getAuth()"/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {mapMutations, mapState} from 'vuex'
|
||||
import {mapActions, mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: "home",
|
||||
@@ -57,18 +56,18 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['getUserInfo']),
|
||||
...mapActions(['getUserInfo', 'autoLogin']),
|
||||
handleLogin() {
|
||||
if (!this.token) {
|
||||
this.$refs.login.show();
|
||||
}
|
||||
this.autoLogin();
|
||||
} else this.$u.toast("已登录,无需重新登录!")
|
||||
},
|
||||
handleGotoApp(app) {
|
||||
uni.navigateTo({url: `${app.path}`})
|
||||
},
|
||||
getApps() {
|
||||
this.$instance.post("/node/wechatapps/list", null, {
|
||||
baseURL: "http://192.168.1.87:12525", params: {size: 999, type: 'mp'}
|
||||
baseURL: "http://192.168.1.87:12525", params: {size: 999, type: 'mp'}, withoutToken: true
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.apps = res.data.records.map(e => {
|
||||
@@ -80,14 +79,13 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
getAuth() {
|
||||
this.$nextTick(() => {
|
||||
this.getUserInfo()
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getAuth();
|
||||
if (this.token) {
|
||||
this.getUserInfo();
|
||||
} else {
|
||||
this.autoLogin().then(() => this.getUserInfo())
|
||||
}
|
||||
this.getApps()
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user