Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
R
rrpgLink_FrontEnd
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kesaubeeire
rrpgLink_FrontEnd
Commits
aab5ec8d
Commit
aab5ec8d
authored
Oct 20, 2023
by
JoyJ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix category
parent
d6253128
Pipeline
#23795
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
src/Content.svelte
src/Content.svelte
+21
-1
No files found.
src/Content.svelte
View file @
aab5ec8d
...
...
@@ -5,6 +5,7 @@
// -----------------------------
let List = [];
let categoryList = [];
/**获取所有资料*/
const getContents = {
...
...
@@ -18,6 +19,17 @@
}
};
const getCategoryList = {
url: `${$_env}/query.php?action=get_category`,
params: {
method: 'GET',
headers: {
'Content-Type': 'application/json;charset=UTF-8',
'Access-Control-Allow-Origin': true
}
}
}
/**创建 fetch 函数
* @param {object} param0 参数对象
* @param {function} callback 回调函数
...
...
@@ -46,6 +58,13 @@
});
}
createFetch(getCategoryList, data => {
console.log(data);
data.forEach(function(category){
categoryList[category.id]=category.category_name;
});
})
createFetch(getContents, data => {
console.log(data);
showList(data);
...
...
@@ -54,6 +73,7 @@
function showList(data) {
List = [...List, ...data];
}
</script>
<!-- ----------------------------------------------- DOM ----------------------------------------------- -->
...
...
@@ -64,7 +84,7 @@
title={item.cn_name}
sub_title={item.jp_name}
cover={$_env + item.folder + '/rpg_info/1.jpg' ?? ''}
language={
item.category
}
language={
categoryList[item.category] || "未知"
}
raw_tags={item.tags}
/>
{/each}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment