12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <template>
- <view class="container">
- <navBar :back="true" title="设置" flex="cen" :navImg="navImg" color="#333333" background="#FFFFFF" />
- <view class="" style="height: 200px;">
- </view>
- <view class="" style="padding: 0 100rpx;">
- <button type="warn" @click="logout">退出登录</button>
- </view>
- </view>
- </template>
- <script>
- import {
- getCode,
- } from '@/api/test/index.js'
- import {
- mapMutations,
- mapActions,
- mapState,
- mapGetters
- } from 'vuex';
- export default {
- data() {
- return {
- }
- },
- onLoad() {
- },
- computed: {
- ...mapGetters('user', ['testInfo', 'testInfo2'])
- },
- methods: {
- logout() {
- uni.clearStorageSync()
- this.$toast('退出登录成功')
- setTimeout(() => {
- uni.reLaunch({
- url: '/pages/my/index'
- })
- }, 1500)
- },
- ...mapActions('user', ['testAct', 'testAct2']),
- async testReq() {
- let res = await getCode({
- mobile: '18884559619'
- })
- console.log('测试接口返回值:', res);
- },
- async testSt() {
- // console.log('修改仓库前的返回值:', this.$store.getters['user/testInfo']);
- // this.$store.dispatch('user/testAct', 'testtesttesttesttesttesttest')
- // console.log('修改仓库后的返回值:', this.$store.getters['user/testInfo']);
- let res = await this.testAct2({
- mobile: '15609038888'
- })
- if (res.code == 0) {
- this.$toast('获取验证码成功')
- console.log('testInfo2', this.testInfo2);
- } else {
- this.$toast(res.msg)
- }
- }
- }
- }
- </script>
- <style>
- </style>
|