1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <template>
- <div class="disk-page">
- <disk :user-card-id="userCardId"></disk>
- </div>
- </template>
- <script>
- import qs from 'qs';
- const isNew = false;
- export default {
- name: 'DiskPage',
- middleware: [
- async ({ base, route, $axios, $auth, redirect, $userAgent }) => {
- if (isNew) {
- return;
- }
- // const res = await $axios.$get(
- // '/resources/v5/client/disk/info/userCard/single',
- // {
- // params: {
- // userCardId: route.params.id,
- // },
- // },
- // );
- console.log('route.params.id', route.params.id);
- const res = await $axios.$post('/resources/user/cloud/connect', { userCardId: route.params.id });
- const {
- userCardId,
- userName,
- room,
- buyVipType,
- sourceType,
- authPhone,
- validTime,
- id,
- } = res.data;
- const token = $auth.strategy.token.get();
- const url = `${location.origin}${base}${
- $userAgent.isIos ? 'screenIos' : 'screenAndroid'
- }/WXtrialInterface.html${qs.stringify(
- {
- userCardId,
- username: $auth.user.username,
- token,
- rm: room,
- mealType: buyVipType,
- sourceType,
- authPhone: authPhone ? 'huo' : 'none',
- validTime,
- record: id,
- },
- {
- addQueryPrefix: true,
- },
- )}`;
- redirect(url);
- },
- ],
- data() {
- return {
- userCardId: null,
- };
- },
- fetch() {
- this.userCardId = +this.$route.params.id;
- },
- methods: {},
- };
- </script>
- <style lang="scss" scoped>
- .disk-page {
- height: 100vh;
- position: relative;
- }
- </style>
|