Commit 0c830a03 authored by hanfeng zhang's avatar hanfeng zhang

321

parent 5b9697b5
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
<script lang="ts"> <script lang="ts">
import Vue from "vue"; import Vue from "vue";
import Clipboard from "clipboard"; // import Clipboard from "clipboard";
import { ActionSheet } from "vant"; import { ActionSheet } from "vant";
export default Vue.extend({ export default Vue.extend({
......
This diff is collapsed.
...@@ -115,6 +115,7 @@ const routes: Array<RouteConfig> = [ ...@@ -115,6 +115,7 @@ const routes: Array<RouteConfig> = [
name: 'Login', name: 'Login',
component: () => import("@/view/Auth/Login/index.vue") component: () => import("@/view/Auth/Login/index.vue")
}, },
// { // {
// path: '/auth/PwdSetting', // path: '/auth/PwdSetting',
// name: 'PwdSetting', // name: 'PwdSetting',
...@@ -147,8 +148,10 @@ const router = new VueRouter({ ...@@ -147,8 +148,10 @@ const router = new VueRouter({
}) })
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
if (to.name === 'Login' && token.getToken() !== null) { console.log('to:',to , 'from:',from );
next({ name: 'Home' })
if (to.name === 'Login' && token.getToken() != null) {
// next({ name: 'Home' })
} else { } else {
next() next()
} }
......
...@@ -27,16 +27,15 @@ export class Service { ...@@ -27,16 +27,15 @@ export class Service {
const post = this.service.post const post = this.service.post
const resolveData = async (ret: any) => { const resolveData = async (ret: any) => {
if (ret.code === 200){ if (ret.code === 200){
console.log(ret);
if(ret.data){ if(ret.data){
return ret.data; return ret.data;
} }
return ret return ret
}else { }else {
if(ret.code === 401){ if(ret.code === 401){
Toast.fail('请重新登录')
await logoutUser().then(()=>{ await logoutUser().then(()=>{
router.push('') router.push({name:'Login'})
}) })
} }
Toast.fail(typeof ret.data === "string" ? ret.data : ret.message) Toast.fail(typeof ret.data === "string" ? ret.data : ret.message)
......
import router from '@/router'
const KEY_TOKEN = 'KEY_TOKEN' const KEY_TOKEN = 'KEY_TOKEN'
const KEY_USER = 'KEY_USER' const KEY_USER = 'KEY_USER'
...@@ -35,7 +35,8 @@ function getUserMsg(): object | null { ...@@ -35,7 +35,8 @@ function getUserMsg(): object | null {
}catch(err){ }catch(err){
console.log(err,'123khi12oi3h12io3oi123io2j13oij12io3'); console.log(err,'123khi12oi3h12io3oi123io2j13oij12io3');
} }
return userStr ? JSON.parse(userStr) : router.push({name:'Login'})
return userStr? JSON.parse(userStr) :''
} }
function clearUserMsg(){ function clearUserMsg(){
......
<template> <template>
<div class="userAgreement h-full overflow-auto px-5"> <div class="flex flex-col w-11/12 mx-auto py-5 text-font-white">
<img @click="handleClickClose" :src="closeIcon" alt="close" /> <div class="flex justify-between items-center">
<div class="text-font-white text-sm" v-for="n in 20" :key="n"> <div class="w-3/12">
这里是协议内容,待产品提供后,开发直接替换上去,这里是协议内容。 <app-icon name="icon-fanhui" @click.native="handleClickClose"></app-icon>
</div>
<div class='text-center w-6/12' >
乐映用户协议
</div>
<div class="w-3/12"></div>
</div>
<div class='flex py-6 justify-center'>
<img src="@/assets/img/cmp_logo.png" class="h-12" alt="" />
</div>
<div>
</div> </div>
</div> </div>
</template> </template>
...@@ -17,8 +28,12 @@ export default Vue.extend({ ...@@ -17,8 +28,12 @@ export default Vue.extend({
data() { data() {
return { return {
closeIcon, closeIcon,
}; };
}, },
components: {
'app-icon':()=>import('@/components/common/Icon.vue'),
},
methods: { methods: {
handleClick() { handleClick() {
console.log(123); console.log(123);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment