| | |
| | | })
|
| | | })
|
| | | },
|
| | | TideLogin({ commit }, code) {
|
| | | TideLogin( code) {
|
| | | return new Promise((resolve, reject) => {
|
| | | tideLogin(code)
|
| | | .then((res) => {
|
| | | setToken(res.token);
|
| | | commit("SET_TOKEN", res.token);
|
| | | Vue.prototype.uploadHeader = {
|
| | | Authorization: "Bearer " + res.token,
|
| | | };
|
| | | // commit("SET_TOKEN", res.token);
|
| | | // Vue.prototype.uploadHeader = {
|
| | | // Authorization: "Bearer " + res.token,
|
| | | // };
|
| | | resolve();
|
| | | })
|
| | | .catch((error) => {
|
| | |
| | | <div></div> |
| | | </template> |
| | | <script> |
| | | import store from "@/store"; |
| | | import useUserStore from '@/store/modules/user' |
| | | export default { |
| | | data() { |
| | | return {} |
| | |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | | goLogin() { |
| | | store.dispatch('TideLogin', {code : this.$route.query.code}).then(() => { |
| | | goLogin() { |
| | | useUserStore().TideLogin( {code : this.$route.query.code}).then(() => { |
| | | this.$router.push({ path: this.redirect || "/" }).catch(() => { }); |
| | | }) |
| | | } |