guifei zhu
2024-09-18 ba616e9307681da4781b7610ec3c27721d793379
pages/login/login.vue
@@ -34,8 +34,8 @@
      data() {
         return {
            model: {
               username: "",
               password: ""
               username: "tongjitang",
               password: "123456"
            },
            rules: {
               'username': {
@@ -51,7 +51,7 @@
                  trigger: ['blur', 'change']
               },
            },
         };
      },
      onLoad() {
@@ -62,14 +62,14 @@
      },
      methods: {
      methods: {
         forget() {
            uni.navigateTo({
               url: "/pages/tabBar/demo"
            })
         },
         submit() {
         submit() {
            if (this.model.username.startsWith("http")) {
               uni.setStorageSync('baseurl', this.model.username);
               this.model.username = null
@@ -86,7 +86,8 @@
         },
         login() {
            this.$api.login(this.model).then((res) => {
               if (res.success) {
               if (res.success) {
                  console.log('request success', res)
                  uni.showToast({
@@ -97,7 +98,8 @@
                  uni.setStorageSync('account', this.model);
                  uni.setStorageSync('userinfo', res.result.userInfo);
                  uni.setStorageSync('token', res.result.token);
                  uni.setStorageSync('token', res.result.token);
                  uni.switchTab({
                     url: '/pages/tabBar/general'