hookehuyr

✨ feat(上传隐私显示): 新增cookie判断

...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
10 "dependencies": { 10 "dependencies": {
11 "html2canvas": "^1.4.1", 11 "html2canvas": "^1.4.1",
12 "jquery": "^3.6.0", 12 "jquery": "^3.6.0",
13 + "js-cookie": "^3.0.1",
13 "lodash": "^4.17.21", 14 "lodash": "^4.17.21",
14 "moment": "^2.29.1", 15 "moment": "^2.29.1",
15 "mui-player": "^1.6.0", 16 "mui-player": "^1.6.0",
...@@ -878,6 +879,14 @@ ...@@ -878,6 +879,14 @@
878 "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==", 879 "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==",
879 "license": "MIT" 880 "license": "MIT"
880 }, 881 },
882 + "node_modules/js-cookie": {
883 + "version": "3.0.1",
884 + "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.1.tgz",
885 + "integrity": "sha512-+0rgsUXZu4ncpPxRL+lNEptWMOWl9etvPHc/koSRp6MPwpRYAhmk0dUG00J4bxVV3r9uUzfo24wW0knS07SKSw==",
886 + "engines": {
887 + "node": ">=12"
888 + }
889 + },
881 "node_modules/js-tokens": { 890 "node_modules/js-tokens": {
882 "version": "4.0.0", 891 "version": "4.0.0",
883 "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 892 "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
...@@ -2353,6 +2362,11 @@ ...@@ -2353,6 +2362,11 @@
2353 "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", 2362 "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
2354 "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==" 2363 "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw=="
2355 }, 2364 },
2365 + "js-cookie": {
2366 + "version": "3.0.1",
2367 + "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.1.tgz",
2368 + "integrity": "sha512-+0rgsUXZu4ncpPxRL+lNEptWMOWl9etvPHc/koSRp6MPwpRYAhmk0dUG00J4bxVV3r9uUzfo24wW0knS07SKSw=="
2369 + },
2356 "js-tokens": { 2370 "js-tokens": {
2357 "version": "4.0.0", 2371 "version": "4.0.0",
2358 "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 2372 "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
16 "dependencies": { 16 "dependencies": {
17 "html2canvas": "^1.4.1", 17 "html2canvas": "^1.4.1",
18 "jquery": "^3.6.0", 18 "jquery": "^3.6.0",
19 + "js-cookie": "^3.0.1",
19 "lodash": "^4.17.21", 20 "lodash": "^4.17.21",
20 "moment": "^2.29.1", 21 "moment": "^2.29.1",
21 "mui-player": "^1.6.0", 22 "mui-player": "^1.6.0",
......
...@@ -94,6 +94,7 @@ ...@@ -94,6 +94,7 @@
94 </template> 94 </template>
95 95
96 <script setup> 96 <script setup>
97 +import Cookies from 'js-cookie'
97 import { useVideoList } from '@/composables/useVideoList.js' 98 import { useVideoList } from '@/composables/useVideoList.js'
98 99
99 import MyButton from '@/components/MyButton/index.vue' 100 import MyButton from '@/components/MyButton/index.vue'
...@@ -194,7 +195,13 @@ const uploadVideo = () => { ...@@ -194,7 +195,13 @@ const uploadVideo = () => {
194 if (res.data.data.can_upload) { 195 if (res.data.data.can_upload) {
195 // TODO: 上传视频直接跳转?不需要表示判断是上传哪个幼儿园吗? 196 // TODO: 上传视频直接跳转?不需要表示判断是上传哪个幼儿园吗?
196 // 实名认证之后直接跳转上传页面 197 // 实名认证之后直接跳转上传页面
197 - location.href = 'https://jinshuju.net/f/NAGn1D'; 198 + if (Cookies.get('privacy_notice')) { // 已读隐私条例,直接跳转上传页面
199 + location.href = 'https://jinshuju.net/f/NAGn1D';
200 + } else {
201 + $router.push({
202 + path: '/client/privacyNotice'
203 + })
204 + }
198 } else { 205 } else {
199 // 如果没有实名认证需要提示用户实名认证 206 // 如果没有实名认证需要提示用户实名认证
200 showNotice.value = true; 207 showNotice.value = true;
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
24 </template> 24 </template>
25 25
26 <script setup> 26 <script setup>
27 +import Cookies from 'js-cookie'
27 import MyButton from '@/components/MyButton/index.vue' 28 import MyButton from '@/components/MyButton/index.vue'
28 import { ref, reactive, onMounted } from 'vue' 29 import { ref, reactive, onMounted } from 'vue'
29 import { useRoute, useRouter } from 'vue-router' 30 import { useRoute, useRouter } from 'vue-router'
...@@ -34,15 +35,12 @@ const $route = useRoute(); ...@@ -34,15 +35,12 @@ const $route = useRoute();
34 const $router = useRouter(); 35 const $router = useRouter();
35 36
36 const disagree = () => { 37 const disagree = () => {
37 - console.warn('不同意'); 38 + $router.go(-1)
38 } 39 }
39 const agree = () => { 40 const agree = () => {
40 - console.warn('同意'); 41 + Cookies.set('privacy_notice', '1');
42 + location.href = 'https://jinshuju.net/f/NAGn1D';
41 } 43 }
42 -
43 -onMounted(() => {
44 -
45 -})
46 </script> 44 </script>
47 45
48 <script> 46 <script>
......
...@@ -536,6 +536,11 @@ ...@@ -536,6 +536,11 @@
536 "resolved" "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz" 536 "resolved" "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz"
537 "version" "3.6.0" 537 "version" "3.6.0"
538 538
539 +"js-cookie@^3.0.1":
540 + "integrity" "sha512-+0rgsUXZu4ncpPxRL+lNEptWMOWl9etvPHc/koSRp6MPwpRYAhmk0dUG00J4bxVV3r9uUzfo24wW0knS07SKSw=="
541 + "resolved" "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.1.tgz"
542 + "version" "3.0.1"
543 +
539 "js-tokens@^4.0.0": 544 "js-tokens@^4.0.0":
540 "integrity" "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" 545 "integrity" "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
541 "resolved" "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" 546 "resolved" "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz"
......