移动端
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

65 строки
1.3 KiB

  1. <template>
  2. <div class="app-container">
  3. </div>
  4. </template>
  5. <script>
  6. import {Dialog} from "vant";
  7. const TEST = 0;
  8. export default {
  9. name: "ChungengUserSSOLogin",
  10. data() {
  11. return {
  12. };
  13. },
  14. created() {
  15. this.Login();
  16. },
  17. methods: {
  18. GetToken() {
  19. if(TEST)
  20. {
  21. if(!this.$route.query.s)
  22. return this.$route.query.s;
  23. let phone = '704d238d95b61f8304ce9e9c2d70e0bf';
  24. //phone = '525e902f509a7147ad92e602139bd267'
  25. let ts = '1234567890123';
  26. return phone + '#' + ts;
  27. }
  28. else
  29. return this.$route.query.s;
  30. },
  31. ShowToast(content, title) {
  32. return Dialog.alert({
  33. title: title,
  34. message: content,
  35. theme: 'round-button',
  36. });
  37. },
  38. Login() {
  39. let code = this.GetToken();
  40. if(!code)
  41. {
  42. this.ShowToast('请从春耕App进入登录').then(() => {
  43. history.back();
  44. });
  45. return false;
  46. }
  47. this.$store.dispatch("ChungengLogin", {code})
  48. .then(() => {
  49. this.$router.push({ path: "/yinnong/doneCompleted/completed" });
  50. })
  51. .catch((error) => {
  52. this.ShowToast(error || '春耕App用户登录失败').then(() => {
  53. history.back();
  54. });
  55. });
  56. },
  57. },
  58. };
  59. </script>
  60. <style scoped lang="scss">
  61. </style>