diff --git a/src/App.vue b/src/App.vue
index 98240aef..08102c12 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,3 +1,18 @@
+
+
diff --git a/src/components/common/VerificationAlert.vue b/src/components/common/VerificationAlert.vue
new file mode 100644
index 00000000..2d7f20f2
--- /dev/null
+++ b/src/components/common/VerificationAlert.vue
@@ -0,0 +1,27 @@
+
+
+
diff --git a/src/i18n/zh/auth/message.ts b/src/i18n/zh/auth/message.ts
index 4cae18e7..541b22fa 100644
--- a/src/i18n/zh/auth/message.ts
+++ b/src/i18n/zh/auth/message.ts
@@ -1,3 +1,5 @@
export default {
- scanToLogin: '使用微信扫码关注公众号「知数云」即可登录/注册'
+ scanToLogin: '使用微信扫码关注公众号「知数云」即可登录/注册',
+ needVerification: '由于您尚未完成实名认证,所以无法查看课程。',
+ goVerification: '去实名认证'
};
diff --git a/src/i18n/zh/common/button.ts b/src/i18n/zh/common/button.ts
index 94727db1..14eb3f2e 100644
--- a/src/i18n/zh/common/button.ts
+++ b/src/i18n/zh/common/button.ts
@@ -10,5 +10,6 @@ export default {
alert: '警告',
info: '提示',
publish: '发布',
- watch: '观看'
+ watch: '观看',
+ verify: '去实名认证'
};
diff --git a/src/i18n/zh/common/message.ts b/src/i18n/zh/common/message.ts
index 4cbc21d0..7b9e1aae 100644
--- a/src/i18n/zh/common/message.ts
+++ b/src/i18n/zh/common/message.ts
@@ -1,4 +1,6 @@
export default {
copied: '复制成功',
- confirmDelete: '确认删除吗?'
+ confirmDelete: '确认删除吗?',
+ alert: '警告',
+ info: '温馨提示'
};
diff --git a/src/pages/course/Detail.vue b/src/pages/course/Detail.vue
index 42c88aef..3727578a 100644
--- a/src/pages/course/Detail.vue
+++ b/src/pages/course/Detail.vue
@@ -1,4 +1,5 @@
+
@@ -27,7 +28,7 @@
-
+
{
this.loading = false;
this.course = data;
@@ -163,8 +170,19 @@ export default defineComponent({
height: 55px;
}
+.verification-alert {
+ padding-top: 50px;
+ .go {
+ font-weight: bold;
+ }
+}
+
.episodes {
- padding: 50px;
+ padding: 50px 0;
+ &.disabled {
+ opacity: 0.2;
+ pointer-events: none;
+ }
.episode {
cursor: pointer;
margin-bottom: 2rem;
diff --git a/src/services/user/service.ts b/src/services/user/service.ts
index a4ee2abd..3903fdaf 100644
--- a/src/services/user/service.ts
+++ b/src/services/user/service.ts
@@ -3,10 +3,20 @@ import httpClient from '../instance';
import { IUserDetailResponse, IUser } from './types';
class UserService {
- key = 'users';
+ async getMe(): Promise> {
+ return httpClient.get('/me');
+ }
- async get(id: string | string[]): Promise> {
- return httpClient.get(`/${this.key}/${id}`);
+ async updateMe(data: IUser): Promise> {
+ return httpClient.put('/me', data);
+ }
+
+ async getVerify(): Promise> {
+ return httpClient.get('/verify');
+ }
+
+ async updateVerify(data: IUser): Promise> {
+ return httpClient.put('/verify', data);
}
}
diff --git a/vite.config.ts b/vite.config.ts
index ff1ee367..f69efbce 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -15,6 +15,10 @@ export default defineConfig({
cert: fs.readFileSync('certs/academy.local.zhishuyun.com.cert.crt')
},
proxy: {
+ '/api/v1/me': {
+ target: 'https://auth.test.zhishuyun.com',
+ changeOrigin: true
+ },
'/api': {
target: 'http://localhost:8000',
changeOrigin: true