Fix inviter id setting (#17)
This commit is contained in:
1 parent
fa0250beca
commit
140a585316
5 files changed
+20
-40
No files matched your search
+4
-3
@@ -9,8 +9,8 @@
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElConfigProvider } from 'element-plus';
|
||||
import zhCn from 'element-plus/dist/locale/zh-cn.mjs';
|
||||
import { getDomain, getPath, setCookie } from './utils';
|
||||
import AuthPanel from './components/common/AuthPanel.vue';
|
||||
import { setCookie } from 'typescript-cookie';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
@@ -23,6 +23,9 @@ export default defineComponent({
|
||||
inviterId: this.$route.query.inviter_id?.toString()
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.onSetCookie();
|
||||
},
|
||||
methods: {
|
||||
onSetCookie() {
|
||||
// set inviter to cookies to persist
|
||||
@@ -31,8 +34,6 @@ export default defineComponent({
|
||||
const expiration = new Date();
|
||||
expiration.setDate(expiration.getDate() + 7);
|
||||
setCookie('INVITER_ID', this.inviterId, {
|
||||
domain: getDomain(),
|
||||
path: getPath(),
|
||||
expires: expiration
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user