You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							53 lines
						
					
					
						
							1.1 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							53 lines
						
					
					
						
							1.1 KiB
						
					
					
				| import { HTTP, Method } from '../utils/http.js' | |
| 
 | |
| // 请求url常量 | |
| const ArticeConst = { | |
|   artice_url: '/api/content/queryById', | |
|   artice_add_remove_collect_url: '/api/content/addOrDeleteCollection', | |
|   artice_online_url: '/api/content/signin', | |
| } | |
| 
 | |
| class ArticeModel extends HTTP { | |
|   constructor() { | |
|     super() | |
|   } | |
|   // 文章详情 | |
|   getDetail(aId, success) { | |
|     let params = { | |
|       url: ArticeConst.artice_url, | |
|       success: success, | |
|       method: Method.GET, | |
|       data: { | |
|         id: aId | |
|       } | |
|     } | |
|     this.request(params) | |
|   } | |
|   // 设置收藏还是取消 | |
|   // type: 0: 添加;1: 移除 | |
|   addOrRemoveCollect(aId, success) { | |
|     let params = { | |
|       url: ArticeConst.artice_add_remove_collect_url, | |
|       success: success, | |
|       method: Method.GET, | |
|       data: { | |
|         id: aId | |
|       } | |
|     } | |
|     this.request(params) | |
|   } | |
|   // 在线报名 | |
|   onlineSign(aId, success) { | |
|     let params = { | |
|       url: ArticeConst.artice_online_url, | |
|       success: success, | |
|       method: Method.GET, | |
|       data: { | |
|         contentId: aId | |
|       } | |
|     } | |
|     this.request(params) | |
|   } | |
| } | |
| 
 | |
| export { ArticeModel } |