feat(aigc): fully integrate backend API and replace mock data
- Replace all static mock data with real backend API calls for templates, generation tasks, credit balance and recharge - Remove deprecated mock data files including templates.js, versionOptions.js, records.js and packages.js - Add useCurrentCredit composable for fetching and managing user credit balance - Update all components to align with new backend data shapes (e.g. templateItemId instead of id) - Add loading and disabled states for interactive UI elements - Implement full WeChat mini-program payment flow for credit recharge - Fix template and record card UI styling and media handling - Set developVersion flag to true for testing environment
This commit is contained in:
34
src/request/api/AigcApi.js
Normal file
34
src/request/api/AigcApi.js
Normal file
@@ -0,0 +1,34 @@
|
||||
import request from "../base/request";
|
||||
|
||||
function getAigcTemplateList() {
|
||||
return request.get("/hotelBiz/aigc/aigcTemplateList", {});
|
||||
}
|
||||
|
||||
function getAigcTemplateItemList(args) {
|
||||
return request.post("/hotelBiz/aigc/aigcTemplateItemList", args);
|
||||
}
|
||||
|
||||
function getAigcGeneratorTaskList(args) {
|
||||
return request.post("/hotelBiz/aigcGeneratorTask/aigcGeneratorTaskList", args);
|
||||
}
|
||||
|
||||
function createAigcGeneratorTask(args) {
|
||||
return request.post("/hotelBiz/aigcGeneratorTask/createAigcGeneratorTask", args);
|
||||
}
|
||||
|
||||
function getCurrentCredit() {
|
||||
return request.get("/hotelBiz/credit/current", {});
|
||||
}
|
||||
|
||||
function rechargeCredit(args) {
|
||||
return request.post("/hotelBiz/credit/recharge", args);
|
||||
}
|
||||
|
||||
export {
|
||||
getAigcTemplateList,
|
||||
getAigcTemplateItemList,
|
||||
getAigcGeneratorTaskList,
|
||||
createAigcGeneratorTask,
|
||||
getCurrentCredit,
|
||||
rechargeCredit,
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import { getServiceUrl } from "../api/GetServiceUrlApi";
|
||||
const versionValue = "1.1.3";
|
||||
|
||||
/// 是否是测试版本, 测试版本为true, 发布版本为false
|
||||
const developVersion = false;
|
||||
const developVersion = true;
|
||||
|
||||
// 获取服务地址
|
||||
const getEvnUrl = async () => {
|
||||
|
||||
Reference in New Issue
Block a user